File: prometheus-alertmanager.init

package info (click to toggle)
prometheus-alertmanager 0.21.0%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports
  • size: 5,832 kB
  • sloc: sh: 178; makefile: 139
file content (53 lines) | stat: -rwxr-xr-x 1,687 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides:          prometheus-alertmanager
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Alertmanager for Prometheus
# Description:       The Alertmanager handles alerts sent by client
#                    applications such as the Prometheus server. It takes care
#                    of deduplicating, grouping, and routing them to the
#                    correct receiver integration such as email, PagerDuty, or
#                    OpsGenie. It also takes care of silencing and inhibition
#                    of alerts.
### END INIT INFO

# Author: Martina Ferrari <tina@debian.org>
# Author: Guillem Jover <gjover@sipwise.com>

DESC="Alertmanager for Prometheus"
NAME=prometheus-alertmanager
USER=prometheus
GROUP=$USER
DAEMON=/usr/bin/$NAME
PIDFILE=/run/prometheus/$NAME.pid
LOGFILE=/var/log/prometheus/$NAME.log

START_ARGS="--no-close --background --make-pidfile"
STOP_ARGS="--remove-pidfile"

do_start_prepare()
{
  mkdir -p $(dirname $PIDFILE)
}

do_start_cmd_override()
{
  start-stop-daemon --start --quiet --oknodo \
    --exec $DAEMON --pidfile $PIDFILE --user $USER --group $GROUP \
    --chuid $USER:$GROUP $START_ARGS -- $ARGS >>$LOGFILE 2>&1
}

do_stop_cmd_override()
{
  start-stop-daemon --stop --quiet --oknodo --retry=TERM/30/KILL/5 \
    --exec $DAEMON --pidfile $PIDFILE --user $USER $STOP_ARGS
}

alias do_reload=do_reload_sigusr1