diff options
author | Colin Guthrie <colin@mageia.org> | 2014-02-09 13:55:50 +0000 |
---|---|---|
committer | Colin Guthrie <colin@mageia.org> | 2014-02-09 13:55:50 +0000 |
commit | 45c3e15f063ba493f67e6c3e67780118c86bb1bd (patch) | |
tree | e6f82243a318f2f0f6793ed1409a35306f074ebf /modules/gitmirror/templates/on-the-pull.init | |
parent | 07a56dfcfdfd9ccdf97454e589492eb8f6fb7223 (diff) | |
download | puppet-45c3e15f063ba493f67e6c3e67780118c86bb1bd.tar puppet-45c3e15f063ba493f67e6c3e67780118c86bb1bd.tar.gz puppet-45c3e15f063ba493f67e6c3e67780118c86bb1bd.tar.bz2 puppet-45c3e15f063ba493f67e6c3e67780118c86bb1bd.tar.xz puppet-45c3e15f063ba493f67e6c3e67780118c86bb1bd.zip |
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)
Diffstat (limited to 'modules/gitmirror/templates/on-the-pull.init')
-rwxr-xr-x | modules/gitmirror/templates/on-the-pull.init | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/modules/gitmirror/templates/on-the-pull.init b/modules/gitmirror/templates/on-the-pull.init new file mode 100755 index 00000000..0c575b77 --- /dev/null +++ b/modules/gitmirror/templates/on-the-pull.init @@ -0,0 +1,60 @@ +#! /bin/bash +# +### BEGIN INIT INFO +# Provides: on-the-pull +# Required-Start: $network +# Required-Stop: $network +# Default-Start: 2 3 4 5 +# Short-Description: Keep git mirrors up-to-date via external triggers +# Description: Keep git mirrors up-to-date via external triggers +### END INIT INFO + +# Source function library. +. /etc/init.d/functions + +pidfile=/var/run/on-the-pull/on-the-pull.pid +prog=/usr/local/bin/on-the-pull +args="--pid-file=$pidfile --user=git --cmd=/usr/local/bin/gitmirror-sync-metadata git://git.mageia.org/ /git" + + +start() { + gprintf "Starting On-The-Pull Git Mirror Daemon: " + daemon --check on-the-pull --pidfile $pidfile $prog $args + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/on-the-pull + return $RETVAL +} + +stop() { + gprintf "Stopping On-The-Pull Git Mirror Daemon: " + killproc -p $pidfile on-the-pull +} + +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + status) + status on-the-pull $pidfile + ;; + restart|reload) + restart + ;; + condrestart) + [ -f /var/lock/subsys/on-the-pull ] && restart || : + ;; + *) + gprintf "Usage: %s {start|stop|status|restart|condrestart}\n" "$(basename $0)" + exit 1 +esac + +exit 0 |