loadproc in bootscript function

Gerard Beekmans gerard at linuxfromscratch.org
Fri Nov 24 06:02:49 PST 2000

On November 24, 2000 06:20 am, you wrote:
> Hey,
> at the moment I try to understand the bootscripts of my LFS 2.4.2 system,
> but I'm not a bash guru.
> So, here's my question:

> man pidof says -o excludes process ID's ($$ -> process of the running
> shell, %PPID -> process of pidof (right?) and $PPID -> what's that??? are
> excluded); -x means that the process ID of the shell should be echoed, if
> we want to start a script.

$PPID contains the PID of the shell that pidof is run from:
root:/mnt/hda2/etc/rc.d/init.d# ps ax|grep `echo $PPID`
  697 pts/4    S      0:00 bash

> The result should be a process ID of the program we want to start, am I
> right? But how can there be a process ID, if the program doesn't run (we
> havn't started it yet)?

Right. This construction is just to check if the requested process is already 
running like Sergey pointed out. If it's running, it won't be started again 
(unless you use LFS-2.4.4's bootscripts which give you the opportunity to 
override it because sometimes it's wanted to run a process twice (like run a 
daemon on a different port other than the default port. Currently loadproc 
doesn't allow such a  construction)

Gerard Beekmans

-*- If Linux doesn't have the solution, you have the wrong problem -*-

Unsubscribe: send email to lfs-discuss-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message

More information about the lfs-dev mailing list