summaryrefslogtreecommitdiff
path: root/portato.py
diff options
context:
space:
mode:
authornecoro <>2007-08-12 20:59:00 +0000
committernecoro <>2007-08-12 20:59:00 +0000
commit260afe2668cc5b49e8c59a04c7aae6111e58f732 (patch)
treedf8072766c0367c2a1089ef724a9c7c8fd261860 /portato.py
parentd24ac86bd4ef4f96c8298499d5b0789731a32a33 (diff)
downloadportato-260afe2668cc5b49e8c59a04c7aae6111e58f732.tar.gz
portato-260afe2668cc5b49e8c59a04c7aae6111e58f732.tar.bz2
portato-260afe2668cc5b49e8c59a04c7aae6111e58f732.zip
small changes
Diffstat (limited to '')
-rwxr-xr-xportato.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/portato.py b/portato.py
index 646e850..1c73f74 100755
--- a/portato.py
+++ b/portato.py
@@ -15,8 +15,7 @@
from portato import listener
from portato.constants import VERSION, FRONTENDS, STD_FRONTEND, XSD_LOCATION, LOCALE_DIR, APP, SU_COMMAND
from optparse import OptionParser
-from subprocess import call
-import sys, os, socket
+import sys, os
import gettext, locale
def get_frontend_list ():
@@ -88,26 +87,23 @@ def main ():
else:
print _("Validation succeeded.")
return
- elif options.nolistener:
+ elif options.nolistener or os.getuid() == 0:
listener.set_send()
run()
else: # start listener and start us again in root modus
- if os.fork() == 0:
- listener.set_recv()
- else:
+ pid = os.fork()
+ if pid == 0: # start portato in child
additional = []
if options.check:
additional.append("-c")
if options.frontend:
additional.extend(["-f", options.frontend])
- try:
- if os.getuid() != 0:
- call(SU_COMMAND.split()+["%s --no-listener %s" % (sys.argv[0], " ".join(additional))], env = os.environ)
- else:
- call([sys.argv[0], "--no-listener"]+additional, env = os.environ)
- except KeyboardInterrupt:
- pass
+ cmd = SU_COMMAND.split()
+ os.execvpe(cmd[0], cmd+["%s --no-listener %s" % (sys.argv[0], " ".join(additional))], env = os.environ)
+
+ else: # start listener
+ listener.set_recv()
if __name__ == "__main__":
main()
class='deletions'>-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