~ubuntu-branches/ubuntu/precise/autofs5/precise

« back to all changes in this revision

Viewing changes to debian/patches/autofs-5.0.5-fix-pidof-init-script-usage.patch

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-07-03 14:35:46 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110703143546-nej26krjij0rf792
Tags: 5.0.6-0ubuntu1
* New upstream release:
  - Dropped upstream patches 
  - Refreshed debian/patches/17ld.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
autofs-5.0.5 - fix pidof init script usage
2
 
 
3
 
From: Ian Kent <raven@themaw.net>
4
 
 
5
 
For some reason, following an update, pidof doesn't return the pid
6
 
of a running automount daemon when the path is used rather than just
7
 
the name, probably to do with the inode of the daemon program changing.
8
 
 
9
 
So we change the init script to use just the program name rather than
10
 
the path.
11
 
---
12
 
 
13
 
 CHANGELOG             |    1 +
14
 
 redhat/autofs.init.in |    8 ++++----
15
 
 samples/rc.autofs.in  |    8 ++++----
16
 
 3 files changed, 9 insertions(+), 8 deletions(-)
17
 
 
18
 
 
19
 
diff --git a/CHANGELOG b/CHANGELOG
20
 
index dd093e2..cc2efab 100644
21
 
--- a/CHANGELOG
22
 
+++ b/CHANGELOG
23
 
@@ -12,6 +12,7 @@
24
 
 - don't use master_lex_destroy() to clear parse buffer.
25
 
 - make documentation for set-log-priority clearer.
26
 
 - fix timeout in connect_nb().
27
 
+- fix pidof init script usage.
28
 
 
29
 
 03/09/2009 autofs-5.0.5
30
 
 -----------------------
31
 
diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in
32
 
index 806302b..363e824 100644
33
 
--- a/redhat/autofs.init.in
34
 
+++ b/redhat/autofs.init.in
35
 
@@ -101,14 +101,14 @@ function start() {
36
 
 function stop() {
37
 
        echo -n $"Stopping $prog: "
38
 
        count=0
39
 
-       while [ -n "`pidof $DAEMON`" -a $count -lt 15 ] ; do
40
 
+       while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
41
 
                killproc $prog -TERM >& /dev/null
42
 
                RETVAL=$?
43
 
-               [ $RETVAL = 0 -a -z "`pidof $DAEMON`" ] || sleep 3
44
 
+               [ $RETVAL = 0 -a -z "`pidof $prog`" ] || sleep 3
45
 
                count=`expr $count + 1`
46
 
        done
47
 
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/autofs
48
 
-       if [ -n "`pidof $DAEMON`" ] ; then
49
 
+       if [ -n "`pidof $prog`" ] ; then
50
 
                failure "$prog shutdown"
51
 
        else
52
 
                success "$prog shutdown"
53
 
@@ -128,7 +128,7 @@ function reload() {
54
 
                RETVAL=1
55
 
                return $RETVAL
56
 
        fi
57
 
-       pid=`pidof $DAEMON`
58
 
+       pid=`pidof $prog`
59
 
        if [ -z $pid ]; then
60
 
                echo $"$prog not running"
61
 
                RETVAL=1
62
 
diff --git a/samples/rc.autofs.in b/samples/rc.autofs.in
63
 
index b193a4e..ae2e907 100644
64
 
--- a/samples/rc.autofs.in
65
 
+++ b/samples/rc.autofs.in
66
 
@@ -88,13 +88,13 @@ function start() {
67
 
 function stop() {
68
 
        echo -n $"Stopping $prog: "
69
 
        count=0
70
 
-       while [ -n "`pidof $DAEMON`" -a $count -lt 15 ] ; do
71
 
+       while [ -n "`pidof $prog`" -a $count -lt 15 ] ; do
72
 
                killall -TERM $prog >& /dev/null
73
 
                RETVAL=$?
74
 
-               [ $RETVAL = 0 -a -z "`pidof $DAEMON`" ] || sleep 3
75
 
+               [ $RETVAL = 0 -a -z "`pidof $prog`" ] || sleep 3
76
 
                count=`expr $count + 1`
77
 
        done
78
 
-       if [ -z "`pidof $DAEMON`" ] ; then
79
 
+       if [ -z "`pidof $prog`" ] ; then
80
 
                echo "done."
81
 
        else
82
 
                echo "failed."
83
 
@@ -108,7 +108,7 @@ function restart() {
84
 
 }
85
 
 
86
 
 function reload() {
87
 
-       pid=`pidof $DAEMON`
88
 
+       pid=`pidof $prog`
89
 
        if [ -z $pid ]; then
90
 
                echo $"$prog not running"
91
 
                RETVAL=1