Skip to content

Commit 4634460

Browse files
author
Richard Jones
committed
*** empty log message ***
1 parent 7e3b12c commit 4634460

File tree

3 files changed

+97
-1
lines changed

3 files changed

+97
-1
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ This file contains the changes to the Roundup system over time. The entries
22
are given with the most recent entry first.
33

44
2003-05-?? 0.6.0
5+
Feature:
6+
- added the start/stop/restart/condstart/status roundup-server control
7+
script
8+
59
Fixed:
610
- handle non-existant demo dir (thanks Ollie Rutherfurd)
711
- strip whitespace from Role names so "User, Admin" will work

TODO.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ pending web search "refinement" - pre-fill the search page with the
3434
pending web multilink item removal action with retirement
3535
pending web implement a python dict version of the form values
3636
pending web implement the request.url attribute?
37-
pending web UNIX init.d script for roundup-server
3837

3938
bug hyperdb need unit tests for firing of auditors and reactors
4039
======= ========= =============================================================

scripts/server-ctl

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/bin/sh
2+
3+
#
4+
# Configuration
5+
#
6+
PORT=8080
7+
PIDFILE="/usr/local/roundup/var/roundup-server.pid"
8+
LOGFILE="/usr/local/roundup/var/roundup-server.log"
9+
OTHERARGS=""
10+
TRACKERS="cg=/usr/local/roundup/trackers/cg"
11+
12+
SERVER="/usr/local/bin/roundup-server -l ${LOGFILE} -d ${PIDFILE} -p ${PORT} ${OTHERARGS} ${TRACKERS}"
13+
ERROR=0
14+
ARGV="$@"
15+
if [ "x$ARGV" = "x" ] ; then
16+
ARGS="help"
17+
fi
18+
19+
for ARG in $@ $ARGS
20+
do
21+
# check for pidfile
22+
if [ -f $PIDFILE ] ; then
23+
PID=`cat $PIDFILE`
24+
if [ "x$PID" != "x" ] && kill -0 $PID 2>/dev/null ; then
25+
STATUS="roundup-server (pid $PID) running"
26+
RUNNING=1
27+
else
28+
STATUS="roundup-server (pid $PID?) not running"
29+
RUNNING=0
30+
fi
31+
else
32+
STATUS="roundup-server (no pid file) not running"
33+
RUNNING=0
34+
fi
35+
36+
case $ARG in
37+
start)
38+
if [ $RUNNING -eq 1 ] ; then
39+
echo "$0 $ARG: roundup-server (pid $PID) already running"
40+
continue
41+
fi
42+
if $SERVER ; then
43+
echo "$0 $ARG: roundup-server started"
44+
else
45+
echo "$0 $ARG: roundup-server could not be started"
46+
ERROR=1
47+
fi
48+
;;
49+
condstart)
50+
if [ $RUNNING -eq 1 ] ; then
51+
continue
52+
fi
53+
if $SERVER ; then
54+
echo "$0 $ARG: roundup-server started"
55+
else
56+
echo "$0 $ARG: roundup-server could not be started"
57+
ERROR=1
58+
fi
59+
;;
60+
stop)
61+
if [ $RUNNING -eq 0 ] ; then
62+
echo "$0 $ARG: $STATUS"
63+
continue
64+
fi
65+
if kill $PID ; then
66+
echo "$0 $ARG: roundup-server stopped"
67+
else
68+
echo "$0 $ARG: roundup-server could not be stopped"
69+
ERROR=2
70+
fi
71+
;;
72+
status)
73+
echo $STATUS
74+
;;
75+
*)
76+
echo "usage: $0 (start|condstart|stop|status)"
77+
cat <<EOF
78+
79+
start - start roundup-server
80+
condstart - start roundup-server if it's not running
81+
stop - stop roundup-server
82+
status - display roundup-server status
83+
84+
EOF
85+
ERROR=3
86+
;;
87+
88+
esac
89+
90+
done
91+
92+
exit $ERROR
93+

0 commit comments

Comments
 (0)