Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101642 - start-stop-daemon bad chroot handling
Summary: start-stop-daemon bad chroot handling
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2005-08-07 07:20 UTC by Quequero
Modified: 2005-11-08 08:50 UTC (History)
2 users (show)

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


Attachments
This is a small fix posted on debian ML (start-stop-daemon-chroot.patch,1.11 KB, patch)
2005-08-07 07:22 UTC, Quequero
Details | Diff
Env + Chroot patch (start-stop-daemon_env.patch,5.39 KB, patch)
2005-08-07 12:19 UTC, Quequero
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Quequero 2005-08-07 07:20:11 UTC
There seems to be a minor issue with start-stop-daemon when using -r/--chroot.
start-stop-daemon checks for binary presence before chrooting, so while doing:

# start-stop-daemon --start --exec /usr/bin/amuled -r /chroot/amule/

I MUST have /usr/bin/amuled, otherwise start-stop-daemon will fail even before
calling chroot().
A simple workaround is to keep a copy of the binary outside the chroot in its
original path. Anyway a guy on debian ML posted a small patch, please consider
merging it if this bug is confirmed.
Happy holidays to everyone! :)
Comment 1 Quequero 2005-08-07 07:22:06 UTC
Created attachment 65309 [details, diff]
This is a small fix posted on debian ML
Comment 2 Quequero 2005-08-07 12:19:48 UTC
Created attachment 65336 [details, diff]
Env + Chroot patch

I just did this small patch:
1. Fixes the chroot stat() bug, now files are correctly stat()ed even when -r
is used.
2. Added -e | --env for setting an environment variable. When a process is
going to be chrooted is not possible to export a variable with
start-stop-daemon, with -e the variable is exported in new root (if -r is used)
and anyway you won't have to prepend VAR="value" start-stop-daemon... Before
starting a daemon.
3. Moved --make-pidfile routine, manual said that pidfile was written AFTER
chrooting the process, but in fact, it wasn't. Now make-pidfile behaves like
stated in the manual
4. Added -e to the man page and -e|-r to help screen.

Have a nice day.
Que
Comment 3 Roy Marples (RETIRED) gentoo-dev 2005-10-09 09:15:19 UTC
Patch accepted - will be in baselayout-1.12.0_pre9

Thanks!
Comment 4 Roy Marples (RETIRED) gentoo-dev 2005-11-08 08:50:46 UTC
Fixed in pre10