Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 776010

Summary: start-stop-daemon ignores and doesn't stop namespaced services that have PIDs explicitly specified in a PID file
Product: Gentoo Hosted Projects Reporter: konsolebox <konsolebox>
Component: OpenRCAssignee: OpenRC Team <openrc>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Fix to not exclude specified PID

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