diff options
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 |