Skip to content

Instantly share code, notes, and snippets.

@gwire
Created December 3, 2017 15:40
Show Gist options
  • Save gwire/0edf28658e6638b3699f621b5d5c70ec to your computer and use it in GitHub Desktop.
Save gwire/0edf28658e6638b3699f621b5d5c70ec to your computer and use it in GitHub Desktop.
systemd service unit for Exim (Debian)
[Unit]
Description=Exim Mail Transport Agent
After=network.target
[Service]
PrivateTmp=true
Environment=QUEUEINTERVAL=30m
EnvironmentFile=-/etc/default/exim4
ProtectSystem=full
PIDFile=/run/exim4/exim.pid
ExecReload=/bin/kill -HUP $MAINPID
ExecStartPre=/usr/bin/install -d -oDebian-exim -gDebian-exim -m750 /run/exim4
ExecStart=/usr/sbin/exim4 -bd -q${QFLAGS}${QUEUEINTERVAL} $COMMONOPTIONS $QUEUERUNNEROPTIONS $SMTPLISTENEROPTIONS
[Install]
WantedBy=multi-user.target
@gwire
Copy link
Author

gwire commented Dec 3, 2017

Exim wasn't restarting after reboot on some Ubuntu systems. I suspect it's to do with not being able to create the pid file, so I've added /etc/systemd/system/exim4.service to replace the standard debian one. It doesn't support everything (only works for "combined" config, doesn't do config tests) but it works for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment