Perhaps it would be prudent to add some logic that when "lsof" is not available, check for (and possibly use) "fstat" instead.
Do note that the syntax of these two commands (lsof vs. fstat) are not the same and additional logic may need to be added. Just thought I'd mention "fstat" because not all systems have "lsof" (for example, FreeBSD vs. Linux). -- Devin On Mon, 2009-11-23 at 12:14 -0800, Jonathan Swartz wrote: > Server::Control allows you to control servers ala apachectl, but with > better diagnostics and many more features. It includes both a drop-in > replacement for apachectl (”apachectlp”) and an OO interface. > > Though it was designed with Apache in mind, there are also subclasses > for HTTP::Server::Simple and Net::Server, and it’s general enough to > use with any server that has a pid file and listens on a port. > > Features include: > > * Checks server status via both pid file and port connect > * Detects and handles corrupt or out-of-date pid files > * Reports what is using a port when it is busy (via lsof) > * Tails the error log when server fails to start > * Supports sudo usage for restricted (< 1024) port > * Easy to customize for your environment with start/stop hooks, > etc. > > Coming soon: plugins for common tasks associated with starting and > stopping servers, such as generating conf files from templates and > auto-restarting a server on file change. > > If you try this and have problems getting it to work, or suggestions > for improvement, please let me know! > > Jon > -- Cheers, Devin Teske -> CONTACT INFORMATION <- Field Engineer FIS - Vicor Business Unit 626-573-6040 Office 510-735-5650 Mobile devin.te...@metavante.com -> LEGAL DISCLAIMER <- This message contains confidential and proprietary information of the sender, and is intended only for the person(s) to whom it is addressed. Any use, distribution, copying or disclosure by any other person is strictly prohibited. If you have received this message in error, please notify the e-mail sender immediately, and delete the original message without making a copy. -> END TRANSMISSION <-