github.com/simpleiot/simpleiot@v0.18.3/contrib/siot.init (about)

     1  #!/bin/sh
     2  #
     3  PIDFILE=/var/run/siot.pid
     4  DESC="Simple IoT cloud/edge application/framework portal"
     5  DATADIR=/data/siot
     6  
     7  check_dbs () {
     8    echo "Add Database checks"
     9  }
    10  
    11  mkdir -p $DATADIR
    12  
    13  case "$1" in
    14    start)
    15          echo -n "Starting $DESC"
    16          check_dbs
    17          start-stop-daemon -S -m -p $PIDFILE -b -x /usr/bin/env SIOT_PORT=80 /usr/bin/siot -- -syslog
    18          ;;
    19    stop)
    20          echo -n "Stopping $DESC"
    21          start-stop-daemon -K -p $PIDFILE --retry 5
    22          ;;
    23    restart)
    24    echo -n "Restarting $DESC"
    25          start-stop-daemon -K -p $PIDFILE --retry 5
    26          start-stop-daemon -S -m -p $PIDFILE -b -x /usr/bin/env SIOT_PORT=80 /usr/bin/siot -- -syslog
    27          ;;
    28    *)
    29          echo "Usage: $N {start|stop|restart}" >&2
    30          exit 1
    31          ;;
    32  esac
    33  
    34  exit 0