Summary: | sys-apps/openrc-0.12.4: path from '--chroot ' is not added to 'pidfile=' var in /run/openrc/daemons/*/* files | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Nikoli <nikoli> |
Component: | OpenRC | Assignee: | OpenRC Team <openrc> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 520144 | ||
Attachments: |
Solution based on storing of s-s-d arguments
Solution based on writing modified pidfile |
Description
Nikoli
2014-10-03 15:33:39 UTC
I don't see a reason to use the chroot path here as it's OpenRC that gets the --pidfile option, not the daemon itself. Now openrc has _very_ bad support for chroot, it even is using different paths during start and during status actions: during start it is $(path from --chroot)$(path from --pidfile) and during status it is just $(path from --pidfile), so after start any service is detected as not running when --make-pidfile is used. For better understanding try to provide example of openrc script which uses 'start-stop-daemon --make-pidfile --chroot /somepath --pidfile /run/openrc-bug.pid' - you will reproduce the bug. Or do you need more info? Hi, I can confirm the problem. Here is a short description, when service is runing in a chroot it creates a pidfile in ${chroot}/run/$serive.pid. And in /run/daemon/$service/000 there is information that pidfile is stored in /run/$service.pid, as a result openrc fails to check status. Two mentioned solutions may work and I'm attaching both of them. Created attachment 386972 [details, diff] Solution based on storing of s-s-d arguments This is a proof of concept (however works as a workaround for this bug). The idea is to save chroot option usgin rc_service_value_set, so both s-s-d and rc-status will be aware of chrooted service. git url: https://github.com/qnikst/openrc/tree/bug-524388-2 Created attachment 386974 [details, diff]
Solution based on writing modified pidfile
Solution based on the storing of pid with known chroot, it looks like more hairy for me
A fix for this has been implemented in these commits: f9acd65 8c7ea4e This will be in OpenRC-0.14 and OpenRC-0.13.2. The fix is to add a chroot variable which will need to be set to the chroot path in a service script. This variable is used in the default start and stop functions. This is also saved the same way pidfile and the other variables are saved. |