--- /dev/null
+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>
+
--- /dev/null
+### 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