Andrei Borzenkov wrote:
В Sun, 17 Aug 2014 16:37:58 +0200 Per Jessen <per@computer.org> пишет:
Per Jessen wrote:
Per Jessen wrote:
Andrei Borzenkov wrote:
One possibility is to use templates.
postfix@.service as template and then simply
ln -s postfix@.service postfix@<whatever>.service
Inside unit definition you refer to part after @ as %i or %I (should be the same in your case). See man systemd.unit. So start command will become
postfix -c %I start
Thanks Andrei and Cristian - much appreciated!
And it worked really well, brilliant!
For now I've got three such instances set up - postfix, postfix-in and postfix-out. Problem - although a service instance appears to be enabled, it isn't started at boot-up?
# systemctl status postfix@postfix postfix@postfix.service - Postfix Mail Transport Agent (postfix) Loaded: loaded (/etc/systemd/system/postfix@.service; enabled) Active: inactive (dead)
# systemctl status postfix@postfix-in postfix@postfix-in.service - Postfix Mail Transport Agent (postfix-in) Loaded: loaded (/etc/systemd/system/postfix@.service; enabled) Active: inactive (dead)
# systemctl status postfix@postfix-out postfix@postfix-out.service - Postfix Mail Transport Agent (postfix-out) Loaded: loaded (/etc/systemd/system/postfix@.service; enabled) Active: inactive (dead)
# systemctl is-enabled postfix@postfix.service enabled
I suspect systemctl "status" and "is-enabled" reporting "enabled" is incorrect:
# find /etc/systemd/system -name \*postfix\* /etc/systemd/system/postfix@.service /etc/systemd/system/postfix@postfix-in.service /etc/systemd/system/postfix@postfix-out.service /etc/systemd/system/postfix@postfix.service
Trying to enable an instance:
# systemctl enable postfix@postfix.service Failed to issue method call: No such file or directory
I must be doing something wrong, but I simply can't spot it. Starting an instance manually works.
Please show full unit definition.
[Unit] Description=Postfix Mail Transport Agent (%i) Requires=var-run.mount nss-lookup.target network.target remote-fs.target time-sync.target After=var-run.mount nss-lookup.target network.target remote-fs.target time-sync.target After=amavis.service mysql.service cyrus.service ldap.service openslp.service ypbind.service Conflicts=sendmail.service exim.service [Service] Type=forking PIDFile=/var/spool/%i/pid/master.pid ExecStartPre=-/bin/echo 'Starting mail service (%i)' EnvironmentFile=-/etc/sysconfig/postfix ExecStartPre=/etc/postfix/system/config_postfix ExecStartPre=/etc/postfix/system/update_chroot ExecStartPre=/etc/postfix/system/update_postmaps ExecStart=/usr/sbin/postfix -c /etc/%i start ExecStartPost=/etc/postfix/system/wait_qmgr 60 ExecStartPost=/etc/postfix/system/cond_slp register ExecReload=/usr/sbin/postfix -c /etc/%i reload ExecReload=/usr/sbin/postfix -c /etc/%i flush ExecStop=/usr/sbin/postfix -c /etc/%i stop ExecStopPost=/etc/postfix/system/cond_slp deregister [Install] WantedBy=multi-user.target -- Per Jessen, Zürich (18.7°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org