Patch: Add Log Output Sync, and Add Status Command

3 views
Skip to first unread message

sabat

unread,
Jul 25, 2009, 7:37:51 PM7/25/09
to simple-daemon
Hi everyone --

I just uploaded a patch to the current revision (0.1.2) that does two
things:

1- calls 'sync' on the log descriptor after opening, so that the OS
doesn't buffer the log messages as they're written. (Simply put, you
see messages immediately as they're written to the log, instead of
having to wait eons.)

2- adds a 'status' command, which checks for the existence of the pid
file and then runs Process.getpgid on the PID. I did see that someone
else had added a patch that has a check to see if the daemon process
is alive; however, it runs /bin/ps to do the check, which would
obviously not work on Windows, and is (IMHO) a little less elegant
than having Ruby do the check itself.

sabat

unread,
Jul 25, 2009, 7:59:49 PM7/25/09
to simple-daemon
OK, I lied -- I've uploaded an updated patch that also handles the
duplicate instance problem. I also took a liberty
by moving messages to constants defined in SimpleDaemon::Base.

madbox

unread,
Jul 26, 2009, 12:57:48 AM7/26/09
to simple-daemon
Hi.

Good to see that this groop is still alive. :)
The sad thing is that maintainer seems to be lost.

"gem search" shows that several clones available... may be there is a
point in patching one of them.
Reply all
Reply to author
Forward
0 new messages