mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-10-07 17:40:30 +00:00
Only install gen-hostkeys when sshd is installed
This commit is contained in:
parent
54791268e1
commit
d4601f08af
1 changed files with 10 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
from base import Task
|
||||
from common import phases
|
||||
from common.tools import log_check_call
|
||||
import os.path
|
||||
|
||||
|
||||
|
@ -10,9 +11,15 @@ class ResolveInitScripts(Task):
|
|||
def run(self, info):
|
||||
init_scripts = {'expand-volume': 'expand-volume'}
|
||||
|
||||
from subprocess import CalledProcessError
|
||||
try:
|
||||
log_check_call(['/usr/sbin/chroot', info.root,
|
||||
'/usr/bin/dpkg-query', '-W', 'openssh-server'])
|
||||
init_scripts['generate-ssh-hostkeys'] = 'generate-ssh-hostkeys'
|
||||
if info.manifest.system['release'] == 'squeeze':
|
||||
init_scripts['generate-ssh-hostkeys'] = 'squeeze/generate-ssh-hostkeys'
|
||||
except CalledProcessError:
|
||||
pass
|
||||
|
||||
disable_scripts = ['hwclock.sh']
|
||||
if info.manifest.system['release'] == 'squeeze':
|
||||
|
@ -37,7 +44,6 @@ class InstallInitScripts(Task):
|
|||
stat.S_IRGRP | stat.S_IXGRP |
|
||||
stat.S_IROTH | stat.S_IXOTH)
|
||||
from shutil import copy
|
||||
from common.tools import log_check_call
|
||||
for name, src in info.initd['install'].iteritems():
|
||||
dst = os.path.join(info.root, 'etc/init.d', name)
|
||||
copy(src, dst)
|
||||
|
|
Loading…
Add table
Reference in a new issue