Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 576496 - start-stop-daemon bad chroot handling
Summary: start-stop-daemon bad chroot handling
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-05 09:26 UTC by Rafal
Modified: 2016-05-19 22:07 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafal 2016-03-05 09:26:06 UTC
Hi,

in start-stop-daemon (OpenRC) 0.12.4 the chroot handling has a litlle bug (can't stop process). Openrc is manually compiled without any options.

It checks executable file and pid file in main filesystem not under jail:
#/usr/local/openrc.0.12.4/start-stop-daemon --start --background \
    --make-pidfile --pidfile /var/run/test.pid
    --chroot /opt/chroot/ --exec /bin/sleep 1000

then 

#/usr/local/openrc.0.12.4/start-stop-daemon --stop --chroot /opt/chroot/ \
   -v --retry=60 --pidfile /var/run/test.pid

* start-stop-daemon: fopen `/var/run/test.pid': No such file or directory

file exist in /opt/chroot/var/run/test.pid 
file dont exist in /var/run/test.pid 

i found bug report like this in debian but source is diffrent 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=144484
Comment 1 William Hubbs gentoo-dev 2016-03-05 16:02:49 UTC
Hi,

I'm curious why you are running openrc-0.12.4? Which distro are you
using?
Comment 2 Rafal 2016-03-05 20:11:51 UTC
(In reply to William Hubbs from comment #1)
> Hi,
> 
> I'm curious why you are running openrc-0.12.4? Which distro are you
> using?

Hi,
Now im using openrc-0.19.1 the same problem. Distro Gentoo
Comment 3 Rafal 2016-03-05 20:19:51 UTC
start-stop-daemon (OpenRC) 0.20.4 , the same problem.

* start-stop-daemon: fopen `/var/run/test.pid': No such file or directory
Comment 4 William Hubbs gentoo-dev 2016-05-19 22:07:53 UTC
Hi,

now I see what the issue is.

The --chroot option only tells s-s-d to chroot into that directory
before starting the daemon; it does not add the chroot path to the
pidfile path. This means you should use the --chroot switch only when
you start the daemon, and the --pidfile path should be specified with
the chroot path when stopping it.

Change your stop command to the following:

#/usr/local/openrc.0.12.4/start-stop-daemon --stop -v --retry=60 \
--pidfile /opt/chroot/var/run/test.pid

Let me know if this doesn't work.

Thanks much.

William