Am I already running?

Am I already running?

Post by Shannon Nels » Wed, 10 Jul 1991 04:05:24

I need to set up a server in a System V, Release 4 environment.  This
server needs to find out at startup if a copy of it is already
running.  If so, exit; if not, continue.  One of the requirements is
that whatever the mechanism, it must "disappear" automatically when the
process dies, whether it dies cleanly or from an unexpected exception.
Also, this server could be started by any one of several specific
userids, but is not a setuid program.

There are several way I can think of to do this.  Is there a particular
accepted way?


   1) Set up a semaphore  (perhaps the best for what I'm doing)
   2) Hold a lock on a specific file  (would be more portable?)
   3) Hold open a socket  (this would do, I s'pose)
   4) Grep through the output of the ps command  (ugly and painfully slow)
   5) Other suggestions?

Shannon Nelson              Portland Technology Development, Intel

                  Parents can't afford to be squeemish.
Shannon Nelson              Portland Technology Development, Intel

                  Parents can't afford to be squeemish.


1. I am with the following error, when i am running lilo...

       I could't understand whats going wrong.
I compiled new kernel with kgdb patch..and entered the details in /etc/lilo.conf
and running lilo..

i got the following lines..

Warning: /etc/lilo.conf should be writable only for root ( I am in root login only)
Warning: device 0x0306 exceeds 1024 cylinder limit.

geo_comp_addr: Cylinder number is too big (  1146 > 1023).

Could any one help me out...


2. Sunday Times distorts the truth (again)

3. I am in text mode, what browser am I running....

4. RPM Troubles

5. I already RTFM, but am still having problems

6. Please Help totally lost.

7. problems with minicom? (thinks i am already online?)

8. Move Arinc Unix HP driver to FreeBSD driver

9. Saving the terminal output for a jobs already running.????????

10. inetd: dhcpd already running

11. Find already running instance of program in C

12. shutdown: already running (was Re: Big problems with SysVinit 2.60)

13. dmispd . Another daemon already running....