SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
35
print/hplip/patches/patch-base_services_py
Normal file
35
print/hplip/patches/patch-base_services_py
Normal file
|
@ -0,0 +1,35 @@
|
|||
--- base/services.py.orig Fri Oct 11 11:40:14 2013
|
||||
+++ base/services.py Tue Oct 15 15:42:07 2013
|
||||
@@ -67,6 +67,9 @@ def restart_cups():
|
||||
elif os.path.exists('/etc/init.d/cupsys'):
|
||||
return '/etc/init.d/cupsys restart'
|
||||
|
||||
+ elif os.path.exists('${RCDIR}/cupsd'):
|
||||
+ return '${RCDIR}/cupsd restart'
|
||||
+
|
||||
else:
|
||||
return 'killall -HUP cupsd'
|
||||
|
||||
@@ -186,6 +189,22 @@ def start_service( service_name, passwordObj):
|
||||
if sts ==0:
|
||||
if 'stop' in out or 'inactive' in out:
|
||||
cmd_start = passwordObj.getAuthCmd()%('/etc/init.d/%s start'%service_name)
|
||||
+ log.debug("cmd_start=%s"%cmd_start)
|
||||
+ sts,out = utils.run(cmd_start, passwordObj)
|
||||
+ if sts ==0:
|
||||
+ ret_Val = True
|
||||
+ else:
|
||||
+ ret_Val = True
|
||||
+ else:
|
||||
+ log.error("Fail to start %s service, please start %s service manually."%(service_name,service_name))
|
||||
+
|
||||
+ elif os.path.exists('${RCDIR}/%s'%service_name):
|
||||
+ cmd_status = passwordObj.getAuthCmd()%('${RCDIR}/%s check'%service_name)
|
||||
+ log.debug(cmd_status)
|
||||
+ sts,out = utils.run(cmd_status, passwordObj)
|
||||
+ if sts ==0:
|
||||
+ if 'stop' in out or 'inactive' in out:
|
||||
+ cmd_start = passwordObj.getAuthCmd()%('${RCDIR}/%s start'%service_name)
|
||||
log.debug("cmd_start=%s"%cmd_start)
|
||||
sts,out = utils.run(cmd_start, passwordObj, "Need authentication to start/restart %s service"%service_name)
|
||||
if sts ==0:
|
Loading…
Add table
Add a link
Reference in a new issue