mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-08 11:40:21 +00:00
ubuntu: Fix openssh postinst call in >= saucy
The new openssh uses a different mechanism to start/stop the daemon which in turn requires a few tweaks in our template to deal with both the new and old ways of doing that. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
b58e60e232
commit
6cda3f5ac1
@ -91,10 +91,18 @@ EOF
|
|||||||
|
|
||||||
# generate new SSH keys
|
# generate new SSH keys
|
||||||
if [ -x $rootfs@LOCALSTATEDIR@/lib/dpkg/info/openssh-server.postinst ]; then
|
if [ -x $rootfs@LOCALSTATEDIR@/lib/dpkg/info/openssh-server.postinst ]; then
|
||||||
|
cat > $rootfs/usr/sbin/policy-rc.d << EOF
|
||||||
|
#!/bin/sh
|
||||||
|
exit 101
|
||||||
|
EOF
|
||||||
|
chmod +x $rootfs/usr/sbin/policy-rc.d
|
||||||
|
|
||||||
rm -f $rootfs/etc/ssh/ssh_host_*key*
|
rm -f $rootfs/etc/ssh/ssh_host_*key*
|
||||||
mv $rootfs/etc/init/ssh.conf $rootfs/etc/init/ssh.conf.disabled
|
mv $rootfs/etc/init/ssh.conf $rootfs/etc/init/ssh.conf.disabled
|
||||||
chroot $rootfs @LOCALSTATEDIR@/lib/dpkg/info/openssh-server.postinst configure
|
DPKG_MAINTSCRIPT_PACKAGE=openssh DPKG_MAINTSCRIPT_NAME=postinst chroot $rootfs @LOCALSTATEDIR@/lib/dpkg/info/openssh-server.postinst configure
|
||||||
mv $rootfs/etc/init/ssh.conf.disabled $rootfs/etc/init/ssh.conf
|
mv $rootfs/etc/init/ssh.conf.disabled $rootfs/etc/init/ssh.conf
|
||||||
|
|
||||||
|
rm -f $rootfs/usr/sbin/policy-rc.d
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user