Systemd: Difference between revisions
Jump to navigation
Jump to search
(Created page with " '''Systemd conversion''' # unlink /usr/bin/qmailctl # mv /etc/init.d/qmail /etc/init.d/vusaged /var/qmail/bin # ln -s /usr/qmail/bin/qmail /usr/bin/qmailctl cat > /etc/systemd/system/qmail.service <<EOF # Automatically generated by systemd-sysv-generator [Unit] Documentation=man:systemd-sysv-generator(8) SourcePath=/var/qmail/bin/qmail Description=SYSV: Qmailtoaster MTA Before=multi-user.target Before=multi-user.target Before=multi-user.target Before=gra...") |
No edit summary |
||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''Systemd conversion''' | '''Systemd conversion'''<br> | ||
# /etc/init.d/vusaged stop | |||
# qmailctl stop | |||
# unlink /usr/bin/qmailctl | # unlink /usr/bin/qmailctl | ||
# mv /etc/init.d/qmail /etc/init.d/vusaged /var/qmail/bin | # mv /etc/init.d/qmail /etc/init.d/vusaged /var/qmail/bin | ||
# ln -s / | # ln -s /var/qmail/bin/qmail /usr/bin/qmailctl | ||
# cat > /etc/systemd/system/qmail.service <<EOF | |||
[Unit] | [Unit] | ||
Documentation=man:systemd-sysv-generator(8) | Documentation=man:systemd-sysv-generator(8) | ||
Line 13: | Line 12: | ||
Description=SYSV: Qmailtoaster MTA | Description=SYSV: Qmailtoaster MTA | ||
Before=multi-user.target | Before=multi-user.target | ||
Before=graphical.target<br> | |||
Before=graphical.target | |||
[Service] | [Service] | ||
Type=forking | Type=forking | ||
Line 27: | Line 23: | ||
ExecStart=/var/qmail/bin/qmail start | ExecStart=/var/qmail/bin/qmail start | ||
ExecStop=/var/qmail/bin/qmail stop | ExecStop=/var/qmail/bin/qmail stop | ||
ExecReload=/var/qmail/bin/qmail reload | ExecReload=/var/qmail/bin/qmail reload<br> | ||
[Install] | |||
WantedBy=default.target | |||
EOF | |||
cat > /etc/systemd/system/vusaged.service<<EOF | |||
[Unit] | |||
Description=Usaged Service | |||
After=network.target<br> | |||
[Service] | |||
Type=forking | |||
ExecStart=/var/qmail/bin/vusaged start | |||
ExecStop=/var/qmail/bin/vusaged stop | |||
ExecReload=/var/qmail/bin/vusaged reload | |||
Restart=on-failure | |||
[Install] | [Install] | ||
WantedBy=default.target | WantedBy=default.target | ||
EOF | EOF | ||
# | # systemctl daemon-reload | ||
# systemctl enable --now qmail vusaged | |||
Notes: All qmailctl functionlity is still intact. | |||
start, stop, restart, status, and reload can be accomplished with the command 'systemctl [command] qmail' |
Latest revision as of 13:39, 23 August 2025
Systemd conversion
# /etc/init.d/vusaged stop # qmailctl stop # unlink /usr/bin/qmailctl # mv /etc/init.d/qmail /etc/init.d/vusaged /var/qmail/bin # ln -s /var/qmail/bin/qmail /usr/bin/qmailctl
# cat > /etc/systemd/system/qmail.service <<EOF [Unit] Documentation=man:systemd-sysv-generator(8) SourcePath=/var/qmail/bin/qmail Description=SYSV: Qmailtoaster MTA Before=multi-user.target Before=graphical.target
[Service] Type=forking Restart=no TimeoutSec=5min IgnoreSIGPIPE=no KillMode=process GuessMainPID=no RemainAfterExit=yes ExecStart=/var/qmail/bin/qmail start ExecStop=/var/qmail/bin/qmail stop ExecReload=/var/qmail/bin/qmail reload
[Install] WantedBy=default.target EOF
cat > /etc/systemd/system/vusaged.service<<EOF [Unit] Description=Usaged Service After=network.target
[Service] Type=forking ExecStart=/var/qmail/bin/vusaged start ExecStop=/var/qmail/bin/vusaged stop ExecReload=/var/qmail/bin/vusaged reload Restart=on-failure [Install] WantedBy=default.target EOF
# systemctl daemon-reload # systemctl enable --now qmail vusaged
Notes: All qmailctl functionlity is still intact. start, stop, restart, status, and reload can be accomplished with the command 'systemctl [command] qmail'