X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=gdm.init;h=2d93dcebaf6ec6e84710439504f5c4a661562cb7;hb=refs%2Fheads%2FDEVEL;hp=270601a8bd71743b2982350baa75bdc8270b161c;hpb=3af70f60f6630cf32c9bd79a49621722b2063c0e;p=packages%2Fgdm.git diff --git a/gdm.init b/gdm.init index 270601a..2d93dce 100644 --- a/gdm.init +++ b/gdm.init @@ -4,7 +4,7 @@ # # Version: @(#) /etc/rc.d/init.d/gdm 0.1 # -# chkconfig: 5 95 5 +# chkconfig: 5 95 05 # description: Starts and stops the Gnome Display Manager at startup and \ # shutdown.. # @@ -14,45 +14,74 @@ . /etc/rc.d/init.d/functions +upstart_controlled + # Get service config if [ -f /etc/sysconfig/gdm ]; then . /etc/sysconfig/gdm fi +start() { + # Check if the service is already running? + if [ -f /var/lock/subsys/gdm ]; then + msg_already_running "Gnome Display Manager" + return + fi + + msg_starting "Gnome Display Manager" + start-stop-daemon --start -b --exec /usr/sbin/gdm + ok + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gdm +} + +stop() { + if [ ! -f /var/lock/subsys/gdm ]; then + msg_not_running "Gnome Display Manager" + return + fi + + msg_stopping "Gnome Display Manager" + killproc gdm + rm -f /var/lock/subsys/gdm +} + +condrestart() { + if [ ! -f /var/lock/subsys/gdm ]; then + msg_not_running "Gnome Display Manager" + RETVAL=$1 + return + fi + + stop + start +} + RETVAL=0 # See how we were called. case "$1" in start) - # Check if the service is already running? - if [ ! -f /var/lock/subsys/gdm ]; then - msg_starting "Gnome Display Manager" - daemon open /usr/sbin/gdm - RETVAL=$? - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/gdm - else - msg_already_running "Gnome Display Manager" - fi + start ;; stop) - if [ -f /var/lock/subsys/gdm ]; then - msg_stopping "Gnome Display Manager" - killproc gdm - rm -f /var/lock/subsys/gdm - else - msg_not_running "Gnome Display Manager" - fi + stop ;; - status) - status gdm - exit $? + restart) + stop + start ;; - restart|force-reload) - $0 stop - $0 start - exit $? + try-restart) + condrestart 0 + ;; + force-reload) + condrestart 7 + ;; + status) + status gdm gdm-binary + RETVAL=$? ;; *) - msg_usage "$0 {start|stop|restart|force-reload|status}" + msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" exit 3 esac