From 11256b5edf9f68616d1ce307ae0d38436337e8e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Floure?= Date: Thu, 23 Jan 2020 18:21:45 +0100 Subject: [PATCH] Add (likely ugly) init script for openrc --- Makefile | 10 +++++++--- uncloud-init.rc | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100755 uncloud-init.rc diff --git a/Makefile b/Makefile index 411351e..b75c9c8 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,10 @@ PREFIX?=/usr/local all: install install: - install -m 755 --owner root bin/uncloud-init $(PREFIX)/bin/uncloud-init - install -m 755 --owner root bin/uncloud-init-growpart $(PREFIX)/bin/uncloud-init-growpart - install -m 644 --owner root uncloud-init.service /etc/systemd/system/uncloud-init.service + install -m 755 bin/uncloud-init $(PREFIX)/bin/uncloud-init + install -m 755 bin/uncloud-init-growpart $(PREFIX)/bin/uncloud-init-growpart + if command -v systemd; then \ + install -m 644 uncloud-init.service /etc/systemd/system/uncloud-init.service; \ + else \ + install -m 755 uncloud-init.rc /etc/init.d/uncloud-init; \ + fi diff --git a/uncloud-init.rc b/uncloud-init.rc new file mode 100755 index 0000000..54cd3f8 --- /dev/null +++ b/uncloud-init.rc @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +# +# FIXME: I am pretty sure this is not 'right' as I am not familiar with this +# init system and did not bother to read the docs throughoughly. + +name="$RC_SVCNAME" + +depend() { + use net logger + before sshd +} + +start() { + ebegin "Starting uncloud-init" + logger /usr/local/bin/uncloud-init > /dev/null + eend $? +}