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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.28