aboutsummaryrefslogtreecommitdiffstats
path: root/modules/gitmirror/files/on-the-pull.init
diff options
context:
space:
mode:
authorDan Fandrich <danf@mageia.org>2024-01-18 16:09:10 -0800
committerDan Fandrich <danf@mageia.org>2024-01-18 16:09:10 -0800
commitc96e287499d72cb86a15c499f47dc216f5cdc737 (patch)
tree01890e25df98ce2f0e293725c32feb50ab4581a0 /modules/gitmirror/files/on-the-pull.init
parentaa7a464e418c585440248b6f0a566ac55ce0bc79 (diff)
downloadpuppet-c96e287499d72cb86a15c499f47dc216f5cdc737.tar
puppet-c96e287499d72cb86a15c499f47dc216f5cdc737.tar.gz
puppet-c96e287499d72cb86a15c499f47dc216f5cdc737.tar.bz2
puppet-c96e287499d72cb86a15c499f47dc216f5cdc737.tar.xz
puppet-c96e287499d72cb86a15c499f47dc216f5cdc737.zip
Switch gitmirror files from templates to files
There are no template substitutions needed in these files, so allowing them opens the danger of substitutions happening unknowingly with future changes to these files.
Diffstat (limited to 'modules/gitmirror/files/on-the-pull.init')
-rwxr-xr-xmodules/gitmirror/files/on-the-pull.init67
1 files changed, 67 insertions, 0 deletions
diff --git a/modules/gitmirror/files/on-the-pull.init b/modules/gitmirror/files/on-the-pull.init
new file mode 100755
index 00000000..cc256a06
--- /dev/null
+++ b/modules/gitmirror/files/on-the-pull.init
@@ -0,0 +1,67 @@
+#! /bin/bash
+#
+# on-the-pull Keep git mirrors up-to-date via external triggers
+#
+# chkconfig: 2345 80 30
+# description: Keep git mirrors up-to-date via external triggers
+#
+### 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 >>/var/log/on-the-pull.log 2>&1"
+ 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
+ echo
+ rm -f /var/lock/subsys/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