mirror of
https://github.com/processone/ejabberd
synced 2025-10-06 03:50:15 +02:00
ejabberdctl: support OpenBSD su
OpenBSD has a different than Linux su: 1. `-c` before username is treated as login class; 2. it doesn't require `--` as arguments separator. Without (1) it complains as: su: no such login class: exec "$0" "$@" and without (2): -: --: not found Here, I've added detection of OS via `uname -s` which routes to the right `su`. I really think that other BSD may need it as well.
This commit is contained in:
parent
10f6723f00
commit
8aae7424e9
1 changed files with 10 additions and 3 deletions
|
@ -129,9 +129,16 @@ set_dist_client()
|
|||
# run command either directly or via su $INSTALLUSER
|
||||
exec_cmd()
|
||||
{
|
||||
case $EXEC_CMD in
|
||||
as_install_user) su -s /bin/sh -c 'exec "$0" "$@"' "$INSTALLUSER" -- "$@" ;;
|
||||
as_current_user) "$@" ;;
|
||||
case $EXEC_CMD,$(uname -s) in
|
||||
as_install_user,OpenBSD)
|
||||
su -s /bin/sh "$INSTALLUSER" -c 'exec "$0" "$@"' "$@"
|
||||
;;
|
||||
as_install_user,*)
|
||||
su -s /bin/sh -c 'exec "$0" "$@"' "$INSTALLUSER" -- "$@"
|
||||
;;
|
||||
as_current_user,*)
|
||||
"$@"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
exec_erl()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue