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 | |
parent | 4729520c135dee23678c115b1db43361534794e3 (diff) | |
download | alpine_aports-52480fc9cd53bc144ce803717bba13ad5109d5ee.tar.bz2 alpine_aports-52480fc9cd53bc144ce803717bba13ad5109d5ee.tar.xz alpine_aports-52480fc9cd53bc144ce803717bba13ad5109d5ee.zip |
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
-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 @@ | |||
2 | pkgname=openrc | 2 | pkgname=openrc |
3 | pkgver=0.10.5 | 3 | pkgver=0.10.5 |
4 | _ver=${pkgver/_git*/} | 4 | _ver=${pkgver/_git*/} |
5 | pkgrel=1 | 5 | pkgrel=2 |
6 | pkgdesc="OpenRC manages the services, startup and shutdown of a host" | 6 | pkgdesc="OpenRC manages the services, startup and shutdown of a host" |
7 | url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git" | 7 | url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git" |
8 | arch="all" | 8 | 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 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # in 0.8.0-r1 the state dir moved from /libexec/rc/init.d to /lib/rc/init.d | 3 | # in 0.8.0-r1 the state dir moved from /libexec/rc/init.d to /lib/rc/init.d |
4 | 4 | # and with 0.10 it moved to /run/openrc | |
5 | [ -d /libexec/rc/init.d ] || exit 0 | 5 | |
6 | 6 | mkdir -p /run/openrc | |
7 | for i in /libexec/rc/init.d/* ; do | 7 | for dir in /libexec /lib; do |
8 | [ -e "$i" ] || continue | 8 | [ -d $dir/rc/init.d ] || continue |
9 | mv $i /lib/rc/init.d/ | 9 | |
10 | for i in $dir/rc/init.d/* ; do | ||
11 | [ -e "$i" ] || continue | ||
12 | if [ -e /run/openrc/${i##*/} ]; then | ||
13 | rm -r $i | ||
14 | else | ||
15 | mv $i /run/openrc/ | ||
16 | fi | ||
17 | done | ||
18 | |||
19 | rmdir $dir/rc/init.d $dir/rc /libexec 2>/dev/null | ||
10 | done | 20 | done |
11 | 21 | ||
12 | rmdir /libexec/rc/init.d /libexec/rc /libexec 2>/dev/null | ||
13 | |||
14 | |||
15 | # create rc.local compat | 22 | # create rc.local compat |
16 | if [ -f /etc/rc.local ]; then | 23 | if [ -f /etc/rc.local ]; then |
17 | cat >/etc/local.d/rc.local-compat.start<<__EOF__ | 24 | cat >/etc/local.d/rc.local-compat.start<<__EOF__ |