sys.exit(errorcode)
+def _getlogin():
+ try:
+ return os.getlogin()
+ except OSError:
+ return (os.getenv('USER') or
+ os.getenv('USERNAME') or
+ os.getenv('LOGNAME'))
+
+
if __name__ == '__main__':
# Split arguments, require at least a command
execname = sys.argv.pop(0)
exec_dirs=config.exec_dirs)
if config.use_syslog:
logging.info("(%s > %s) Executing %s (filter match = %s)" % (
- os.getlogin(), pwd.getpwuid(os.getuid())[0],
+ _getlogin(), pwd.getpwuid(os.getuid())[0],
command, filtermatch.name))
obj = subprocess.Popen(command,