diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-11-01 14:55:20 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-11-01 14:55:20 +0000 |
commit | 52480fc9cd53bc144ce803717bba13ad5109d5ee (patch) | |
tree | e9207bc92cd15b44e159245e82bf066e3fa61ad0 /main/openrc | |
parent | 4729520c135dee23678c115b1db43361534794e3 (diff) | |
download | aports-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')
-rw-r--r-- | main/openrc/APKBUILD | 2 | ||||
-rw-r--r-- | main/openrc/openrc.post-upgrade | 25 |
2 files changed, 17 insertions, 10 deletions
diff --git a/main/openrc/APKBUILD b/main/openrc/APKBUILD index e86e880d73..7c4afe6471 100644 --- a/main/openrc/APKBUILD +++ b/main/openrc/APKBUILD @@ -2,7 +2,7 @@ pkgname=openrc pkgver=0.10.5 _ver=${pkgver/_git*/} -pkgrel=1 +pkgrel=2 pkgdesc="OpenRC manages the services, startup and shutdown of a host" url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git" arch="all" 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__ |