summaryrefslogtreecommitdiff
path: root/system/conserver/rc.conserver
diff options
context:
space:
mode:
Diffstat (limited to 'system/conserver/rc.conserver')
-rw-r--r--system/conserver/rc.conserver53
1 files changed, 53 insertions, 0 deletions
diff --git a/system/conserver/rc.conserver b/system/conserver/rc.conserver
new file mode 100644
index 0000000000..c5dca028c5
--- /dev/null
+++ b/system/conserver/rc.conserver
@@ -0,0 +1,53 @@
+#!/bin/sh
+# Start/stop/restart the conserver console server daemon.
+
+# Start conserver:
+conserver_start() {
+ if [ -x /usr/sbin/conserver -a -d /var/consoles ]; then
+ echo "Starting conserver: /usr/sbin/conserver -d -v"
+ /usr/sbin/conserver -d -v
+ fi
+}
+
+# Stop conserver:
+conserver_stop() {
+ /bin/killall conserver
+}
+
+# Restart conserver:
+conserver_restart() {
+ conserver_stop
+ /bin/sleep 1
+ conserver_start
+}
+
+# Reread the configuration file
+conserver_reload() {
+ /bin/killall -HUP conserver
+}
+
+# Try and reconnect to any consoles that seem down
+conserver_reconnect() {
+ /bin/killall -USR1 conserver
+}
+
+case "$1" in
+'start')
+ conserver_start
+ ;;
+'stop')
+ conserver_stop
+ ;;
+'restart')
+ conserver_restart
+ ;;
+'reload')
+ conserver_reload
+ ;;
+'reconnect')
+ conserver_reconnect
+ ;;
+*)
+ echo "usage $0 start|stop|restart|reload|reconnect"
+esac
+