summaryrefslogtreecommitdiff
path: root/system/conserver/rc.conserver
blob: c5dca028c52745b9c10f93aa70750d9e071a7ef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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