[opensuse] systemctl enable postfix@instance.service ?
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. -- 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
Per Jessen wrote:
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.
This problem sounds exactly like this one: https://bugzilla.redhat.com/show_bug.cgi?id=752774 But that was apparently already solved a while ago. -- 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
В 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. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
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
В Mon, 18 Aug 2014 00:00:20 +0200 Per Jessen <per@computer.org> пишет:
# 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.
No, it's systemd bug. From code inspection it exists in upstream as well. As workaround please remove all instantiated symlinks (/etc/systemd/system/postfix@postfix-in.service etc). Then systemctl enable will work. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
В Mon, 18 Aug 2014 20:59:54 +0400 Andrei Borzenkov <arvidjaar@gmail.com> пишет:
В Mon, 18 Aug 2014 00:00:20 +0200 Per Jessen <per@computer.org> пишет:
# 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.
No, it's systemd bug. From code inspection it exists in upstream as well.
As workaround please remove all instantiated symlinks (/etc/systemd/system/postfix@postfix-in.service etc). Then systemctl enable will work.
On further discussion upstream it appears intentional - systemd will generally ignore any symlink during "systemctl enable". As those symlinks are completely redundant in your case, no functionality is lost. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Andrei Borzenkov wrote:
В Mon, 18 Aug 2014 20:59:54 +0400 Andrei Borzenkov <arvidjaar@gmail.com> пишет:
В Mon, 18 Aug 2014 00:00:20 +0200 Per Jessen <per@computer.org> пишет:
# 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.
No, it's systemd bug. From code inspection it exists in upstream as well.
As workaround please remove all instantiated symlinks (/etc/systemd/system/postfix@postfix-in.service etc). Then systemctl enable will work.
On further discussion upstream it appears intentional - systemd will generally ignore any symlink during "systemctl enable". As those symlinks are completely redundant in your case, no functionality is lost.
I've removed the symlinks, enabled postfix@postfix-in.service etc. and rebooted - works fine. Thanks. -- Per Jessen, Zürich (18.7°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Andrei Borzenkov
-
Per Jessen