summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornecoro <>2007-08-12 07:00:15 +0000
committernecoro <>2007-08-12 07:00:15 +0000
commitd24ac86bd4ef4f96c8298499d5b0789731a32a33 (patch)
treea9af458fa4b00f78c77ee5b8ed8e6c95e81f8ce3
parent2a2d20986595f2b575e5bb371e9db026102466ba (diff)
downloadportato-d24ac86bd4ef4f96c8298499d5b0789731a32a33.tar.gz
portato-d24ac86bd4ef4f96c8298499d5b0789731a32a33.tar.bz2
portato-d24ac86bd4ef4f96c8298499d5b0789731a32a33.zip
made emerge pausing work (again?)
-rwxr-xr-xportato.py6
-rw-r--r--portato/gui/gui_helper.py15
2 files changed, 9 insertions, 12 deletions
diff --git a/portato.py b/portato.py
index 7f5308c..646e850 100755
--- a/portato.py
+++ b/portato.py
@@ -89,12 +89,6 @@ def main ():
print _("Validation succeeded.")
return
elif options.nolistener:
- try:
- # move this process into a new process group
- # this is to be able to kill emerge et al w/o killing ourselves :)
- os.setsid()
- except OSError:
- pass
listener.set_send()
run()
else: # start listener and start us again in root modus
diff --git a/portato/gui/gui_helper.py b/portato/gui/gui_helper.py
index ebe0bcf..507fa41 100644
--- a/portato/gui/gui_helper.py
+++ b/portato/gui/gui_helper.py
@@ -476,7 +476,7 @@ class EmergeQueue:
self.console.set_pty(master)
# start emerge
- self.process = Popen(command+options+packages, stdout = slave, stderr = STDOUT, shell = False, env = system.get_environment())
+ self.process = Popen(command+options+packages, stdout = slave, stderr = STDOUT, shell = False, env = system.get_environment(), preexec_fn = os.setsid)
# remove packages from queue
for i in it:
@@ -610,8 +610,12 @@ class EmergeQueue:
if self.process is not None:
self.threadQueue.clear() # remove all pending emerge threads
try:
- send_signal_to_group(signal.SIGTERM)
- debug("Process should be killed")
+ pgid = os.getpgid(self.process.pid)
+ os.killpg(pgid, signal.SIGTERM)
+ debug("Process should be terminated")
+ if self.process.poll() is None:
+ os.killpg(pgid, signal.SIGKILL)
+ debug("Process should be killed")
except AttributeError:
debug("AttributeError occured ==> process not exisiting - ignore")
except OSError:
@@ -621,13 +625,12 @@ class EmergeQueue:
def stop_emerge (self):
if self.process is not None:
- # use SIGTSTP in favor of SIGSTOP, as SIGSTOP cannot be blocked and would stop the GUI too
- send_signal_to_group(signal.SIGTSTP)
+ os.killpg(os.getpgid(self.process.pid), signal.SIGSTOP)
debug("Process should be stopped")
def continue_emerge (self):
if self.process is not None:
- send_signal_to_group(signal.SIGCONT)
+ os.killpg(os.getpgid(self.process.pid), signal.SIGCONT)
debug("Process should continue")
def remove_with_children (self, it, removeNewFlags = True):
class='insertions'>+13 2020-04-21HTML Template part of the mailRené 'Necoro' Neumann7-18/+199 2020-04-20Fixes and validationRené 'Necoro' Neumann6-28/+25 2020-04-20Fix vettingRené 'Necoro' Neumann1-1/+1 2020-04-20Started with mail creationRené 'Necoro' Neumann4-3/+126 2020-04-20FeeditemsRené 'Necoro' Neumann2-2/+14 2020-04-20GlobalOptionsRené 'Necoro' Neumann3-25/+79 2020-04-19RestructureRené 'Necoro' Neumann6-152/+177 2020-04-19Rename package 'parse' to 'feed'René 'Necoro' Neumann2-3/+3 2020-04-19SELECT is not necessary for most operations -- skip itRené 'Necoro' Neumann2-12/+1 2020-04-19Store path as array -- the delimiter is not always '.'René 'Necoro' Neumann3-36/+44 2020-04-19Split client part to client.goRené 'Necoro' Neumann2-125/+137 2020-04-19IMAP: Create foldersRené 'Necoro' Neumann1-4/+38 2020-04-19Improved IMAPRené 'Necoro' Neumann1-3/+88 2020-04-19Started IMAP connectionRené 'Necoro' Neumann4-0/+152 2020-04-19Use our own logger for debug for convenience sakeRené 'Necoro' Neumann1-2/+3 2020-04-19Fix debug logging m(René 'Necoro' Neumann1-2/+2 2020-04-19Rename util.go to log.go. Add verbose modeRené 'Necoro' Neumann4-24/+54 2020-04-19Clean go.modRené 'Necoro' Neumann2-3/+0 2020-04-19Do not print the parsedCfg anymoreRené 'Necoro' Neumann1-1/+1 2020-04-19Increase go-version to 1.14René 'Necoro' Neumann1-2/+2 2020-04-19CI: go vetRené 'Necoro' Neumann1-0/+3 2020-04-19Fetching and parsing the feedsRené 'Necoro' Neumann5-4/+113 2020-04-19Ignore all config*.ymlRené 'Necoro' Neumann1-1/+1