Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#482817: pidofproc and %PPID

10 views
Skip to first unread message

John van der Kamp

unread,
Nov 28, 2008, 5:10:07 PM11/28/08
to
Hi,

I've been trying to debug this myself too, and actually thought like in
bug #506995 that portmap was running twice, since it would be started from
/etc/rcS.d/S40networking (which kicks /etc/network/if-up.d/nfsmount.sh)
and also from /etc/rcS.d/S43portmap.
So I disabled the rcS.d portmap and nfs-common since the nfsmount.sh
script would start them, but then I still had the problem!

As far as I can tell now, /etc/init.d/portmap does:
pid=$( pidofproc portmap )
The $() starts a new process, and pidof -o %PPID uses this as parent pid.
But the /etc/init.d/portmap script is also running, and recognized, making
the pidof program return a of the init.d script.

I've fix it like this, but you're welcome to make your own conclusions and
fixes :)

--- /etc/init.d/portmap.old 2008-11-28 22:49:01.359743640 +0100
+++ /etc/init.d/portmap 2008-11-28 22:49:07.680869696 +0100
@@ -30,8 +30,8 @@
case "$1" in
start)
log_begin_msg "Starting portmap daemon..."
- pid=$( pidofproc portmap )
- if [ -n "$pid" ] ; then
+ pidofproc portmap >/dev/null
+ if [ "$?" = 0 ] ; then
log_begin_msg "Already running."
log_end_msg 0
exit 0


Since I don't know of a way to capture the output in a variable without
using $() or ``, I let it check the return value of pidofproc.

John


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Petter Reinholdtsen

unread,
Nov 28, 2008, 10:20:12 PM11/28/08
to
reassign 482817 portmap
thanks

[John van der Kamp]


> As far as I can tell now, /etc/init.d/portmap does:
> pid=$( pidofproc portmap )
> The $() starts a new process, and pidof -o %PPID uses this as parent pid.
> But the /etc/init.d/portmap script is also running, and recognized, making
> the pidof program return a of the init.d script.

Sound to me like the new behaviour of pidofproc is the source of your
problem.

> I've fix it like this, but you're welcome to make your own
> conclusions and fixes :)

Right. This make me conclude that the problem is with portmap and
lsb-base. Reassigning to portmap.

Happy hacking,
--
Petter Reinholdtsen

Aníbal Monsalve Salazar

unread,
Nov 29, 2008, 2:00:26 AM11/29/08
to
On Sat, Nov 29, 2008 at 03:12:06AM +0000, Debian Bug Tracking System wrote:
>Processing commands for con...@bugs.debian.org:
>
>>reassign 482817 portmap
>Bug#482817: initscripts: No longer mounts NFS filesystems at startup
>Bug reassigned from package `initscripts' to `portmap'.
>
>>thanks
>Stopping processing here.

>
>[John van der Kamp]
>>As far as I can tell now, /etc/init.d/portmap does:
>> pid=$( pidofproc portmap )
>>
>>The $() starts a new process, and pidof -o %PPID uses this as parent
>>pid. But the /etc/init.d/portmap script is also running, and
>>recognized, making the pidof program return a of the init.d script.
>
>Sound to me like the new behaviour of pidofproc is the source of your
>problem.
>
>>I've fix it like this, but you're welcome to make your own conclusions
>>and fixes :)
>
>Right. This make me conclude that the problem is with portmap and
>lsb-base. Reassigning to portmap.
>
>Happy hacking,
>--
>Petter Reinholdtsen

Hello All,

Please test if portmap 6.0-9 fixes this bug.

Thank you,

Aníbal

signature.asc

Thomas Lange

unread,
Dec 1, 2008, 6:20:08 AM12/1/08
to
>>>>> On Sat, 29 Nov 2008 17:44:28 +1100, Aníbal Monsalve Salazar <ani...@debian.org> said:

> Please test if portmap 6.0-9 fixes this bug.

No. This does not solve #482817 for me.

--
regards Thomas

Vidar Hoel

unread,
Dec 2, 2008, 2:20:08 PM12/2/08
to
On Sat, 29 Nov 2008 17:44:28 +1100, Aníbal Monsalve Salazar
<ani...@debian.org> said:

> Please test if portmap 6.0-9 fixes this bug.

Hi,

I had the same problem as above. When /etc/rcS.d/S40networking was
executed at boot, he tried to start the portmap daemon, but did not
because he thought it was already running. And then he tried to start
"NFS common utilities" / statd and that failed.

But, I tried portmap 6.0-9 and that did solve the bug for me.

The false message about portmap is already running is gone, and he now
start portmap.


Regards,
Vidar Hoel

Mikko Korhonen

unread,
Dec 2, 2008, 3:10:18 PM12/2/08
to

>
> Hello All,
>
> Please test if portmap 6.0-9 fixes this bug.
>
> Thank you,
>
> Aníbal
>
Yes, it works now.

Best regards, Mikko

0 new messages