summaryrefslogtreecommitdiff
path: root/system/openrc/openrc.post-install
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-21 01:10:08 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-21 01:10:08 +0000
commit47e8187d7bbc157929fcbf6e11e9fa1374c500c2 (patch)
tree77bf2e93bc0f3071e3ec40c29bd6584516d0b9f9 /system/openrc/openrc.post-install
parent608f6f5d805997996b2e5e7ee4a11faf3be1c60c (diff)
downloadpackages-47e8187d7bbc157929fcbf6e11e9fa1374c500c2.tar.gz
packages-47e8187d7bbc157929fcbf6e11e9fa1374c500c2.tar.bz2
packages-47e8187d7bbc157929fcbf6e11e9fa1374c500c2.tar.xz
packages-47e8187d7bbc157929fcbf6e11e9fa1374c500c2.zip
system/openrc: install default services if no runlevels exist
Diffstat (limited to 'system/openrc/openrc.post-install')
-rw-r--r--system/openrc/openrc.post-install32
1 files changed, 2 insertions, 30 deletions
diff --git a/system/openrc/openrc.post-install b/system/openrc/openrc.post-install
index 1057eed41..0f6572ef7 100644
--- a/system/openrc/openrc.post-install
+++ b/system/openrc/openrc.post-install
@@ -1,36 +1,8 @@
#!/bin/sh
-rc_update() {
- local svc="$1"
- local level="$2"
- mkdir -p /etc/runlevels/$level
- ln -sf /etc/init.d/$svc /etc/runlevels/$level
-}
-
-if [ ! -d etc/rcS.d ] && [ ! -d etc/rcL.d ]; then
+if [ -d /etc/runlevels ]; then
exit 0
fi
-for i in etc/rc[SL].d/*; do
- [ -L "$i" ] || continue
- oldsvc=${i##*/S[0-9][0-9]}
- # some services are renamed
- case "$oldsvc" in
- modutils) svc=modules;;
- procps) svc=sysctl;;
- bootmisc.sh) svc=bootmisc;;
- keymap) svc=keymaps;;
- rc.local) svc=local;;
- *) svc=$oldsvc;;
- esac
-
- # add the service to correct "runlevel"
- case "$svc" in
- hwclock|modules|sysctl|hostname|keymaps|syslog|bootmisc)
- rc_update $svc boot;;
- *) rc_update $svc default;;
- esac
-
- rm $i
-done
+cp -PRr /usr/share/openrc/runlevels /etc/