Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 3297 - Startup scripts failing to check pids
Summary: Startup scripts failing to check pids
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-01 03:25 UTC by Nicholas Jones (RETIRED)
Modified: 2003-02-04 19:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas Jones (RETIRED) gentoo-dev 2002-06-01 03:25:24 UTC
I've heard a few reports on this in IRC. The startup scripts do not check to 
see if the programs that they are still running when 'script start' is called. 
They are only checking to see if the 'script start' has been run. If 'script 
stop' hasn't run, then it fails to start. There can be some issues with this if 
it depends on having the program running.

This should be fixed. The scripts should verify the PID in a/the pidfile they 
create using

  if ps PID &>/dev/null; then
    IT_RUNNING_SO_FAIL;
  else
    IT_IS_NOT_RUNNING_SO_START;
  fi

That way when a program crashes, you can just run 'script start' again and it 
will realize that the program is dead for some reason.
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2002-06-01 03:32:53 UTC
Note from <roman_>
"stop" is also broken, 'cause when the PID does not exists, it will die in an 
error, and rc will not erase /mnt/.init.d/started/<link>
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-06-03 14:27:45 UTC
That is what the "/etc/init.d/foo zap" is for.  Meaning you could do
for a service that died:

# /etc/init.d/foo zap start

Not that efficient, I know.  I have been working on improving this (all local
changes), but the one or two I sent the examples to did not reply as of yet.
Comment 3 Nicholas Jones (RETIRED) gentoo-dev 2002-09-13 09:50:06 UTC
Non issue