setting programs to run in foreground

This commit is contained in:
LukeAllen 2017-06-05 21:07:06 -07:00
parent 45c1f286a6
commit 01ae597637
2 changed files with 41 additions and 42 deletions

View File

@ -1128,22 +1128,23 @@ function start_daemons() {
}
function _start_daemons_cron() {
notify 'task' 'Starting cron' 'n'
supervisorctl start cron
notify 'task' 'Skipping starting cron\n' 'n'
# cron starts automatically. I don't think this is necessary.
#supervisorctl start cron
}
function _start_daemons_rsyslog() {
notify 'task' 'Starting rsyslog' 'n'
notify 'task' 'Starting rsyslog ' 'n'
supervisorctl start rsyslog
}
function _start_daemons_saslauthd() {
notify 'task' 'Starting saslauthd' 'n'
supervisorctl start saslauthd
display_startup_daemon "/etc/init.d/saslauthd start"
}
function _start_daemons_fail2ban() {
notify 'task' 'Starting fail2ban' 'n'
notify 'task' 'Starting fail2ban ' 'n'
touch /var/log/auth.log
# Delete fail2ban.sock that probably was left here after container restart
if [ -e /var/run/fail2ban/fail2ban.sock ]; then
@ -1153,18 +1154,18 @@ function _start_daemons_fail2ban() {
}
function _start_daemons_opendkim() {
notify 'task' 'Starting opendkim' 'n'
notify 'task' 'Starting opendkim ' 'n'
supervisorctl start opendkim
}
function _start_daemons_opendmarc() {
notify 'task' 'Starting opendmarc' 'n'
notify 'task' 'Starting opendmarc ' 'n'
supervisorctl start opendmarc
}
function _start_daemons_postfix() {
notify 'task' 'Starting postfix' 'n'
supervisorctl start postfix
display_startup_daemon "/etc/init.d/postfix start"
}
function _start_daemons_dovecot() {
@ -1175,7 +1176,7 @@ function _start_daemons_dovecot() {
if [ "$ENABLE_POP3" = 1 ]; then
notify 'task' 'Starting pop3 services' 'n'
mv /etc/dovecot/protocols.d/pop3d.protocol.disab /etc/dovecot/protocols.d/pop3d.protocol
display_startup_daemon "/usr/sbin/dovecot reload"
/usr/sbin/dovecot reload
fi
if [ -f /tmp/docker-mailserver/dovecot.cf ]; then
@ -1201,7 +1202,7 @@ function _start_daemons_filebeat() {
function _start_daemons_fetchmail() {
notify 'task' 'Starting fetchmail' 'n'
/usr/local/bin/setup-fetchmail
supervisorctl start fetchmail
display_startup_daemon "/etc/init.d/fetchmail start"
}
function _start_daemons_clamav() {
@ -1252,7 +1253,7 @@ notify 'taskgrp' "#"
notify 'taskgrp' "#"
notify 'taskgrp' ""
supervisord
supervisord -c /etc/supervisor/conf.d/supervisor-app.conf
register_functions

View File

@ -1,83 +1,81 @@
# each program entry below is a separate terminal command.
# Each command is expected to run in the foreground and stay running.
# Each command MUST run in the foreground and stay running.
# If the command ever exits, the supervisor daemon will automatically run it again.
# Programs can be controlled like this: 'supervisorctl start fail2ban' 'supervisorctl stop fail2ban'
# supervisor writes program statuses in /var/log/supervisor
[program:cron]
startsecs=0
autostart=false
autorestart=true
command = /usr/sbin/cron
[program:rsyslog]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/rsyslog start
command = /usr/sbin/rsyslogd -n
[program:saslauthd]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/saslauthd start
# Couldn't figure out how to run this in the foreground. We'll start it without supervisor.
#[program:saslauthd]
#startsecs=0
#autostart=false
#autorestart=true
#command = /etc/init.d/saslauthd start
[program:fail2ban]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/fail2ban start
command = /usr/bin/fail2ban-server -f
[program:opendkim]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/opendkim start
command = /usr/sbin/opendkim -f
[program:opendmarc]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/opendmarc start
command = /usr/sbin/opendmarc -f -p local:/var/run/opendmarc/opendmarc.sock
[program:postfix]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/postfix start
# Couldn't figure out how to run this in the foreground. We'll start it without supervisor.
#[program:postfix]
#startsecs=0
#autostart=false
#autorestart=true
#command = /etc/init.d/postfix start
[program:dovecot]
startsecs=0
autostart=false
autorestart=true
command = /usr/sbin/dovecot -c /etc/dovecot/dovecot.conf
command = /usr/sbin/dovecot -F -c /etc/dovecot/dovecot.conf
[program:filebeat]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/filebeat start
command = /usr/bin/filebeat -c /etc/filebeat/filebeat.yml
[program:fetchmail]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/fetchmail start
# Couldn't figure out how to run this in the foreground. We'll start it without supervisor.
#[program:fetchmail]
#startsecs=0
#autostart=false
#autorestart=true
#command = /usr/bin/fetchmail
[program:clamav]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/clamav-daemon start
command = /usr/sbin/clamd -c /etc/clamav/clamd.conf
[program:postgrey]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/postgrey start
command = /usr/sbin/postgrey --inet=127.0.0.1:10023
[program:amavis]
startsecs=0
autostart=false
autorestart=true
command = /etc/init.d/amavis start
command = /usr/sbin/amavisd-new foreground