From e2c2eeeaae4da08cf5ad63efbd43811122756bde Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Wed, 2 Oct 2013 06:33:07 +0000 Subject: [PATCH] py-i2phosts-master: chown log_file before daemonization Master log file first opened as root, than daemonization with privilege drop happens and master then unable to log to this logfile because of insufficient permissions. So chown logfile to "runas" user to avoid this situation. --- bin/py-i2phosts-master | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/py-i2phosts-master b/bin/py-i2phosts-master index 3492332..0dc8d26 100755 --- a/bin/py-i2phosts-master +++ b/bin/py-i2phosts-master @@ -160,6 +160,7 @@ if not args.debug and not args.verbose: pw_entry = pwd.getpwnam(runas) d.uid = pw_entry[2] d.gid = pw_entry[3] + os.chown(config['log_file'], d.uid, d.gid) d.open() # become daemon log = get_logger(filename=log_file, log_level=log_level) log.info('started')