[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Daemons in schroot or how to start chroot automatically



On Sam, 2012-07-21 at 22:05 +0100, Roger Leigh wrote:
> On Sat, Jul 21, 2012 at 04:52:24PM +0000, Ramon Hofer wrote:
> > On Sat, 21 Jul 2012 11:54:58 +0000, Ramon Hofer wrote:
> > 
> > > I found what I did wrong: In the init.d script I used chroot instead of
> > > schroot:
> > > http://pastebin.com/raw.php?i=Lamy4K4a
> > > 
> > > Could you please help me with the correct command?
> > > Instead of `chroot /srv/chroot/sid /etc/init.d/sabnzbdplus start` can I
> > > use `schroot -c sid sabnzbdplus start`?
> > > 
> > > Then this would be my new schroot script:
> > > http://pastebin.com/raw.php?i=Lamy4K4a
> > 
> > I have made some changes to my script: 
> > http://pastebin.com/raw.php?i=VFr77mwK
> > 
> > There's some mess with the output of the commands. So it's not really 
> > nice but it's working.
> > 
> > I've tried to use the -q option for schroot but it's still talking...
> 
> 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...)


> 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?


> What "talking" are you seeing?  --quiet should hide all the
> messages, unless there's a problem.

I was wrong there. The only output I see is from 
schroot -bq -n $NAME -c $SCHROOT

It returns $NAME. But I've already changed to sabnzbdplus init script
from the sid schroot to output something like
[ ok ] Starting SABnzbd+ binary newsgrabber in sid chroot:.

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

Now everything seems to run as expected. Except maybe the re-usage of an
old schroot session?


Cheers
Ramon




Reply to: