summaryrefslogtreecommitdiff
path: root/network/shibboleth-sp/rc.shibd
blob: db154529fab2c3a87c889893a08954716c688c87 (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
#!/bin/sh

SHIBD_USER=shibd
SHIBD_WAIT=30
SHIBD_PID=/var/run/shibboleth/shibd.pid

DAEMON_OPTS="-f -u $SHIBD_USER -g $SHIBD_USER -w $SHIBD_WAIT -p $SHIBD_PID"

shibd_start() {
  if [ -f $SHIBD_PID ]; then
    echo "The shibd service is already running"
  else
    echo "Starting the shibd service:  /usr/sbin/shibd"
    /usr/sbin/shibd $DAEMON_OPTS -p $SHIBD_PID
  fi
}

shibd_stop() {
  echo "Stoping the shibd service:  /usr/sbin/shibd"
  killall shibd
}

shibd_restart() {
  shibd_stop
  sleep 1
  shibd_start
}

shibd_configtest() {
  /usr/sbin/shibd -t
}

case "$1" in
  'start')
    shibd_start
  ;;
  'stop')
    shibd_stop
  ;;
  'restart')
    shibd_restart
  ;;
  'configtest')
    shibd_configtest
  ;;
  *)
    echo "Usage: $0 start|stop|restart|configtest"
  ;;
esac