Skip to content

Commit 7ba6262

Browse files
committed
case-lib: lib.sh fix restore_pulseaudio not work
remove 'nohup' with sudo command to avoid reset sudo kill extend 'sudo' process for pulseaudio after restore finish Signed-off-by: Wu, BinX <binx.wu@intel.com>
1 parent 04a0717 commit 7ba6262

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

case-lib/lib.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func_lib_restore_pulseaudio()
128128
do
129129
user=${line%% *}
130130
cmd=${line#* }
131-
nohup sudo -u "$user" "$cmd" >/dev/null &
131+
sudo -u "$user" -i "$cmd" 2>/dev/null &
132132
done
133133
# now wait for the pulseaudio restore in the ps process
134134
timeout=10
@@ -143,6 +143,11 @@ func_lib_restore_pulseaudio()
143143
fi
144144
done
145145
dlogi "Restoring pulseaudio takes $wait_time seconds"
146+
# kill father process cause by sudo
147+
sudo_pid_lst="$(pidof sudo)"
148+
if [ "$sudo_pid_lst" ];then
149+
sudo kill -9 "$sudo_pid_lst"
150+
fi
146151
unset PULSECMD_LST
147152
unset PULSE_PATHS
148153
declare -ag PULSECMD_LST

0 commit comments

Comments
 (0)