Support Debian's /bin/systemctl location
This commit is contained in:
parent
65e7c46b6e
commit
77c0cc85ec
1 changed files with 9 additions and 2 deletions
|
@ -6,9 +6,16 @@ import posixpath
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
systemctl = '/usr/bin/systemctl'
|
||||
|
||||
if not posixpath.exists(systemctl):
|
||||
def find_systemctl():
|
||||
systemctls = [ '/bin/systemctl', '/usr/bin/systemctl' ]
|
||||
for systemctl in systemctls:
|
||||
if posixpath.exists(systemctl):
|
||||
return systemctl
|
||||
|
||||
|
||||
systemctl = find_systemctl()
|
||||
if not systemctl:
|
||||
print('System WARN: systemctl not found')
|
||||
sys.exit(1)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue