Edgewall Software
Modify

Opened 18 years ago

Closed 17 years ago

Last modified 8 years ago

#4352 closed enhancement (wontfix)

an init.d style start/stop script for tracd

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 (last modified by anonymous)

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

Attachments (0)

Change History (4)

comment:1 by Christian Boos, 18 years ago

Thanks for the contributed example, but this kind of scripts are probably too much distribution specific, so I'm not sure it's worth integrating in /contrib.

Other opinions welcomed, but I propose a wontfix here.

comment:2 by Emmanuel Blot, 18 years ago

Agreed. This would better fit on http://trac-hacks.org/wiki/script

BTW, the status of /contrib needs some clarification, as some scripts are actively maintained (commit hooks), while some others are not.

comment:3 by Christian Boos, 17 years ago

Resolution: wontfix
Status: newclosed

As discussed above.

comment:4 by anonymous, 8 years ago

Description: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.