move from init.d script to systemd service file
authorBdale Garbee <bdale@gag.com>
Sat, 26 Oct 2019 21:28:35 +0000 (15:28 -0600)
committerBdale Garbee <bdale@gag.com>
Sat, 26 Oct 2019 21:28:35 +0000 (15:28 -0600)
debian/gcpegg.service [new file with mode: 0644]
debian/init.d [deleted file]

diff --git a/debian/gcpegg.service b/debian/gcpegg.service
new file mode 100644 (file)
index 0000000..55e882c
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=eggsh on tty8
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/eggsh
+StandardInput=tty
+StandardOutput=tty
+TTYPath=/dev/tty8
+WorkingDirectory=/var/spool/gcpegg
+
+[Install]
+WantedBy=multi-user.target
diff --git a/debian/init.d b/debian/init.d
deleted file mode 100644 (file)
index 14d8614..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-### BEGIN INIT INFO
-# Provides:          gcpegg
-# Required-Start:    $local_fs $remote_fs
-# Required-Stop:     $local_fs $remote_fs
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start GCP EGG software on virtual terminal 8
-### END INIT INFO
-
-set -e
-
-. /lib/lsb/init-functions
-
-test -x /usr/sbin/eggsh || exit 0
-test -d /var/spool/gcpegg || exit 0
-
-cd /var/spool/gcpegg
-
-case "$1" in
-  start)
-       echo -n "Starting GCP EGG software on virtual terminal 8: eggsh"
-       openvt /usr/sbin/eggsh
-       echo "."
-       ;;
-  stop)
-       echo -n "Stopping GCP EGG software: eggsh"
-       start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/eggsh
-       echo "."
-       ;;
-  reload|force-reload|restart)
-       echo -n "Restarting GCP EGG software on virtual terminal 8..."
-       start-stop-daemon --stop --quiet --oknodo --exec /usr/sbin/eggsh
-       openvt /usr/sbin/eggsh
-       echo "done."
-       ;;
-  purge)
-       echo -n "Purging all previously generated data by GCP EGG"  
-       rm -r /var/spool/gcpegg/*
-       echo "done."    
-       ;;
-  *)
-        echo "Usage: /etc/init.d/gcpegg {start|stop|reload|force-reload|restart|purge}"
-        exit 1
-       ;;
-esac
-
-exit 0