mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +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:
|
||||
rc_policy.write(('#!/bin/sh\n'
|
||||
'exit 101'))
|
||||
import stat
|
||||
os.chmod(rc_policy_path,
|
||||
stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
|
||||
stat.S_IRGRP | stat.S_IXGRP |
|
||||
stat.S_IROTH | stat.S_IXOTH)
|
||||
os.chmod(rc_policy_path, 0755)
|
||||
initictl_path = os.path.join(info.root, 'sbin/initctl')
|
||||
with open(initictl_path, 'w') as initctl:
|
||||
initctl.write(('#!/bin/sh\n'
|
||||
'exit 0'))
|
||||
os.chmod(initictl_path, 0755)
|
||||
|
||||
|
||||
class AptUpdate(Task):
|
||||
|
@ -223,3 +224,4 @@ class EnableDaemonAutostart(Task):
|
|||
@classmethod
|
||||
def run(cls, info):
|
||||
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