mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Also disable autostart for daemons started through upstart
This commit is contained in:
parent
feea266210
commit
d222b267ce
1 changed files with 7 additions and 5 deletions
|
@ -144,11 +144,12 @@ class DisableDaemonAutostart(Task):
|
||||||
with open(rc_policy_path, 'w') as rc_policy:
|
with open(rc_policy_path, 'w') as rc_policy:
|
||||||
rc_policy.write(('#!/bin/sh\n'
|
rc_policy.write(('#!/bin/sh\n'
|
||||||
'exit 101'))
|
'exit 101'))
|
||||||
import stat
|
os.chmod(rc_policy_path, 0755)
|
||||||
os.chmod(rc_policy_path,
|
initictl_path = os.path.join(info.root, 'sbin/initctl')
|
||||||
stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
|
with open(initictl_path, 'w') as initctl:
|
||||||
stat.S_IRGRP | stat.S_IXGRP |
|
initctl.write(('#!/bin/sh\n'
|
||||||
stat.S_IROTH | stat.S_IXOTH)
|
'exit 0'))
|
||||||
|
os.chmod(initictl_path, 0755)
|
||||||
|
|
||||||
|
|
||||||
class AptUpdate(Task):
|
class AptUpdate(Task):
|
||||||
|
@ -223,3 +224,4 @@ class EnableDaemonAutostart(Task):
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
os.remove(os.path.join(info.root, 'usr/sbin/policy-rc.d'))
|
os.remove(os.path.join(info.root, 'usr/sbin/policy-rc.d'))
|
||||||
|
os.remove(os.path.join(info.root, 'sbin/initctl'))
|
||||||
|
|
Loading…
Add table
Reference in a new issue