]> git.pld-linux.org Git - packages/rc-scripts.git/blob - rc-scripts-git.patch
- rel 5; better handle v6 onlink route
[packages/rc-scripts.git] / rc-scripts-git.patch
1 diff --git a/lib/functions b/lib/functions
2 index 8d018f7..f9538d2 100644
3 --- a/lib/functions
4 +++ b/lib/functions
5 @@ -690,13 +690,12 @@ _daemon_exec() {
6                         --exec "$prog" \
7                         -- "$@"
8         else
9 -
10 -               if [ "$makepid" ] && [ "$pidfile" ]; then
11 -                       export PIDFILE="$pidfile"
12 -                       set -- /lib/rc-scripts/makepid "$@"
13 -               fi
14 -
15                 if [ "$fork" = "1" ]; then
16 +                       export PIDFILE="/dev/null"
17 +                       if [ "$makepid" ] && [ "$pidfile" ]; then
18 +                               export PIDFILE="$pidfile"
19 +                       fi
20 +                       set -- /lib/rc-scripts/makepid "$@"
21                         set -- /usr/bin/setsid "$@"
22                 fi
23                 if [ -n "$user" -a "$user" != "root" ]; then
24 @@ -1009,7 +1008,7 @@ pidofproc() {
25         fi
26  
27         # Next try "pidof" if pidfile is not specified
28 -       if [ -z "$pid" ] && [ -z "$pidfile" ]; then
29 +       if [ -z "$pid" ] && [ -z "$2" ]; then
30                 pid=$(pidof -o $$ -o $PPID -o %PPID -x "$1")
31         fi
32  
33 commit bf42a4fb7c71c31954499bf9cbce4548305afe80
34 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
35 Date:   Tue Jun 7 17:09:48 2016 +0200
36
37     Mount /run as mode=0755,noexec,nosuid,nodev.
38
39 diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
40 index f7f0eea..99bb078 100755
41 --- a/rc.d/rc.sysinit
42 +++ b/rc.d/rc.sysinit
43 @@ -409,7 +409,7 @@ if ! is_yes "$VSERVER" && [[ "$container" != lxc* ]]; then
44         parse_cmdline
45  
46         if [ -d /run ]; then
47 -               is_fsmounted tmpfs /run || mount -n -t tmpfs run /run
48 +               is_fsmounted tmpfs /run || mount -n -t tmpfs run /run -o mode=0755,noexec,nosuid,nodev
49         fi
50  
51         # Early sysctls
52 @@ -680,7 +680,7 @@ if ! is_yes "$VSERVER" && [[ "$container" != lxc* ]]; then
53                 mount -f -t devtmpfs devtmpfs /dev 2> /dev/null
54         fi
55         if is_fsmounted tmpfs /run; then
56 -               mount -f -t tmpfs run /run 2> /dev/null
57 +               mount -f -t tmpfs run /run -o mode=0755,noexec,nosuid,nodev 2> /dev/null
58         fi
59  
60         if is_fsmounted usbfs /proc/bus/usb; then
61 commit 8903a3b15f08d759d06bb2b02e637e0baf7497bf
62 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
63 Date:   Tue Jul 3 15:13:45 2018 +0200
64
65     Don't fail if arrays are already assembled (ex raid10 with 4 devices, one device gets removed/kicked from array).
66
67 diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
68 index 99bb078..6fdca19 100755
69 --- a/rc.d/rc.sysinit
70 +++ b/rc.d/rc.sysinit
71 @@ -326,8 +326,15 @@ init_mdadm() {
72         fi
73  
74         show "Starting up RAID devices"; busy
75 -       /sbin/mdadm --assemble --scan --auto=yes
76 +       mdadm_out=$(/sbin/mdadm --assemble --scan --auto=yes 2>&1)
77         rc=$?
78 +
79 +       if (echo -n "$mdadm_out" | grep -q "Found some drive for an array that is already active:"); then
80 +               rc=0
81 +       fi
82 +
83 +       echo -n "$MDADM_OUT" >&2
84 +
85         if [ "$rc" -eq 0 -o "$rc" -eq 2 ]; then
86                 # rc is used later too, so set sane value
87                 rc=0
88 commit 5d2ee544efe6d27d1b6bc263385c5c9b5bf1b00d
89 Author: Arkadiusz Miśkiewicz <arekm@maven.pl>
90 Date:   Thu Jan 18 10:41:54 2018 +0100
91
92     Onlink doesn't work for IPv6, so add gate route manually first.
93
94 diff --git a/lib/functions.network b/lib/functions.network
95 index bb7a525..d151b04 100644
96 --- a/lib/functions.network
97 +++ b/lib/functions.network
98 @@ -299,6 +299,7 @@ setup_ip_gw_ro ()
99                 if [ -z "${IPV6_GLOBALROUTEDEV}" -o "${IPV6_GLOBALROUTEDEV}" = "${DEVICE}" ]; then
100                         # set up default route
101                         if [ "${IPV6_GLOBALROUTEGW}" ]; then
102 +                               ip -6 route add ${IPV6_GLOBALROUTEGW} dev ${DEVICE} ${IP6SRCADDR} onlink
103                                 ip -6 route add 2000::/3 via ${IPV6_GLOBALROUTEGW} dev ${DEVICE} ${IP6SRCADDR} onlink
104                         elif [ "${IPV6_GLOBALROUTEDEV}" = "${DEVICE}" ]; then
105                                 ip -6 route add 2000::/3 dev ${DEVICE} ${IP6SRCADDR}
This page took 0.034396 seconds and 3 git commands to generate.