Changeset 31677 in project
- Timestamp:
- 10/18/14 18:13:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
wiki/spiffy-init-script
r29914 r31677 2 2 3 3 This script has also been prepared to play well with the "chkconfig" command on Red Hat derivatives (Fedora, CentOS, ...). 4 5 See below for a lsb-compatible script. 4 6 5 7 <enscript highlight="shell"> … … 71 73 esac 72 74 </enscript> 75 76 The following script is compatible with LSB init.d scripts, and has been tested on a Debian Wheezy system: 77 78 <enscript highlight="shell"> 79 #! /bin/sh 80 ### BEGIN INIT INFO 81 # Provides: spiffy 82 # Required-Start: $network 83 # Required-Stop: $network 84 # Default-Start: 2 3 4 5 85 # Default-Stop: 86 # Short-Description: Start Spiffy the webserver 87 ### END INIT INFO 88 89 . /lib/lsb/init-functions 90 91 # Must make this script executable with a shebang line, or compile it 92 DAEMON=/usr/local/libexec/spiffy.scm 93 PIDFILE=/var/run/spiffy.pid 94 95 test -x $DAEMON || exit 5 96 97 case $1 in 98 start) 99 log_daemon_msg "Starting web server" "spiffy" 100 start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON --make-pidfile $PIDFILE --background 101 log_end_msg $? 102 ;; 103 stop) 104 log_daemon_msg "Stopping web server" "spiffy" 105 start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE 106 log_end_msg $? 107 ;; 108 restart|force-reload) 109 $0 stop && sleep 2 && $0 start 110 ;; 111 try-restart) 112 if $0 status > /dev/null; then 113 $0 restart 114 else 115 exit 0 116 fi 117 ;; 118 reload) # not implemented 119 exit 3 120 ;; 121 status) 122 status_of_proc $DAEMON "Spiffy" 123 ;; 124 *) 125 echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}" 126 exit 2 127 ;; 128 esac 129 </enscript>
Note: See TracChangeset
for help on using the changeset viewer.