Don't use 'su' in qubes.WaitForSession if not needed
This commit is contained in:
parent
626d20b5c2
commit
80d41cd10a
@ -1,5 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
read USERNAME
|
read USERNAME
|
||||||
su -c 'echo $$ >> /tmp/qubes-session-waiter; [ ! -f /tmp/qubes-session-env ] && exec sleep inf' - "$USERNAME" 2> /dev/null
|
cmd='echo $$ >> /tmp/qubes-session-waiter; [ ! -f /tmp/qubes-session-env ] && exec sleep inf'
|
||||||
|
if [ "$(id -un)" = "$USERNAME" ]; then
|
||||||
|
sh -c "$cmd" 2>/dev/null
|
||||||
|
else
|
||||||
|
su -c "$cmd" - "$USERNAME" 2> /dev/null
|
||||||
|
fi
|
||||||
# the above line is _expected_ to be terminated by a signal, don't treat this as a failure
|
# the above line is _expected_ to be terminated by a signal, don't treat this as a failure
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user