mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
new dtlogin rc script for linux from David McBrayer <d9j0m.dev@gmail.com>
This commit is contained in:
parent
727b47894c
commit
a128f8e4e4
2 changed files with 77 additions and 0 deletions
19
cde/contrib/rc/linux/README.dtlogin
Normal file
19
cde/contrib/rc/linux/README.dtlogin
Normal file
|
@ -0,0 +1,19 @@
|
|||
I have attached an LSB-compliant init script for dtlogin as an update to
|
||||
the current wiki. All instructions currently on the wiki should be left.
|
||||
This only replaces the script contents. This allows dtlogin to be
|
||||
controlled using either of the following syntax:
|
||||
|
||||
/etc/init.d/dtlogin start | stop | restart | status
|
||||
service dtlogin start | stop | restart | status
|
||||
|
||||
With the old script, dtlogin would be restarted on shutdown which resulted
|
||||
in the system hanging. This script allows CDE to be properly shutdown on
|
||||
halt or restarts.
|
||||
|
||||
If anyone can improve/change/enhance this script, please feel free. This is
|
||||
just my attempt at getting a working version so my system doesn't hang.
|
||||
Also, note that there is no #!/bin/sh at the start of the file. It is not
|
||||
necessary and will cause the script not to work properly.
|
||||
|
||||
David McBrayer <d9j0m.dev@gmail.com>
|
||||
|
58
cde/contrib/rc/linux/dtlogin
Normal file
58
cde/contrib/rc/linux/dtlogin
Normal file
|
@ -0,0 +1,58 @@
|
|||
### BEGIN INIT INFO
|
||||
# Provides:
|
||||
# Required-Start: $all
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: Dtlogin
|
||||
# Description: Dtlogin
|
||||
### END INIT INFO
|
||||
|
||||
case "$1" in
|
||||
'start')
|
||||
if [ -z "$(pgrep dtlogin)" ];
|
||||
then
|
||||
echo " * Starting dtlogin..."
|
||||
export LANG=C
|
||||
exec /usr/dt/bin/dtlogin
|
||||
else
|
||||
echo "DTlogin already running..."
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
'stop')
|
||||
if [ -z "$(pgrep dtlogin)" ];
|
||||
then
|
||||
exit 0
|
||||
else
|
||||
echo " * Stopping dtlogin..."
|
||||
killall /usr/dt/bin/dtlogin
|
||||
fi
|
||||
;;
|
||||
'restart')
|
||||
if [ -z "$(pgrep dtlogin)" ];
|
||||
then
|
||||
export LANG=C
|
||||
exec /usr/dt/bin/dtlogin
|
||||
else
|
||||
echo " * Restarting dtlogin..."
|
||||
killall /usr/dt/bin/dtlogin
|
||||
export LANG=C
|
||||
exec /usr/dt/bin/dtlogin
|
||||
fi
|
||||
;;
|
||||
'status')
|
||||
if [ -z "$(pgrep dtlogin)" ];
|
||||
then
|
||||
echo "DTlogin is not currently running..."
|
||||
exit 3
|
||||
else
|
||||
echo "DTlogin is running..." && echo "[ $(pidof dtlogin) ]"
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|status}"
|
||||
exit 0
|
||||
;;
|
||||
esac
|
Loading…
Reference in a new issue