attempt to add systemd-support for gentoo
This commit is contained in:
6
bin/sau
6
bin/sau
@ -46,6 +46,12 @@ def init():
|
||||
|
||||
def fork_and_reboot():
|
||||
log = logging.getLogger(sau.LOGNAME)
|
||||
if os.path.exist('/proc/1/comm'):
|
||||
with open('/proc/1/comm', 'r') as f:
|
||||
if f.readline() == 'systemd':
|
||||
os.execl('/usr/bin/systemctl', 'reboot')
|
||||
log.error("Failed to execl?")
|
||||
sys.exit(1)
|
||||
try:
|
||||
pid = os.fork()
|
||||
if pid != 0:
|
||||
|
Reference in New Issue
Block a user