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

Start the remote shell earlier, via an init script.

The old live-config hook races with Tails Greeter, see #8941.
parent e0a5f209
......@@ -3,6 +3,7 @@
set -e
CUSTOM_INITSCRIPTS="
tails-autotest-remote-shell
tails-detect-virtualization
tails-kexec
tails-reconfigure-kexec
......
#! /bin/sh
### BEGIN INIT INFO
# Provides: tails-autotest-remote-shell
# Required-Start: mountkernfs $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# X-Start-Before: $x-display-manager gdm gdm3
# Short-Description: Remote shell (over serial link) used in Tails test suite
# Description: Remote shell (over serial link) used in Tails test suite
### END INIT INFO
# Author: Tails Developers <tails@boum.org>
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
DESC="Remote shell (over serial link) used in Tails test suite"
NAME="tails-autotest-remote-shell"
SCRIPTNAME="/etc/init.d/${NAME}"
DAEMON="/usr/local/lib/${NAME}"
DAEMON_ARGS="/dev/ttyS0"
# Exit if not run by Tails automated test suite. The if-construction
# below may seem silly but we really want to only continue running
# this script this if the expected kernel command-line option is
# present. Fail safe, not open, and all that.
if grep -qw "autotest_never_use_this_option" /proc/cmdline
then
:
else
exit 0
fi
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
do_start()
{
start-stop-daemon \
--start \
--quiet \
--background \
--exec ${DAEMON} -- ${DAEMON_ARGS}
}
case "${1}" in
start)
[ "${VERBOSE}" != no ] && log_daemon_msg "${DESC}" "${NAME}"
do_start
[ "${VERBOSE}" != no ] && log_end_msg ${?}
;;
restart|reload|stop|force-reload)
:
;;
*)
echo "Usage: ${SCRIPTNAME} start" >&2
exit 1
;;
esac
:
#!/bin/sh
SCRIPT=/usr/local/lib/tails-autotest-remote-shell
if grep -qw "autotest_never_use_this_option" /proc/cmdline; then
# FIXME: more beautiful solution
sed -i 's/^exit.*$//' /etc/rc.local
echo "( while true ; do ${SCRIPT} /dev/ttyS0 ; done ) &" >> \
/etc/rc.local
echo "exit 0" >> /etc/rc.local
fi
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