[lxc-devel] [PATCH] ubuntu: Fix openssh postinst call in >= saucy

Serge Hallyn serge.hallyn at ubuntu.com
Mon Jul 8 20:40:29 UTC 2013


Quoting Stéphane Graber (stgraber at ubuntu.com):
> 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 at ubuntu.com>

Thanks, Stéphane, that worked!  (But man it's an unfortunate command to
need there)

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  templates/lxc-ubuntu.in | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in
> index 1623b75..b6ae501 100644
> --- a/templates/lxc-ubuntu.in
> +++ b/templates/lxc-ubuntu.in
> @@ -91,10 +91,18 @@ EOF
>  
>      # generate new SSH keys
>      if [ -x $rootfs at 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*
>          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
> +
> +        rm -f $rootfs/usr/sbin/policy-rc.d
>      fi
>  
>      return 0
> -- 
> 1.8.3.2
> 
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
> 
> Build for Windows Store.
> 
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel




More information about the lxc-devel mailing list