summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-07-06 09:58:29 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-07-06 09:58:29 +0000
commit0cad5ae10c7eccca8220ce88bfdd49e9fb2b27fa (patch)
tree0cff67d01251b5ad1c32b048410e739731090402
parent87b4e8f6c07c1452c0ba0293ab323ec790675b83 (diff)
downloadaports-0cad5ae10c7eccca8220ce88bfdd49e9fb2b27fa.tar.bz2
aports-0cad5ae10c7eccca8220ce88bfdd49e9fb2b27fa.tar.xz
core/openrc: fix post-install to handle upgrades better
We don't have the init.d scripts there so rc-update add don't work.
-rw-r--r--core/openrc/APKBUILD4
-rw-r--r--core/openrc/openrc.post-install17
2 files changed, 15 insertions, 6 deletions
diff --git a/core/openrc/APKBUILD b/core/openrc/APKBUILD
index 6ba416ced..415f24a58 100644
--- a/core/openrc/APKBUILD
+++ b/core/openrc/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=openrc
pkgver=0.5.0
-pkgrel=5
+pkgrel=6
pkgdesc="OpenRC manages the services, startup and shutdown of a host"
url="http://roy.marples.name/openrc"
license='BSD-2'
@@ -52,5 +52,5 @@ b1e64885f301166df30be3e3cf5338ff hwdrivers.initd
098a1f16812f56fcb56eb6b6f0fa31f6 modules.initd
c77cb4a67aa7ef40dfb12dd1ff5bf5e2 modloop.initd
747168eee535e845179eaef5a3fcb334 networking.initd
-6e834194b246563fc5acd77e91e038c4 openrc.post-install
+71d823acc9935a8ac82649a94b5bc0b9 openrc.post-install
393ff61bc0bf2c07f9af81795554c584 openrc.post-upgrade"
diff --git a/core/openrc/openrc.post-install b/core/openrc/openrc.post-install
index de119c7d9..1d0201d3a 100644
--- a/core/openrc/openrc.post-install
+++ b/core/openrc/openrc.post-install
@@ -1,26 +1,35 @@
#!/bin/sh
+rc_update() {
+ local svc="$1"
+ local level="$2"
+ mkdir -p /etc/runlevels/$level
+ ln -sf /etc/init.d/$svc /etc/runlevels/$level
+}
+
if [ ! -d etc/rcS.d ] && [ ! -d etc/rcL.d ]; then
exit 0
fi
for i in etc/rc[SL].d/*; do
[ -L "$i" ] || continue
- svc=${i##*/S[0-9][0-9]}
+ oldsvc=${i##*/S[0-9][0-9]}
# some services are renamed
- case "$svc" in
+ case "$oldsvc" in
modutils) svc=modules;;
procps) svc=sysctl;;
bootmisc.sh) svc=bootmisc;;
keymap) svc=keymaps;;
+ *) svc=$oldsvc;;
esac
# add the service to correct "runlevel"
case "$svc" in
hwclock|modules|sysctl|hostname|keymaps|syslog|bootmisc)
- rc-update add $svc boot;;
- *) rc-update add $svc default;;
+ rc_update $svc boot;;
+ *) rc_update $svc default;;
esac
rm $i
done
+