• Post Reply Bookmark Topic Watch Topic
  • New Topic

Monitor FIFO (mkfifo) file - start / stop not working  RSS feed

 
Peter Brown
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

proFTPD can use a FIFO file as a log. The manual tells me I must start the monitoring fifo script before the proftpd is started. I found in the init.d script the start parameter and inserted:

proftpd start...
touch /opt/ftp/proftpd.lock
java Simple&

[Simple now in background]

Fifo reads:



In the init.d stop script I have:
rm /opt/ftp/proftpd.lock

which I thought would cause Simple to exit as lockFile no longer exists.

Any help - slaps to the side of the head appreciated.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not how UNIX works; when a file is "deleted," it doesn't really go away until no processes have that file open anymore.
 
Peter Brown
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ernest for explaining.

To complete the post:
I got it to work by replacing lockFile.exists() with true i.e. infinite loop and handling the start and stop via bourne scripts.

The start script puts the java program in the background and records the PID in the proftpd.lock file.
The stop script opens the proftpd.lock file and kills the PID recorded in it.

top monitoring tool is not showing the background java process being an issue so leaving as is....

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!