mail/deploy/systemd/install.sh
deeily 5024bf9a8d init: full mail stack — phases 0..8 (web client, admin, IMAP/SMTP,
sieve, search, sessions, dramatiq, deploy/install, ELK, monitoring)
2026-04-29 16:30:43 +03:00

20 lines
753 B
Bash
Executable File

#!/usr/bin/env bash
# Install systemd units for the mail stack. Run as root: sudo ./install.sh
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
install -m 0644 "$HERE/mail-flask.service" /etc/systemd/system/mail-flask.service
install -m 0644 "$HERE/mail-dramatiq.service" /etc/systemd/system/mail-dramatiq.service
# Make sure log files exist and are writable by deeily.
touch /var/log/mail-flask.log /var/log/mail-dramatiq.log
chown deeily:deeily /var/log/mail-flask.log /var/log/mail-dramatiq.log
systemctl daemon-reload
systemctl enable mail-flask.service mail-dramatiq.service
systemctl restart mail-flask.service mail-dramatiq.service
echo
echo "Status:"
systemctl --no-pager status mail-flask.service mail-dramatiq.service | head -20