#716 pki-tomcatd@pki-tomcat.service does not start when pki-tomcatd.target is started

Created 4 years ago by pviktori
Modified 11 months ago

/lib/systemd/system/pki-tomcatd.target currently contains:

After=pki-tomcatd.target
BindTo=pki-tomcatd.target

Instead of BindTo there should be PartOf, so that starting and stopping the target is propagated to the service.

Also, instead of logging

An exit status of '143' refers to the 'systemd' method of using 'SIGTERM' to shutdown a Java process and can safely be ignored.

the SuccessExitStatus=143 service directive can be used.

This bug prevents FreeIPA installation in some cases.

Sorry, I've made a typo: the file is /lib/systemd/system/pki-tomcatd@.service, not the target

Replying to [ticket:716 pviktori]:

/lib/systemd/system/pki-tomcatd.target currently contains:
After=pki-tomcatd.target BindTo=pki-tomcatd.target

Instead of BindTo there should be PartOf, so that starting and stopping the target is propagated to the service.

Should we be using 'PartOf' in addition to 'BindsTo'? The systemd.unit manpage describes these directives as having slightly different purposes:

   BindsTo=
       Configures requirement dependencies, very similar in style to Requires=, however
       in addition to this behavior it also declares that this unit is stopped when any
       of the units listed suddenly disappears. Units can suddenly, unexpectedly
       disappear if a service terminates on its own choice, a device is unplugged or a
       mount point unmounted without involvement of systemd.

   PartOf=
       Configures dependencies similar to Requires=, but limited to stopping and
       restarting of units. When systemd stops or restarts the units listed here, the
       action is propagated to this unit. Note that this is a one way dependency -
       changes to this unit do not affect the listed units.

If that's the case, there's a typo: it's BindsTo, not BindTo.

I've contacted Lukáš from systemd to answer.

Replying to [comment:4 pviktori]:

If that's the case, there's a typo: it's BindsTo, not BindTo.

The directive name was changed from 'BindTo' to 'BindsTo' at some point, but the old name is still supported for backwards compatibility. If we still need to use it at all, we should update to use the new recommended name of 'BindsTo'.

I am not sure that this is your exact use-case, but if you use pki-tomcatd.target to control (start, stop, restart,...) all instances of pki-tomcatd@.service, the recommended way is to have WantedBy=pki-tomcatd.target and PartOf=pki-tomcatd.target in pki-tomcatd@.service. In that case another dependency (BindsTo) should not be there.

Fixed:

To ssh://vakwetu @git.fedorahosted.org/git/pki.git
265f790..f27f8a5 DOGTAG_10_0_BRANCH -> DOGTAG_10_0_BRANCH

To ssh://vakwetu @git.fedorahosted.org/git/pki.git
05ff18e..27ed263 master -> master

11 months ago

Metadata Update from @pviktori:
- Issue assigned to vakwetu
- Issue set to the milestone: 10.0.5

Login to comment on this ticket.

defect

IPA

Auth

cancel