-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathautofs-init.patch
More file actions
42 lines (40 loc) · 929 Bytes
/
autofs-init.patch
File metadata and controls
42 lines (40 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- autofs-5.1.5.orig/redhat/autofs.init.in 2020-07-31 12:25:40.474692257 +0000
+++ autofs-5.1.5/redhat/autofs.init.in 2020-07-31 12:41:56.286711145 +0000
@@ -19,6 +19,7 @@
#
# Location of the automount daemon and the init directory
#
+SYSTEMCTL_SKIP_REDIRECT=1
DAEMON=@@sbindir@@/automount
prog=`basename $DAEMON`
MODULE="autofs4"
@@ -102,13 +102,29 @@
return $RETVAL
}
+_wait_prog() {
+ local c=10
+ while [[ $c -gt 0 ]]
+ do
+ [ -n "$(pidof $prog)" ] || return 0
+ c=$(( $c - 1 ))
+ sleep 0.25
+ done
+ return 1
+}
+
function stop() {
echo -n $"Stopping $prog: "
count=0
while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
killproc $prog -TERM >& /dev/null
RETVAL=$?
- [ $RETVAL = 0 -a -z "`pidof $prog`" ] || sleep 20
+ if [[ $RETVAL -eq 0 ]]
+ then
+ ! _wait_prog || break
+ elif [ -z "`pidof $prog`" ]; then
+ sleep 20
+ fi
count=`expr $count + 1`
done
if [ $RETVAL -eq 0 ]; then