#! /bin/sh # # Author: Matt Zimmerman # ### BEGIN INIT INFO # Provides: ltsp-client # Required-Start: ltsp-client-setup $network $syslog # Required-Stop: ltsp-client-setup $network $syslog # Should-Start: xdebconfigurator # Default-Start: 2 3 4 5 # Default-Stop: S 0 1 6 # Short-Description: Script for LTSP client initialization # Description: ### END INIT INFO set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="LTSP client" NAME=ltsp-client SCRIPTNAME=/etc/init.d/$NAME # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 . /lib/lsb/init-functions . /usr/lib/ltsp/ltsp_functions . /usr/lib/ltsp/ltsp_config start_sound() { if [ -n "$SOUND" ]; then # Detect and report a common problem with thin clients if [ ! -f /dev/dsp ] ; then echo "Sound requested but /dev/dsp is missing. Continuing." fi case "$SOUND_DAEMON" in esd|'') # The default when no value is set /usr/bin/esd -nobeeps -public -tcp & ;; nasd) /usr/bin/nasd -aa & # Line copied from old LTSP: Should we use it? [pere 2006-03-03] #aumix-minimal -v100 -w100 -c90 -m10 ;; *) echo "Unable to start unsupported sound daemon: '$SOUND_DAEMON'" ;; esac fi } case "$1" in start) log_begin_msg "Starting LTSP client..." start_sound || true for screen in $(env | awk -F= '$1 ~ /^SCREEN_/ { print $1 }'); do num=${screen##SCREEN_} start-stop-daemon --start -b --exec /usr/lib/ltsp/screen_session -- "$num" done log_end_msg 0 ;; stop) # echo -n "Stopping $DESC: $NAME" # d_stop # echo "." ;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # echo -n "Restarting $DESC: $NAME" d_stop sleep 1 d_start echo "." ;; *) # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0