diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2020-01-16 19:04:00 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2020-01-16 19:08:06 +0100 |
commit | 0883c9ddd66fa981fe993434cb3bab2593e299e4 (patch) | |
tree | 7da6f3ac8124fe40f5fae08620a7065e1a729c17 | |
parent | 5cffcf36bcd88657a1faf4c14959f3f506e5fa9d (diff) | |
download | alpine_aports-0883c9ddd66fa981fe993434cb3bab2593e299e4.tar.bz2 alpine_aports-0883c9ddd66fa981fe993434cb3bab2593e299e4.tar.xz alpine_aports-0883c9ddd66fa981fe993434cb3bab2593e299e4.zip |
main/openrc: allow to change interfaces config location
This is basically a backport of 6a467d4a814f4ce4ce59f9022e656fad7a4c79aa
but implemented in more cautious way to be more sure that it will surely
not cause any compatibility breakages.
-rw-r--r-- | main/openrc/APKBUILD | 4 | ||||
-rw-r--r-- | main/openrc/networking.initd | 16 |
2 files changed, 13 insertions, 7 deletions
diff --git a/main/openrc/APKBUILD b/main/openrc/APKBUILD index 610b906463..ac7cc6d044 100644 --- a/main/openrc/APKBUILD +++ b/main/openrc/APKBUILD | |||
@@ -2,7 +2,7 @@ | |||
2 | pkgname=openrc | 2 | pkgname=openrc |
3 | pkgver=0.42.1 | 3 | pkgver=0.42.1 |
4 | _ver=${pkgver/_git*/} | 4 | _ver=${pkgver/_git*/} |
5 | pkgrel=0 | 5 | pkgrel=1 |
6 | pkgdesc="OpenRC manages the services, startup and shutdown of a host" | 6 | pkgdesc="OpenRC manages the services, startup and shutdown of a host" |
7 | url="https://github.com/OpenRC/openrc" | 7 | url="https://github.com/OpenRC/openrc" |
8 | arch="all" | 8 | arch="all" |
@@ -127,7 +127,7 @@ d2b8700f56b05579926352855de8fcee5cf78f0c13200643a5195f8c60e2b5082d476b42cc77b132 | |||
127 | c06eac7264f6cc6888563feeae5ca745aae538323077903de1b19102e4f16baa34c18b8c27af5dd5423e7670834e2261e9aa55f2b1ec8d8fdc2be105fe894d55 hwdrivers.initd | 127 | c06eac7264f6cc6888563feeae5ca745aae538323077903de1b19102e4f16baa34c18b8c27af5dd5423e7670834e2261e9aa55f2b1ec8d8fdc2be105fe894d55 hwdrivers.initd |
128 | b04058ec630e19de0bafefe06198dc1bff8c8d5d2c89e4660dd83dda8bb82a76cdb1d8661cce88e4a406aa6b4152e17efff52d3eb18ffaec0751d0b6cdbcc48a modules.initd | 128 | b04058ec630e19de0bafefe06198dc1bff8c8d5d2c89e4660dd83dda8bb82a76cdb1d8661cce88e4a406aa6b4152e17efff52d3eb18ffaec0751d0b6cdbcc48a modules.initd |
129 | 595098085d5a1204e3c5af59bb4a3b3d1fb2980db77925995aa1ec43ef5ae378cef736ddc7924191a99d39c93891d59274fbba08127b15d584c2f82b067ef683 modloop.initd | 129 | 595098085d5a1204e3c5af59bb4a3b3d1fb2980db77925995aa1ec43ef5ae378cef736ddc7924191a99d39c93891d59274fbba08127b15d584c2f82b067ef683 modloop.initd |
130 | 68dd99474356c6235efe77e65dbbc3816cbce41c2fd87f451b08c450702d9ea49cd1028f3d9c4aaf582139bb2387483b0ba60a99fa12162bb7a496d5a32e5f03 networking.initd | 130 | e45e8f0f8746d949c4f2a49cdc5451b4722b66f280c844b1895e91e2886b7ed351ab46eae1cdeb88051a0035dd65c5fc72c25bf769db34ed2e2e90f38193e0aa networking.initd |
131 | 80e43ded522e2d48b876131c7c9997debd43f3790e0985801a8c1dd60bc6e09f625b35a127bf225eb45a65eec7808a50d1c08a5e8abceafc61726211e061e0a2 modloop.confd | 131 | 80e43ded522e2d48b876131c7c9997debd43f3790e0985801a8c1dd60bc6e09f625b35a127bf225eb45a65eec7808a50d1c08a5e8abceafc61726211e061e0a2 modloop.confd |
132 | d76c75c58e6f4b0801edac4e081b725ef3d50a9a8c9bbb5692bf4d0f804af7d383bf71a73d5d03ed348a89741ef0b2427eb6a7cbf5a9b9ff60a240639fa6ec88 sysfsconf.initd | 132 | d76c75c58e6f4b0801edac4e081b725ef3d50a9a8c9bbb5692bf4d0f804af7d383bf71a73d5d03ed348a89741ef0b2427eb6a7cbf5a9b9ff60a240639fa6ec88 sysfsconf.initd |
133 | f65b061b4272463071022e88a7392d5573f2d95f91e42c8b4f3ef69171604460ddd3d426dfbab382f73a3fac68d4b4ff3a923fdc49fb6fd9f27ebd3ab24e0d0e firstboot.initd" | 133 | f65b061b4272463071022e88a7392d5573f2d95f91e42c8b4f3ef69171604460ddd3d426dfbab382f73a3fac68d4b4ff3a923fdc49fb6fd9f27ebd3ab24e0d0e firstboot.initd" |
diff --git a/main/openrc/networking.initd b/main/openrc/networking.initd index 2f7bec65ec..00613e0a48 100644 --- a/main/openrc/networking.initd +++ b/main/openrc/networking.initd | |||
@@ -3,9 +3,15 @@ | |||
3 | # note that the spoofprotect, syncoockies and ip_forward options are set in | 3 | # note that the spoofprotect, syncoockies and ip_forward options are set in |
4 | # /etc/sysctl.conf | 4 | # /etc/sysctl.conf |
5 | 5 | ||
6 | ifconf=/etc/network/interfaces | ||
7 | ifstate=/var/run/ifstate | 6 | ifstate=/var/run/ifstate |
8 | 7 | ||
8 | if [ -f "$cfgfile" ]; then | ||
9 | ifopts="-i $cfgfile" | ||
10 | else | ||
11 | ifopts= | ||
12 | cfgfile="/etc/network/interfaces" | ||
13 | fi | ||
14 | |||
9 | single_iface="${SVCNAME#*.}" | 15 | single_iface="${SVCNAME#*.}" |
10 | if [ "$single_iface" = "$SVCNAME" ]; then | 16 | if [ "$single_iface" = "$SVCNAME" ]; then |
11 | single_iface= | 17 | single_iface= |
@@ -23,7 +29,7 @@ find_ifaces() { | |||
23 | if [ -n "$single_iface" ]; then | 29 | if [ -n "$single_iface" ]; then |
24 | echo $single_iface | 30 | echo $single_iface |
25 | else | 31 | else |
26 | awk '$1 == "auto" {for (i = 2; i <= NF; i = i + 1) printf("%s ", $i)}' $ifconf | 32 | awk '$1 == "auto" {for (i = 2; i <= NF; i = i + 1) printf("%s ", $i)}' "$cfgfile" |
27 | fi | 33 | fi |
28 | } | 34 | } |
29 | 35 | ||
@@ -43,8 +49,8 @@ start() { | |||
43 | for iface in $(find_ifaces); do | 49 | for iface in $(find_ifaces); do |
44 | local r=0 | 50 | local r=0 |
45 | ebegin "$iface" | 51 | ebegin "$iface" |
46 | if ! ifup $iface >/dev/null; then | 52 | if ! ifup $ifopts $iface >/dev/null; then |
47 | ifdown $iface >/dev/null 2>&1 | 53 | ifdown $ifopts $iface >/dev/null 2>&1 |
48 | r=1 | 54 | r=1 |
49 | fi | 55 | fi |
50 | # atleast one interface needs to be started for action | 56 | # atleast one interface needs to be started for action |
@@ -64,7 +70,7 @@ stop() { | |||
64 | eindent | 70 | eindent |
65 | for iface in $(find_running_ifaces); do | 71 | for iface in $(find_running_ifaces); do |
66 | ebegin "$iface" | 72 | ebegin "$iface" |
67 | ifdown -f $iface >/dev/null | 73 | ifdown $ifopts -f $iface >/dev/null |
68 | eend $? | 74 | eend $? |
69 | done | 75 | done |
70 | eoutdent | 76 | eoutdent |