diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-04-13 07:03:15 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-04-13 07:25:03 +0000 |
commit | f1e34f1dffbaa883e8733dfc5dafb6b1293c4e45 (patch) | |
tree | e5088f144f62cd6653ad83f99a481f12731fe3cd /main/openrc/openrc.post-upgrade | |
parent | 2d116ff62c2f3bc5e25fafaadde1eb750c1b8096 (diff) | |
download | aports-f1e34f1dffbaa883e8733dfc5dafb6b1293c4e45.tar.bz2 aports-f1e34f1dffbaa883e8733dfc5dafb6b1293c4e45.tar.xz |
main/openrc: move /libexec/rc to /lib/rc to be more FHS compat
Also clean up the /etc/rc.local compat. We now in the post-upgrade
look if there are any /etc/rc.local and if there are we create an
/etc/local.d/rc.local-compat.start script, otherwise we just let
it be.
Diffstat (limited to 'main/openrc/openrc.post-upgrade')
-rw-r--r-- | main/openrc/openrc.post-upgrade | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/main/openrc/openrc.post-upgrade b/main/openrc/openrc.post-upgrade index b09f2f240c..76c2da75eb 100644 --- a/main/openrc/openrc.post-upgrade +++ b/main/openrc/openrc.post-upgrade @@ -1,9 +1,28 @@ #!/bin/sh -# in 0.5.x the state dir moved from /lib/rc/init.d to /libexec/rc/init.d +# in 0.8.0-r1 the state dir moved from /libexec/rc/init.d to /lib/rc/init.d -[ -d /lib/rc/init.d ] || exit 0 +[ -d /libexec/rc/init.d ] || exit 0 + +for i in /libexec/rc/init.d/* ; do + [ -e "$i" ] || continue + mv $i /lib/rc/init.d/ +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__ +#!/bin/sh + +# this is only here for compatibility reasons +if [ -f /etc/rc.local ]; then + . /etc/rc.local +fi +__EOF__ + chmod +x /etc/local.d/rc.local-compat.start +fi -mv /lib/rc/init.d/* /libexec/rc/init.d/ -rmdir /lib/rc/init.d exit 0 |