os.mknod(filename, mode, device)
def destroy(self):
+ util.orphans_kill(self.path)
+
logging.debug("Destroying environment %s" % self.path)
if os.path.exists(self.path):
import fcntl
import hashlib
+import logging
import os
import progressbar
import random
import shutil
+import signal
import string
import struct
import sys
t.append(l)
return [" ".join(l) for l in t]
+
+def orphans_kill(root, killsig=signal.SIGTERM):
+ """
+ kill off anything that is still chrooted.
+ """
+ logging.debug("Killing orphans...")
+
+ for fn in [d for d in os.listdir("/proc") if d.isdigit()]:
+ try:
+ r = os.readlink("/proc/%s/root" % fn)
+ if os.path.realpath(root) == os.path.realpath(r):
+ logging.warning("Process ID %s is still running in chroot. Killing..." % fn)
+
+ pid = int(fn, 10)
+ os.kill(pid, killsig)
+ os.waitpid(pid, 0)
+ except OSError, e:
+ pass
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2011-08-04 00:03+0200\n"
+"POT-Creation-Date: 2011-08-05 18:22+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "Downgrading"
msgstr ""
-#: ../pakfire/base.py:156 ../pakfire/base.py:198 ../pakfire/base.py:228
-#: ../pakfire/base.py:249
+#: ../pakfire/base.py:157 ../pakfire/base.py:199 ../pakfire/base.py:230
+#: ../pakfire/base.py:252
msgid "Nothing to do"
msgstr ""
-#: ../pakfire/base.py:184
+#: ../pakfire/base.py:185
msgid "There are no packages to install."
msgstr ""
-#: ../pakfire/base.py:445
+#: ../pakfire/base.py:448
msgid "Everything is fine."
msgstr ""
msgid "Running transaction"
msgstr ""
-#: ../pakfire/util.py:44
+#: ../pakfire/util.py:46
#, python-format
msgid "%s [y/N]"
msgstr ""