#716 pki-tomcatd@pki-tomcat.service does not start when pki-tomcatd.target is started
Closed: Fixed None Opened 9 years ago by 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.

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

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

5 years ago

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/1285

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Login to comment on this ticket.

Metadata