Opened 23 years ago

Closed 23 years ago

Last modified 23 years ago

#310 closed defect (fixed)

lfs-bootscripts-1.8

Reported by: gerard@… Owned by: gerard@…
Priority: normal Milestone:
Component: Book Version: CVS
Severity: normal Keywords:
Cc:

Description

getpids function doesn't take "grandfather pid" into account:

From: Dirk Groeneveld <dirk.groeneveld@…> To: lfs-dev <lfs-dev@…> Subject: bootscripts bug Date: Thu, 14 Mar 2002 00:35:04 +0100

I have found a problem with the bootscripts, and tinkered with them a little, but found no satisfying solution so far. I have tried version 1.7. It's all very weird and I am very confused. Apparently the script finds itself when it is called like the daemon it is meant to start. For example, I use /etc/rc.d/init.d/squid to start /usr/sbin/squid. The script starts up, looks for squid, finds itself, thinks, squid is already running, and aborts. That is very weird because I'd think that the -o %PPID parameter to pidof (in getpids() in /etc/rc.d/init.d/functions) would filter out the script from the list of returned pids. So I added a "ps ax | grep squid" right after the pidof command, and had it print the return of getpids to the screen. It looks like this (newlines deliberately added to improve readability, he prints everything into one line): Starting squid ... 1747 pts/2 S 0:00 /bin/sh ./squid start 1750 pts/2 S 0:00 /bin/sh ./squid start 1754 pts/2 S 0:00 grep squid 1751 1750 Already running [ ATTN ]

Change History (6)

comment:1 by gerard@…, 23 years ago

dependson: 30

comment:2 by gerard@…, 23 years ago

Add 'contrib' directory

comment:3 by gerard@…, 23 years ago

Owner: changed from lfs-book@… to gerard@…
Status: newassigned

comment:4 by gerard@…, 23 years ago

Resolution: fixed
Status: assignedclosed

comment:5 by gerard@…, 23 years ago

dependson: 30

getpids fixed contrib added changed 'print_status warning' a bit, you can use it like print_status warning [running|not_running]

This is nicer than having to add the code to the loadproc/killproc/reloadproc/statusproc functions to display an "already running" or "not running" warning.

comment:6 by markh@…, 23 years ago

i'm closing this because we're now up to lfs-bootscripts-1.9!

Note: See TracTickets for help on using tickets.