#!/bin/bash # $Header: /magellan-cvs/src/xorg/xdm.rc,v 1.3 2008/12/26 02:04:07 niro Exp $ #%rlevels: 3:s 0:k #%start: 95 #%stop: 05 #deps #%needs: #%before: #%after: source /etc/conf.d/rc source $rc_functions source /etc/profile case $1 in start) rc_print "Starting slim ..." /sbin/start-stop-daemon --start --quiet --exec /usr/bin/slim evaluate_retval update_svcstatus $1 splash svc_started "$(basename $0)" 0 ;; stop) rc_print "Stopping slim ..." start-stop-daemon --stop --quiet --exe /usr/bin/slim evaluate_retval # chvt to 1 if [[ ${runlevel} != reboot ]] || [[ ${runlevel} != shutdown ]] then # only do it, if fbsplash is *not* running (busybox hack) if [[ -z $(pidof fbsplash) ]] then # wait until slim was stopped - ugly hack while [[ -z $(pidof slim) ]]; do sleep 0.1; done [[ $(fgconsole) -ne 1 ]] && chvt 1 fi fi update_svcstatus $1 splash svc_stopped "$(basename $0)" 0 ;; restart) $0 stop sleep 1 $0 start ;; status) statusproc /usr/bin/slim ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac