Commit ce35080f authored by Tails developers's avatar Tails developers
Browse files

Wait for remote shell to start listening in own init script instead of gdm3's.

Let's keep this stuff contained in as few places as possible since
there's really no point in having this wait happening in gdm3's script
given the init script dependencies.
parent ab96b9fe
......@@ -39,6 +39,16 @@ fi
# and status_of_proc is working.
. /lib/lsb/init-functions
wait_until_remote_shell_is_listening()
{
REMOTE_SHELL_STATE_FILE=/var/lib/live/autotest-remote-shell-running
if grep -qw "autotest_never_use_this_option" /proc/cmdline; then
until [ -e "${REMOTE_SHELL_STATE_FILE}" ]; do
sleep 1
done
fi
}
do_start()
{
start-stop-daemon \
......@@ -46,6 +56,7 @@ do_start()
--quiet \
--background \
--exec ${DAEMON} -- ${DAEMON_ARGS}
wait_until_remote_shell_is_listening
}
case "${1}" in
......
--- chroot.orig/etc/init.d/gdm3 2012-06-25 18:26:15.000000000 +0000
+++ chroot/etc/init.d/gdm3 2015-03-06 02:03:18.268000000 +0000
@@ -65,6 +65,16 @@
case "$1" in
start)
+ # If we're running in Tails' automated test suite, let's make sure
+ # that the remote shell is running to avoid races against Tails
+ # Greeter -- the remote shell must be running before it start.
+ REMOTE_SHELL_STATE_FILE=/var/lib/live/autotest-remote-shell-running
+ if grep -qw "autotest_never_use_this_option" /proc/cmdline; then
+ until [ -e "${REMOTE_SHELL_STATE_FILE}" ]; do
+ sleep 1
+ done
+ fi
+
CONFIGURED_DAEMON=$(basename "$(cat $DEFAULT_DISPLAY_MANAGER_FILE 2> /dev/null)")
if grep -wqs text /proc/cmdline; then
log_warning_msg "Not starting GNOME Display Manager; found 'text' in kernel commandline."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment