diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
commit | 1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch) | |
tree | 0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch | |
download | meta-openembedded-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch')
-rw-r--r-- | meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch new file mode 100644 index 0000000000..9973b47faf --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | autofs-5.0.7 - dont wait forever to restart | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | When restarting autofs the daemon must be stopped before it is started | ||
6 | again if it is to function properly. At the moment the init script waits | ||
7 | forever which is not ok if the daemon won't exit for some reason. | ||
8 | |||
9 | So, if the daemon is still running after the stop, run stop() again, wait | ||
10 | a bit longer and if it still hasn't stopped kill it with a SIGKILL to clear | ||
11 | the way for the startup. | ||
12 | --- | ||
13 | |||
14 | CHANGELOG | 1 + | ||
15 | redhat/autofs.init.in | 13 ++++++++++--- | ||
16 | 2 files changed, 11 insertions(+), 3 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index 6051723..93b9c26 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -5,6 +5,7 @@ | ||
24 | - fix ipv6 proximity calculation. | ||
25 | - fix parse buffer initialization. | ||
26 | - fix typo in automount(8). | ||
27 | +- dont wait forever to restart. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
32 | index ec6d5d6..cd5cb34 100644 | ||
33 | --- a/redhat/autofs.init.in | ||
34 | +++ b/redhat/autofs.init.in | ||
35 | @@ -129,9 +129,16 @@ function restart() { | ||
36 | status autofs > /dev/null 2>&1 | ||
37 | if [ $? -eq 0 ]; then | ||
38 | stop | ||
39 | - while [ -n "`pidof $prog`" ] ; do | ||
40 | - sleep 5 | ||
41 | - done | ||
42 | + if [ -n "`pidof $prog`" ]; then | ||
43 | + # If we failed to stop, try at least one more time | ||
44 | + # after waiting a little while | ||
45 | + sleep 20 | ||
46 | + stop | ||
47 | + auto_pid=`pidof $prog` | ||
48 | + if [ -n "$auto_pid" ]; then | ||
49 | + kill -9 $auto_pid | ||
50 | + fi | ||
51 | + fi | ||
52 | fi | ||
53 | start | ||
54 | } | ||