init... pids...etc

Gerard Beekmans gerard at
Wed Nov 15 07:42:23 PST 2000

[Sent a copy to Thinus personally in case he's not on the lfs-apps list yet]

> Now what i've done (and i hope it's the right thing to do), i've added the
> following to the beginning of my rcS script:
> for pids in /var/run/*.pid
> do
>     rm -f $pids
> done
> scripting is still a mystery to me, but this little piece of code works (I
> tested it with echo instead of rm -f ;) ) all i want to know is where is

That's just fine actually. I do something similar myself. I have a script 
that removes /var/run/* /tmp/* and /var/lock/* upon boot. These files 
(/var/lock and /var/run) are stale files because there is no service up and 
running yet, so it doens't hurt one single bit to remove them.

> the best place to put it so that it gets run everytime i boot the system.

The best place would be right after the mountfs has run to ensure you don't 
remove pid files from a service that was just started (like sysklogd)

> Next quirk: when i go init [runlevel] (oh btw, this also deletes the
> file when i change from 3 to 2 and back to 3) the processes
> gets stopped, and started, but then the system doesn't return to a bash
> prompt. It hangs around until you press enter or something and then you get
> your prompt (nothings wrong, everything's working, i know, but it's
> irritating)

I have seen it before yes. I am not sure yet if this is a sysvinit bug or a 
problem with the boot scripts the LFS-book gives you.

Gerard Beekmans

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

Unsubscribe: send email to lfs-apps-request at
and put unsubscribe in the subject header of the message

More information about the blfs-support mailing list