aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/openrc.post-upgrade
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-11-01 14:55:20 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-11-01 14:55:20 +0000
commit52480fc9cd53bc144ce803717bba13ad5109d5ee (patch)
treee9207bc92cd15b44e159245e82bf066e3fa61ad0 /main/openrc/openrc.post-upgrade
parent4729520c135dee23678c115b1db43361534794e3 (diff)
downloadaports-52480fc9cd53bc144ce803717bba13ad5109d5ee.tar.bz2
aports-52480fc9cd53bc144ce803717bba13ad5109d5ee.tar.xz
main/openrc: fix upgrading
The state dir moved to /run/openrc. We migrate the current state with the post-upgrade script so we dont need to do reboot after upgrading openrc
Diffstat (limited to 'main/openrc/openrc.post-upgrade')
-rw-r--r--main/openrc/openrc.post-upgrade25
1 files changed, 16 insertions, 9 deletions
diff --git a/main/openrc/openrc.post-upgrade b/main/openrc/openrc.post-upgrade
index 76c2da75eb..8884202be1 100644
--- a/main/openrc/openrc.post-upgrade
+++ b/main/openrc/openrc.post-upgrade
@@ -1,17 +1,24 @@
#!/bin/sh
# in 0.8.0-r1 the state dir moved from /libexec/rc/init.d to /lib/rc/init.d
-
-[ -d /libexec/rc/init.d ] || exit 0
-
-for i in /libexec/rc/init.d/* ; do
- [ -e "$i" ] || continue
- mv $i /lib/rc/init.d/
+# and with 0.10 it moved to /run/openrc
+
+mkdir -p /run/openrc
+for dir in /libexec /lib; do
+ [ -d $dir/rc/init.d ] || continue
+
+ for i in $dir/rc/init.d/* ; do
+ [ -e "$i" ] || continue
+ if [ -e /run/openrc/${i##*/} ]; then
+ rm -r $i
+ else
+ mv $i /run/openrc/
+ fi
+ done
+
+ rmdir $dir/rc/init.d $dir/rc /libexec 2>/dev/null
done
-rmdir /libexec/rc/init.d /libexec/rc /libexec 2>/dev/null
-
-
# create rc.local compat
if [ -f /etc/rc.local ]; then
cat >/etc/local.d/rc.local-compat.start<<__EOF__