diff options
author | Leo <thinkabit.ukim@gmail.com> | 2020-02-14 21:27:28 -0300 |
---|---|---|
committer | Ariadne Conill <ariadne@dereferenced.org> | 2020-02-18 18:32:25 +0000 |
commit | 5c2fae7b2593a8cca1dd95bcb0c5515f5b04c25c (patch) | |
tree | 3f38caaa23a64806f9a80a10795149d97dca35df /main/openrc | |
parent | df610473b4331117a0abd63b87f1a8cd136156d2 (diff) | |
download | aports-5c2fae7b2593a8cca1dd95bcb0c5515f5b04c25c.tar.bz2 aports-5c2fae7b2593a8cca1dd95bcb0c5515f5b04c25c.tar.xz |
main/openrc: write sysctl service with sane ordering of services
Diffstat (limited to 'main/openrc')
-rw-r--r-- | main/openrc/0003-sysctl-add-compatibility-for-busybox-sysctl.patch | 46 | ||||
-rw-r--r-- | main/openrc/APKBUILD | 10 | ||||
-rw-r--r-- | main/openrc/modules.initd | 18 | ||||
-rw-r--r-- | main/openrc/sysctl.initd | 87 |
4 files changed, 100 insertions, 61 deletions
diff --git a/main/openrc/0003-sysctl-add-compatibility-for-busybox-sysctl.patch b/main/openrc/0003-sysctl-add-compatibility-for-busybox-sysctl.patch deleted file mode 100644 index 3803bcca81..0000000000 --- a/main/openrc/0003-sysctl-add-compatibility-for-busybox-sysctl.patch +++ /dev/null @@ -1,46 +0,0 @@ -From ed120780512b6dd0bfabba0ea59d06d1099924b0 Mon Sep 17 00:00:00 2001 -From: William Pitcock <nenolod@dereferenced.org> -Date: Wed, 1 Feb 2017 04:08:33 +0000 -Subject: [PATCH 3/7] sysctl: add compatibility for busybox sysctl - ---- - init.d/sysctl.in | 21 +++++++++++++++++++-- - 1 file changed, 19 insertions(+), 2 deletions(-) - -diff --git a/init.d/sysctl.in b/init.d/sysctl.in -index cb756f3a..fc22364b 100644 ---- a/init.d/sysctl.in -+++ b/init.d/sysctl.in -@@ -38,10 +38,27 @@ BSD_sysctl() - - Linux_sysctl() - { -- local quiet -+ local quiet retval=0 - yesno $rc_verbose || quiet=-q - -- sysctl ${quiet} --system -+ set -- -+ eindent -+ for i in /run/sysctl.d/*.conf \ -+ /etc/sysctl.d/*.conf \ -+ /usr/local/lib/sysctl.d/*.conf \ -+ /usr/lib/sysctl.d/*.conf \ -+ /lib/sysctl.d/*.conf \ -+ /etc/sysctl.conf; do -+ if [ -e "$i" ]; then -+ vebegin "applying $conf" -+ sysctl ${quiet} -p "$i" -+ retval=$(( $retval + $? )) -+ veend $retval -+ fi -+ done -+ eoutdent -+ -+ return $retval - } - - start() --- -2.11.0 - diff --git a/main/openrc/APKBUILD b/main/openrc/APKBUILD index e5e3a22fa3..de231e30a2 100644 --- a/main/openrc/APKBUILD +++ b/main/openrc/APKBUILD @@ -2,7 +2,7 @@ pkgname=openrc pkgver=0.42.1 _ver=${pkgver/_git*/} -pkgrel=4 +pkgrel=5 pkgdesc="OpenRC manages the services, startup and shutdown of a host" url="https://github.com/OpenRC/openrc" arch="all" @@ -16,7 +16,6 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/OpenRC/openrc/archive/$pkgve 0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch 0002-force-root-be-rw-before-localmount.patch - 0003-sysctl-add-compatibility-for-busybox-sysctl.patch 0004-hide-error-when-migrating-var-run-to-run.patch 0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch 0007-make-consolefont-service-compatible-with-busyboxs-se.patch @@ -35,6 +34,7 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/OpenRC/openrc/archive/$pkgve modloop.confd sysfsconf.initd firstboot.initd + sysctl.initd " prepare() { @@ -114,7 +114,6 @@ zshcomp() { sha512sums="579b9bfbb151b945a364a2c12b037d2e15991820ca99a07ac18e9bdc50074e67fbf0dcf9865aa4deabe2bf82092e4623be51c9e0b4014384951e0a92ac1e7646 openrc-0.42.1.tar.gz 71fce711adbcb411189a089f1d49567c50348e12c42b7a9c9b582dae5d18051f88ccf81c768337e87d6792d953e84d1e8b93d7978a1947d7d20ef3b1cd330875 0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch b1cedd38badda4fc308decdff06f9644b96fe35617792da8d6d62407409841705fd71b5b57d1804a6395095604a70898f80830c76395ec99f715038a0809d815 0002-force-root-be-rw-before-localmount.patch -9dea3fcdb90e3e8078a771beefeba3ca91b9966a1b8ee9ff96cf460e7dd21abbc4a46a501a960c3edf5a76c083c2cf60ccb06d9da7a4c6df2a50660745beb278 0003-sysctl-add-compatibility-for-busybox-sysctl.patch d54630d40a2d6b10a325cb012d4efcda997a60c008ca953ce5d60059d3f267308a59dabddf93a5fc0d301aa91967137d144effbe5f574394af768ce4ebc48738 0004-hide-error-when-migrating-var-run-to-run.patch 39a35c54ec9112fe84c901ed155a711cec8e194af02d5483ee60b80743dab12391e6fdc7b3da2f86844dd4edcf53e681ff95bd4d6fa1101a89ce54dce2ddbb7c 0005-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch 234c4f3cf39df3350dbea25c00b8d584794b28194f44c726767a6a16d91a26fee1b5d2dd16635f19803fc015b4e9d99c52b23128e6b815938b88365feba8cf59 0007-make-consolefont-service-compatible-with-busyboxs-se.patch @@ -126,9 +125,10 @@ ff9bf2f6e4f55633a9641385398f70a2e591e2b3b56b1903f168a97b07bd56dc5a65d151deeab942 12bb6354e808fbf47bbab963de55ee7901738b4a912659982c57ef2777fff9a670e867fcb8ec316a76b151032c92dc89a950d7d1d835ef53f753a8f3b41d2cec openrc.logrotate 493f27d588e64bb2bb542b32493ed05873f4724e8ad1751002982d7b4e07963cfb72f93603b2d678f305177cf9556d408a87b793744c6b7cd46cf9be4b744c02 hostname.initd c06eac7264f6cc6888563feeae5ca745aae538323077903de1b19102e4f16baa34c18b8c27af5dd5423e7670834e2261e9aa55f2b1ec8d8fdc2be105fe894d55 hwdrivers.initd -8f351f1c673d0e3d66aa4e17222963ee3d1da937ee4cb44eeb4e0448bed0e7e99cce74a9705e0ac9760002ca01e6228436393fc989917615d9ba61a5f848fd44 modules.initd +7113c930f7f5fb5b345b115db175f8e5837e3541b3e022d5cecf1b59067ed4b40b2adea2324a008035b97d653311217ac5cf961b4d0fc8b714a8b2505883cdc6 modules.initd 595098085d5a1204e3c5af59bb4a3b3d1fb2980db77925995aa1ec43ef5ae378cef736ddc7924191a99d39c93891d59274fbba08127b15d584c2f82b067ef683 modloop.initd d21164f4d265456c7633c1f63a296170fcd0d95ca509bbf57c16ac33e4f2e55b840d9e5811f863732040f443ef43d4b9f248d939e273997000556014f114e82e networking.initd 80e43ded522e2d48b876131c7c9997debd43f3790e0985801a8c1dd60bc6e09f625b35a127bf225eb45a65eec7808a50d1c08a5e8abceafc61726211e061e0a2 modloop.confd d76c75c58e6f4b0801edac4e081b725ef3d50a9a8c9bbb5692bf4d0f804af7d383bf71a73d5d03ed348a89741ef0b2427eb6a7cbf5a9b9ff60a240639fa6ec88 sysfsconf.initd -f65b061b4272463071022e88a7392d5573f2d95f91e42c8b4f3ef69171604460ddd3d426dfbab382f73a3fac68d4b4ff3a923fdc49fb6fd9f27ebd3ab24e0d0e firstboot.initd" +f65b061b4272463071022e88a7392d5573f2d95f91e42c8b4f3ef69171604460ddd3d426dfbab382f73a3fac68d4b4ff3a923fdc49fb6fd9f27ebd3ab24e0d0e firstboot.initd +0dfcb23c33da5ccb6b1a94540309855299dcaab5691020684b01096759ec49d80a17901835d3705100eb8d6ef3bfb867bfb14d558373d53b91e85f6c22b08636 sysctl.initd" diff --git a/main/openrc/modules.initd b/main/openrc/modules.initd index c3abde1eaa..3cd141ec29 100644 --- a/main/openrc/modules.initd +++ b/main/openrc/modules.initd @@ -12,7 +12,7 @@ start() { yesno $rc_verbose && verbose=yes ebegin "Loading modules" - echo + eindent for f in /lib/modules-load.d/*.conf \ /usr/lib/modules-load.d/*.conf; do @@ -36,18 +36,14 @@ start() { modprobe -q $module $args done done - - for f in /etc/modules; do - if [ ! -f "$f" ]; then - continue - fi - - veinfo "Processing $f" - sed -e 's/\#.*//g' -e '/^[[:space:]]*$/d' < "$f" \ + + if [ -f /etc/modules ]; then + veinfo "Processing /etc/modules" + sed -e 's/\#.*//g' -e '/^[[:space:]]*$/d' < /etc/modules \ | while read module args; do modprobe -q $module $args done - done + fi for f in /etc/modules-load.d/*.conf; do if [ ! -f "$f" ]; then @@ -77,6 +73,8 @@ start() { modprobe -q $module $args done done + eoutdent + eend $? } diff --git a/main/openrc/sysctl.initd b/main/openrc/sysctl.initd new file mode 100644 index 0000000000..befdb91f00 --- /dev/null +++ b/main/openrc/sysctl.initd @@ -0,0 +1,87 @@ +#!/sbin/openrc-run + +depend() +{ + after clock + before bootmisc logger + keyword -prefix -systemd-nspawn -vserver +} + +start() +{ + local quiet retval=0 status + ebegin "Configuring kernel parameters" + + yesno $rc_verbose || quiet=-q + + eindent + + for f in /lib/sysctl.d/*.conf \ + /usr/lib/sysctl.d/*.conf; do + + if [ -f /etc/sysctl.d/"${f##*/}" ]; then + veinfo "Ignoring $f due to /etc/sysctl.d/${f##*/}" + continue + fi + + if [ -f /run/sysctl.d/"${f##*/}" ]; then + veinfo "Ignoring $f due to /run/sysctl.d/${f##*/}" + continue + fi + + if [ -f "$f" ]; then + vebegin "applying $f" + sysctl $quiet -p "$f" + status=$? + if [ $status -gt 0 ]; then + # Don't change retval= since we expect some package/distro provided + # sysctl configurations to break, so just warn when the user wants + # verbose messages + vewarn "Unable to configure kernel parameters from $f" + fi + fi + done + + for f in /etc/sysctl.d/*.conf; do + + if [ -f /run/sysctl.d/"${f##*/}" ]; then + veinfo "Ignoring $f due to /run/sysctl.d/${f##*/}" + continue + fi + + if [ -f "$f" ]; then + vebegin "applying $f" + sysctl $quiet -p "$f" + status=$? + if [ $status -gt 0 ]; then + retval=$(( $retval + $status )) + eerror "Unable to configure kernel parameters from $f" + fi + fi + done + + if [ -f /etc/sysctl.conf ]; then + vebegin "applying /etc/sysctl.conf" + sysctl $quiet -p /etc/sysctl.conf + status=$? + if [ $status -gt 0 ]; then + retval=$(( $retval + $status )) + eerror "Unable to configure kernel parameters from /etc/sysctl.conf" + fi + fi + + for f in /run/sysctl.d/*.conf; do + if [ -f "$f" ]; then + vebegin "applying $f" + sysctl $quiet -p "$f" + status=$? + if [ $status -gt 0 ]; then + retval=$(( $retval + $status )) + eerror "Unable to configure kernel parameters from $f" + fi + fi + done + eoutdent + + eend $retval +} |