Opened 17 years ago
Last modified 7 years ago
#4352 closed enhancement
an init.d style start/stop script for tracd — at Initial Version
Reported by: | anonymous | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | lowest | Milestone: | |
Component: | web frontend/tracd | Version: | 0.10.2 |
Severity: | trivial | Keywords: | initd, init, script, tracd |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
An init.d script for tracd. bash, with paths for linux. minor modifications will suit other OS's.
Edit options and place in /etc/rc.d/init.d/ or your host OS's equivalent.
Apologies if something like this has already been submitted, I did not find anything in the wiki or contribs.
#!/bin/bash # # chkconfig: - 85 15 # description: tracd # processname: tracd # pidfile: /var/run/tracd.pid # Source function library. . /etc/rc.d/init.d/functions # EDIT AS NECESSARY # presumes you are using basic auth and have an htpasswd format file in /etc/tracd/tracusers OPTIONS="-s -r -d -p 8080 --basic-auth=*,/etc/tracd/tracusers,trac /trac" # or use this and modify to suit... if [ -f /etc/sysconfig/tracd ]; then . /etc/sysconfig/tracd fi tracd=${TRACD-/usr/sbin/tracd} prog=tracd pidfile=${PIDFILE-/var/run/tracd.pid} lockfile=${LOCKFILE-/var/lock/subsys/tracd} RETVAL=0 start() { if [ -a $lockfile ]; then echo "tracd appears to be running, or has crashed, or was not stopped properly." echo "check $pidfile, and remove $lockfile to start again." return -1; fi echo -n $"Starting $prog: " LANG=$TRACD_LANG daemon $tracd $OPTIONS --pidfile=${pidfile} RETVAL=$? echo [ $RETVAL = 0 ] && touch ${lockfile} return $RETVAL } stop() { if [ -a $pidfile ] then echo -n $"Stopping $prog: " kill -9 `cat ${pidfile}` RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} else echo "tracd appears not to be running." fi } # See how we were called. case "$1" in start) start ;; stop) stop ;; *) echo $"Usage: $prog {start|stop}" exit 1 esac exit $RETVAL
Note:
See TracTickets
for help on using tickets.