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

Re: Daemons in schroot or how to start chroot automatically



On Mon, 2012-07-23 at 19:15 +0100, Roger Leigh wrote:
> On Mon, Jul 23, 2012 at 06:27:22PM +0200, Ramon Hofer wrote:
> > I now changed the stop function to (added the if test) to get rid of
> > error messages when running `sid-sabnzbdplus stop` twice:
> >   stop_sab() {
> >     if [ -f /var/lib/schroot/session/sid-sab ]; then
> >       schroot -rq -c $NAME /etc/init.d/sabnzbdplus stop
> >       schroot -eq -c $NAME
> >     else
> >       echo "SABnzbd+ not running, not stooped" 2>&1
> >     fi
> >   }
> > 
> > Or is there a better way to test if a session is still available?
> > `schroot -l -c $NAME` didn't work because it returns the same error
> > message as e.q. `schroot -eq -c $NAME` when the session isn't running
> > anymore.
> 
> That certainly works, but might break with future schroot versions,
> since that directory is an implementation detail.  You can do
> 
> schroot -l --all-sessions
> ==> session:sid-sbuild-28666af7-3e88-42cd-a83c-16267088d3f6
> 
> Note that this is also version-specific since only newer versions
> add the session: namespace.

Thanks alot for your help!

Now I'm testing with
  [ "$(schroot -l --all-sessions)" = session:sid-sab ]
and hope that the output of future versions won't change 8-)


Best regards
Ramon


Reply to: