aboutsummaryrefslogtreecommitdiff
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
parent4729520c135dee23678c115b1db43361534794e3 (diff)
downloadalpine_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/APKBUILD2
-rw-r--r--main/openrc/openrc.post-upgrade25
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 @@
2pkgname=openrc 2pkgname=openrc
3pkgver=0.10.5 3pkgver=0.10.5
4_ver=${pkgver/_git*/} 4_ver=${pkgver/_git*/}
5pkgrel=1 5pkgrel=2
6pkgdesc="OpenRC manages the services, startup and shutdown of a host" 6pkgdesc="OpenRC manages the services, startup and shutdown of a host"
7url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git" 7url="http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git"
8arch="all" 8arch="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 6mkdir -p /run/openrc
7for i in /libexec/rc/init.d/* ; do 7for 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
10done 20done
11 21
12rmdir /libexec/rc/init.d /libexec/rc /libexec 2>/dev/null
13
14
15# create rc.local compat 22# create rc.local compat
16if [ -f /etc/rc.local ]; then 23if [ -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__