From 52480fc9cd53bc144ce803717bba13ad5109d5ee Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 1 Nov 2012 14:55:20 +0000 Subject: 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 --- main/openrc/openrc.post-upgrade | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'main/openrc/openrc.post-upgrade') diff --git a/main/openrc/openrc.post-upgrade b/main/openrc/openrc.post-upgrade index 76c2da75e..8884202be 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__ -- cgit v1.2.3