/[adm]/puppet/modules/gitmirror/templates/on-the-pull.init
ViewVC logotype

Annotation of /puppet/modules/gitmirror/templates/on-the-pull.init

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3416 - (hide annotations) (download)
Mon Feb 10 10:16:57 2014 UTC (6 years, 8 months ago) by colin
File size: 1421 byte(s)
gitmirror: Add chkconfig headers to init script
1 colin 3407 #! /bin/bash
2     #
3 colin 3416 # on-the-pull Keep git mirrors up-to-date via external triggers
4     #
5     # chkconfig: 2345 80 30
6     # description: Keep git mirrors up-to-date via external triggers
7     #
8 colin 3407 ### BEGIN INIT INFO
9     # Provides: on-the-pull
10     # Required-Start: $network
11     # Required-Stop: $network
12     # Default-Start: 2 3 4 5
13     # Short-Description: Keep git mirrors up-to-date via external triggers
14     # Description: Keep git mirrors up-to-date via external triggers
15     ### END INIT INFO
16    
17     # Source function library.
18     . /etc/init.d/functions
19    
20     pidfile=/var/run/on-the-pull/on-the-pull.pid
21     prog=/usr/local/bin/on-the-pull
22 colin 3415 args="--pid-file=$pidfile --user=git --cmd=/usr/local/bin/gitmirror-sync-metadata git://git.mageia.org /git"
23 colin 3407
24    
25     start() {
26     gprintf "Starting On-The-Pull Git Mirror Daemon: "
27 colin 3415 daemon --check on-the-pull --pidfile $pidfile "$prog $args >>/var/log/on-the-pull.log 2>&1"
28 colin 3407 RETVAL=$?
29     echo
30     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/on-the-pull
31     return $RETVAL
32     }
33    
34     stop() {
35     gprintf "Stopping On-The-Pull Git Mirror Daemon: "
36     killproc -p $pidfile on-the-pull
37 colin 3415 echo
38 colin 3409 rm -f /var/lock/subsys/on-the-pull
39 colin 3407 }
40    
41     restart() {
42     stop
43     start
44     }
45    
46     case "$1" in
47     start)
48     start
49     ;;
50     stop)
51     stop
52     ;;
53     status)
54     status on-the-pull $pidfile
55     ;;
56     restart|reload)
57     restart
58     ;;
59     condrestart)
60     [ -f /var/lock/subsys/on-the-pull ] && restart || :
61     ;;
62     *)
63     gprintf "Usage: %s {start|stop|status|restart|condrestart}\n" "$(basename $0)"
64     exit 1
65     esac
66    
67     exit 0

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.28