/[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 3407 - (hide annotations) (download)
Sun Feb 9 13:55:50 2014 UTC (6 years, 8 months ago) by colin
File size: 1184 byte(s)
Add a new system to ensure our git repos are mirrored properly.

This is a simple python daemon that I wrote which can be 'pinged' and told
to update (or freshly clone) given git repos.

Deploy this script on alamut (not started automatically yet)
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     }
33    
34     restart() {
35     stop
36     start
37     }
38    
39     case "$1" in
40     start)
41     start
42     ;;
43     stop)
44     stop
45     ;;
46     status)
47     status on-the-pull $pidfile
48     ;;
49     restart|reload)
50     restart
51     ;;
52     condrestart)
53     [ -f /var/lock/subsys/on-the-pull ] && restart || :
54     ;;
55     *)
56     gprintf "Usage: %s {start|stop|status|restart|condrestart}\n" "$(basename $0)"
57     exit 1
58     esac
59    
60     exit 0

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.28