Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 776010 - start-stop-daemon ignores and doesn't stop namespaced services that have PIDs explicitly specified in a PID file
Summary: start-stop-daemon ignores and doesn't stop namespaced services that have PIDs...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-14 14:46 UTC by konsolebox
Modified: 2021-03-22 19:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix to not exclude specified PID (openrc-0.42.1-776010-fix.patch,518 bytes, patch)
2021-03-15 20:12 UTC, konsolebox
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description konsolebox 2021-03-14 14:46:56 UTC
The fix in #634634 excludes PIDs of processes running in a different namespace regardless of whether the PID has been explicitly stored in a PID file mentioned through the --pidfile parameter or not.

I believe the correct behavior should be to only exclude the PIDs if they were generated by interpretation, but not if they are mentioned in a PID file.


Reproducible: Always

Steps to Reproduce:
1. Run a service in a namespaced chroot.  I've always used jchroot for this.
2. Store its PID in /run/service-name.pid. The PID should be the actual service, and not the parent chroot-er process.  This makes the service the explicit receiver of the TERM signal and would be able to shutdown properly.  No need to think about signal propagation.
3. Run 'start-stop-daemon --stop --quiet --pidfile /run/service-name.pid'.
Comment 1 konsolebox 2021-03-15 20:12:58 UTC
Created attachment 691629 [details, diff]
Fix to not exclude specified PID
Comment 2 konsolebox 2021-03-15 20:13:34 UTC
Turns out the fix is just simple. Please see patch.
Comment 3 William Hubbs gentoo-dev 2021-03-22 19:38:08 UTC
This is fixed in the following commit:

https://github.com/OpenRC/openrc/commit/ef76a663bcc03d4cc9dd1ef05c800f208e26d0ed

This will be in OpenRC 0.43.

Thanks,

William