Simon icon Simon
Flexible server monitoring

Feature Request: Simon.pid?

Hi David,

I was wondering if it would be possible for Simon to write to a .pid file when it starts up.

I use monit and m/monit for monitoring and restarting individual services (by CPU and RAM usage, etc) and it would be great if I could keep an eye on Simon using the same basic process. But monit needs a .pid file to reliably keep an eye on a process.

I'm currently using Simon 3.6b2 on my dev server and it was using over 2.2GB of real ram (only 19 active tests) and it would be good to be notified or restart it before it grew to that size.

So any chance that could be added at some point?

Cheers
Wade

David Sinclair's picture

Re: Feature Request: Simon.pid?

Hi Wade,

I hadn't encountered .pid files before... but a quick search seems to suggest it's a linux thing.

It wouldn't be difficult to support that, though, so I'll consider adding it in the forthcoming release.

To save me some time: where should this file be saved? Is it simply called ".pid", or something like "Simon.pid"? Does it just contain the process ID?

If I don't get around to adding it, you may be able to do it via a frequent script service to check Simon's PID and a script notifier to write the .pid file when it changes.

Re: Feature Request: Simon.pid?

Hi David,

Sorry for tardy reply, I forgot that the forum doesn't notify on replies.

Normally the pid file just contains the process ID and would be written to /var/run/simon.pid

If you check out your current /var/run it probably has AppleFileServer.pid, cron.pid, mds.pid and a a few others. I'm not certain on the exact format as some seem to have a terminating line feed and some don't.

I've had a play with a service script to check and update a pid file. Simon is running as a logged in user but it doesn't have write permissions to /var/run so I've got it writing to /var/tmp instead. It's takes a few seconds to get written after starting up (it's normally at the end of the queue) but so far it's been soon enough so monit doesn't try re-restarting it. But so far so good. 8)

David Sinclair's picture

Re: Feature Request: Simon.pid?

Yeah, Simon wouldn't be able to write to /var/run without asking for authentication, which I wouldn't want to do. I don't really want it writing to any directories outside its data folder, either, since that won't work if I ever get Simon sandboxed (so I can update the Mac App Store editions).

So your service script is probably the best option at present.

Happy New Year!