File tree 7 files changed +41
-0
lines changed
7 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
51
51
supervisor \
52
52
unzip \
53
53
wget \
54
+ cron \
54
55
&& apt-get -y --purge remove exim4 exim4-base exim4-config exim4-daemon-light \
55
56
&& apt-get clean \
56
57
&& rm -rf /var/lib/apt/lists/*
@@ -131,6 +132,7 @@ RUN true \
131
132
&& mkdir -p /var/log/icinga2 \
132
133
&& chmod 755 /var/log/icinga2 \
133
134
&& chown nagios:adm /var/log/icinga2 \
135
+ && touch /var/log/cron.log \
134
136
&& rm -rf \
135
137
/var/lib/mysql/* \
136
138
&& chmod u+s,g+s \
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
59
59
supervisor \
60
60
unzip \
61
61
wget \
62
+ cron \
62
63
&& apt-get -y --purge remove exim4 exim4-base exim4-config exim4-daemon-light \
63
64
&& apt-get clean \
64
65
&& rm -rf /var/lib/apt/lists/*
@@ -139,6 +140,7 @@ RUN true \
139
140
&& mkdir -p /var/log/icinga2 \
140
141
&& chmod 755 /var/log/icinga2 \
141
142
&& chown nagios:adm /var/log/icinga2 \
143
+ && touch /var/log/cron.log \
142
144
&& rm -rf \
143
145
/var/lib/mysql/* \
144
146
&& chmod u+s,g+s \
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
60
60
supervisor \
61
61
unzip \
62
62
wget \
63
+ cron \
63
64
&& apt-get -y --purge remove exim4 exim4-base exim4-config exim4-daemon-light \
64
65
&& apt-get clean \
65
66
&& rm -rf /var/lib/apt/lists/*
@@ -140,6 +141,7 @@ RUN true \
140
141
&& mkdir -p /var/log/icinga2 \
141
142
&& chmod 755 /var/log/icinga2 \
142
143
&& chown nagios:adm /var/log/icinga2 \
144
+ && touch /var/log/cron.log \
143
145
&& rm -rf \
144
146
/var/lib/mysql/* \
145
147
&& chmod u+s,g+s \
Original file line number Diff line number Diff line change
1
+ [program:crond]
2
+ command = /opt/supervisor/cron_supervisor
3
+ autostart = true
4
+ autorestart = true
5
+ stdout_logfile = /dev/stdout
6
+ stdout_logfile_maxbytes = 0
7
+ stderr_logfile = /dev/stderr
8
+ stderr_logfile_maxbytes = 0
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ . /opt/helpers
4
+
5
+ if [ ! -f " /etc/cron.d/icinga" ]; then
6
+ echo " => Copying icinga cronfile for /etc/cron.d"
7
+
8
+ cat > /etc/cron.d/icinga << -END
9
+ # If you enabled x509 module you can use the cronjobs to insert/refresh your certificates.
10
+
11
+ #30 2 * * * /usr/bin/icingacli x509 import --file /etc/ssl/certs/ca-certificates.crt 2>&1
12
+ #00 4 * * * /usr/bin/icingacli x509 scan --job <JOBNAME> 2>&1
13
+ END
14
+
15
+ chmod 0644 /etc/cron.d/icinga
16
+ fi
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ . /opt/helpers
4
+
5
+ service cron start
6
+
7
+ # Allow any signal which would kill a process to stop server
8
+ trap " service cron stop" HUP INT QUIT ABRT ALRM TERM TSTP
9
+
10
+ while pgrep -u root cron > /dev/null; do sleep 5; done
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ services:
37
37
- ./data/icinga/log/icingaweb2:/var/log/icingaweb2
38
38
- ./data/icinga/log/mysql:/var/log/mysql
39
39
- ./data/icinga/spool:/var/spool/icinga2
40
+ - ./data/icinga/cron.d/icinga:/etc/cron.d/icinga
40
41
# Sending e-mail
41
42
# See: https://github.com/jjethwa/icinga2#sending-notification-mails
42
43
# If you want to enable outbound e-mail, edit the file mstmp/msmtprc
You can’t perform that action at this time.
0 commit comments