[pisa] Daemon running twice & lock files

  • From: Thomas Jansen <mithi@xxxxxxxxx>
  • To: pisa@xxxxxxxxxxxxx
  • Date: Wed, 14 Oct 2009 15:38:47 +0200

In the past few weeks, serveral members of the group experienced weird errors
caused by running a daemon twice on the same machine. To prevent this from
happening again (which costs time to debug), I protected the daemons with lock
files. Running a daemon a second time results in the following message:

PISA daemon already running with pid $PID

You may then choose to kill the first daemon with "sudo kill $PID". The lock
files are removed when the shutdown procedure finishes correctly. This also
means, that segfaults and other abnormal terminations (the above kill command
is _not_ considered an abnormal termination) leave the lock file in place.

The lock files are located in /var/lock/ and are called pisacd.lock,
pisasd.lock and pisand.lock. Before you remove those lock files by hand,
please make sure, that the process is no longer running. You can use the
following command to be sure: ps ax|grep pisa[csn]d

Let's hope it saves us some time.

Thomas

PS: The code was copied in medival times from HIPL and poorly adapted. If you
absolutely _have_ to copy code please make sure you rename the declarations as
well as the definitions.

Other related posts:

  • » [pisa] Daemon running twice & lock files - Thomas Jansen