-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgitlab-autopull
More file actions
executable file
·64 lines (52 loc) · 1.48 KB
/
Copy pathgitlab-autopull
File metadata and controls
executable file
·64 lines (52 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#! /bin/sh
### BEGIN INIT INFO
# Provides: gitlab-autopupl
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Gitlab Autopull Daemon
### END INIT INFO
# /etc/init.d/gitlab-autopull: start and stop Gitlab Autopull Daemon
. /lib/lsb/init-functions
GAD=/usr/local/bin/git-autopull.pl
GAD_PID=/var/run/gitlab-autopull.pid
# Are we running from init?
run_by_init() {
([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
}
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
case "$1" in
start)
log_daemon_msg "Starting Gitlab Autopull Daemon" "gitlab-autopull" || true
if start-stop-daemon --start --quiet --oknodo --pidfile $GAD_PID --exec $GAD; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
;;
stop)
log_daemon_msg "Stopping Gitlab Autopull Daemon" "gitlab-autopull"|| true
if start-stop-daemon --stop --quiet --oknodo --pidfile $GAD_PID; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
;;
restart)
log_daemon_msg "Restarting Gitlab Autopull Daemon" "gitlab-autopull" || true
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $GAD_PID
if start-stop-daemon --start --quiet --oknodo --pidfile $GAD_PID --exec $GAD ; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
;;
status)
status_of_proc -p $GAD_PID $GAD gitlab-autopull && exit 0 || exit $?
;;
*)
log_action_msg "Usage: /etc/init.d/gitlab-autopull {start|stop|restart|status}" || true
exit 1
esac
exit 0