mirror of
https://github.com/gryf/wicd.git
synced 2026-01-09 07:14:13 +01:00
merged lp:~adamblackburn/wicd/loggroup to allow passing the preferred log group and permissions to setup.py configure -- thanks to David Paleino
This commit is contained in:
@@ -62,6 +62,8 @@ initfile = '%INITFILE%'
|
|||||||
# stores only the file name, i.e. wicd
|
# stores only the file name, i.e. wicd
|
||||||
initfilename = '%INITFILENAME%'
|
initfilename = '%INITFILENAME%'
|
||||||
wicd_group = '%WICDGROUP%'
|
wicd_group = '%WICDGROUP%'
|
||||||
|
log_group = '%LOGGROUP%'
|
||||||
|
log_perms = '%LOGPERMS%'
|
||||||
|
|
||||||
# BOOLEANS
|
# BOOLEANS
|
||||||
no_install_pmutils = %NO_INSTALL_PMUTILS%
|
no_install_pmutils = %NO_INSTALL_PMUTILS%
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -242,6 +242,8 @@ class configure(Command):
|
|||||||
self.no_install_acpi = True
|
self.no_install_acpi = True
|
||||||
elif self.distro in ['debian']:
|
elif self.distro in ['debian']:
|
||||||
self.wicdgroup = "netdev"
|
self.wicdgroup = "netdev"
|
||||||
|
self.loggroup = "adm"
|
||||||
|
self.logperms = "0640"
|
||||||
self.init = '/etc/init.d/'
|
self.init = '/etc/init.d/'
|
||||||
self.initfile = 'init/debian/wicd'
|
self.initfile = 'init/debian/wicd'
|
||||||
elif self.distro in ['arch']:
|
elif self.distro in ['arch']:
|
||||||
|
|||||||
@@ -1671,9 +1671,17 @@ def main(argv):
|
|||||||
output = ManagedStdio(logpath)
|
output = ManagedStdio(logpath)
|
||||||
if os.path.exists(logpath):
|
if os.path.exists(logpath):
|
||||||
try:
|
try:
|
||||||
os.chmod(logpath, 0600)
|
os.chmod(logpath, wpath.log_perms)
|
||||||
except:
|
except:
|
||||||
print 'unable to chmod log file to 0600'
|
print 'unable to chmod log file to %s' % wpath.log_perms
|
||||||
|
|
||||||
|
try:
|
||||||
|
if wpath.log_group:
|
||||||
|
import grp
|
||||||
|
group = grp.getgrnam(wpath.log_group)
|
||||||
|
os.chown(logpath, 0, group[2])
|
||||||
|
except:
|
||||||
|
print 'unable to chown log file to %s' % group[2]
|
||||||
|
|
||||||
if redirect_stdout: sys.stdout = output
|
if redirect_stdout: sys.stdout = output
|
||||||
if redirect_stderr: sys.stderr = output
|
if redirect_stderr: sys.stderr = output
|
||||||
|
|||||||
Reference in New Issue
Block a user