shame <[EMAIL PROTECTED]> writes: > Did you find a satisfactory solution to this problem? > I also have the nasty build up of sessions using schroot. > > Using schroot -e --all-sessions does clear out the sessions but I > can't find a way to automate this.
It's worth mentioning that the latest schroot (in unstable) has a SESSIONS_RECOVER option. If you set SESSIONS_RECOVER="end" then on startup, all existing session will be ended. However, a session can only be ended when the process inside the chroot terminates. If it's kept running, schroot can't end the session. This is because it's waiting for it to exit, and it also can't unmount filesystems and clean up while processes have files open and CWDs set inside the chroot. The former isn't allowed, and the latter could result in catastrophic data loss. > I also tried using the command in an init-script to run on shutdown > but this produces an error and doesn't clear the sessions. This is likely because ending the sessions won't work without killing all the running processes inside the chroot. This feature was added with version 1.1.4 of schroot (/etc/schroot/setup.d/15killprocs). With a suitable tweak to the init script, it should do what you want. Regarding the original problem, this change should result in correct cleanup when daemons are run in the chroot. To correctly cope with SIGTERM, SIGINT and so on will require a little additional tweaking. Once done, this should make things clean up correctly. Regards, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
pgp0lbDle4bIh.pgp
Description: PGP signature