diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-02-20 21:20:18 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-02-20 21:20:18 -0600 |
commit | 866f81aaa5e438537e6a4b30c1f0fcecc713a1a2 (patch) | |
tree | 4bce7ccd2a7603bdf638e250b8e30e54c1dea909 /system/openrc/openrc.post-upgrade | |
parent | 31f3497a1ca9637ff42f3185a5924e0f4e61ab5d (diff) | |
download | packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.gz packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.bz2 packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.tar.xz packages-866f81aaa5e438537e6a4b30c1f0fcecc713a1a2.zip |
system/openrc: migrate from aports fork
Diffstat (limited to 'system/openrc/openrc.post-upgrade')
-rw-r--r-- | system/openrc/openrc.post-upgrade | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/system/openrc/openrc.post-upgrade b/system/openrc/openrc.post-upgrade new file mode 100644 index 000000000..8884202be --- /dev/null +++ b/system/openrc/openrc.post-upgrade @@ -0,0 +1,35 @@ +#!/bin/sh + +# in 0.8.0-r1 the state dir moved from /libexec/rc/init.d to /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 + +# 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 + +exit 0 |