From ffabcc1a591c55e60e93da9a1f2325a8ca46ed0d Mon Sep 17 00:00:00 2001 From: Ben Swartzlander Date: Tue, 26 Sep 2017 14:13:11 -0400 Subject: [PATCH] Add systemd support to manila-ssh Because we're using ubuntu-minimal there is no cloud init support and we have manila-ssh as a substitute. Manila-ssh was only designed to work with upstart. This patch adds systemd support. Change-Id: Id43dc8effb846dcaf68b50eace68df8a076899a1 --- elements/manila-ssh/install.d/60-fetch-public-ssh-keys | 3 +++ .../manila-ssh/install.d/fetch-public-ssh-keys.service | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 elements/manila-ssh/install.d/fetch-public-ssh-keys.service diff --git a/elements/manila-ssh/install.d/60-fetch-public-ssh-keys b/elements/manila-ssh/install.d/60-fetch-public-ssh-keys index 0665990..826989f 100755 --- a/elements/manila-ssh/install.d/60-fetch-public-ssh-keys +++ b/elements/manila-ssh/install.d/60-fetch-public-ssh-keys @@ -13,6 +13,9 @@ install -D -g root -o root -m 0755 ${SCRIPTDIR}/fetch-public-ssh-keys.sh /usr/lo DIB_INIT_SYSTEM=$(dib-init-system) if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then install -D -g root -o root -m 0755 ${SCRIPTDIR}/fetch-public-ssh-keys.conf /etc/init/fetch-public-ssh-keys.conf +elif [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then + install -D -g root -o root -m 0755 ${SCRIPTDIR}/fetch-public-ssh-keys.service /etc/systemd/system + systemctl enable fetch-public-ssh-keys else echo "Not supported" fi diff --git a/elements/manila-ssh/install.d/fetch-public-ssh-keys.service b/elements/manila-ssh/install.d/fetch-public-ssh-keys.service new file mode 100644 index 0000000..18ede0c --- /dev/null +++ b/elements/manila-ssh/install.d/fetch-public-ssh-keys.service @@ -0,0 +1,9 @@ +[Unit] +Description=Fetch Public Keys +After=network.target + +[Service] +ExecStart=/usr/local/sbin/fetch-public-ssh-keys.sh + +[Install] +WantedBy=multi-user.target