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. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' schroot and sbuild http://alioth.debian.org/projects/buildd-tools `- GPG Public Key F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800 -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20120723181521.gn25...@codelibre.net