Re: Daemons in schroot or how to start chroot automatically
On Son, 2012-07-22 at 15:58 +0100, Roger Leigh wrote:
> On Sun, Jul 22, 2012 at 03:25:49PM +0200, Ramon Hofer wrote:
> > On Sam, 2012-07-21 at 22:05 +0100, Roger Leigh wrote:
> > >
> > > Firstly, add schroot to Required-(Start|Stop), since you do
> > > need it to be set up prior to starting new sessions.
> >
> > Thanks for the hint!
> > I added $schroot at the end (don't know if the ordering matters...)
>
> It's "schroot", not "$schroot". '$' means it's a virtual
> service provided by another script; without the '$' means the
> script itself. e.g. "$network" is provided by "ifupdown".
Thanks for the explanation :-)
> > > I would also check the return status of schroot. If sid-sab
> > > already exists, then session creation will fail, and you'll
> > > reuse the old session. That might not be incorrect, but
> > > in the general case, I'd recommend checking.
> >
> > I was thinking about this too. But I saw no need to create a new session
> > if the old is still there.
> > What could be drawbacks of doing so?
>
> None really; they can even persist across reboots. (That's what
> the "recover-session" action is for.)
Hmm, then maybe I should check if there'are lost sessions upon the start
of the script?
Or will either schroot -b or -r work with such a lost session?
> > > What "talking" are you seeing? --quiet should hide all the
> > > messages, unless there's a problem.
> >
> > I have tried this
> > $NAME=$(schroot -bq -n $NAME -c $SCHROOT)
> >
> > But when the init.d script is called the second time with start then it
> > return
> > E: /etc/init.d/sabnzbdplus: Chroot not found
> >
> > That's why I have added >/dev/null to the creation command
> > schroot -bq -n $NAME -c $SCHROOT >/dev/null
>
> "/etc/init.d/sabnzbdplus" is an odd name for a chroot; It's not
> even valid to have '/' in the name IIRC. Is "$NAME" correct here?
Yes but this error was printed when I had these two commands in the
start part of my init.d script:
$NAME=$(schroot -bq -n $NAME -c $SCHROOT)
schroot -rq -c $NAME /etc/init.d/sabnzbdplus start
NAME is set to "" after the first command and "/etc/init.d/sabnzbdplus"
is therefore the argument for -c in the second command.
Cheers
Ramon
Reply to: