Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/hgweb/files/hgweb.sh

Issue 29323409: Issue 2867 - Introduce module hgweb and corresponding server role (Closed)
Patch Set: Issue 2867 - Now the complete patch-set again Created Aug. 17, 2015, 6:17 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 #!/bin/bash
2 ### BEGIN INIT INFO
3 # Provides: hgwebdir
4 # Required-Start: $local_fs $remote_fs $network
5 # Required-Stop: $local_fs $remote_fs $network
6 # Default-Start: 3 5
7 # Default-Stop: 0 1 2 6
8 # Description: HG FastCGI server
9 ### END INIT INFO
10
11 SCRIPT=/opt/hgweb.fcgi
12 FCGI_SOCKET=/var/run/hgweb.sock
13 PID_FILE=/var/run/hgweb.pid
14 USER=www-data
15
16 start() {
17 spawn-fcgi -f $SCRIPT -s $FCGI_SOCKET -P $PID_FILE -u $USER
18 }
19
20 stop() {
21 if [ -e "$PID_FILE" ]; then
22 kill -9 `cat $PID_FILE` && rm $PID_FILE && rm $FCGI_SOCKET
23 else
24 echo "daemon not running" >&2
25 fi
26 }
27
28 help() {
29 echo "Usage: $0 {start|stop|restart}"
30 test 'help' = "$1"
31 }
32
33 case "$1" in
34 start|stop) $1;;
35 restart) stop; start;;
36 *) help "$@";;
37 esac
OLDNEW

Powered by Google App Engine
This is Rietveld