Add (likely ugly) init script for openrc

This commit is contained in:
fnux 2020-01-23 18:21:45 +01:00
parent a7bcf34432
commit 11256b5edf
2 changed files with 24 additions and 3 deletions

View file

@ -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

17
uncloud-init.rc Executable file
View file

@ -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 $?
}