3 ms·
Ask HN: How do you manage your long running processes?
I have an application with several moving parts (solr, rabbitmq, celeryd, plus a few more custom python scripts) and was wondering if there are good ways to manage these. By "manage", I mean a simple way to register processes, execute a start command that starts all of them up in a particular order, and then can shut them down gracefully, too.
Of course, I could write my own master script, create and store my own PIDs etc. just wondering if people had some tools they use that they could recommend.
- bartonfink 15y agoSolaris 10 has a service management system that's basically the master script that you alluded to with a lot of metadata. It's one of the nicer parts of the OS. Of course, it's also on its way out (even the DoD is planning to leave it behind). For your purposes, I'd just write start and stop scripts that read a list of processes from a file. That way, you don't have to worry about changing the order in all your scripts whenever you add or remove a process from your system - just edit your process.order file and you're set. Also, there are several ways to kill a process by name on a Unix box, and that's preferable to storing your PID's.
- ojbyrne 15y agoI've used daemontools (http://cr.yp.to/daemontools.html http://cr.yp.to/daemontools.html) and supervisor (http://supervisord.org/ http://supervisord.org/). Supervisor is somewhat more user-friendly, daemontools feels more solid (it has fewer prereqs for starters).
- waterside81 15y agoThanks for the recommendation. Took a look at supervisord, got it up & running in < 2 mins.
- sg2342 15y agoWhen i was still doing such things i preferred to use the facilities provided by the Operating System. That is: svc on Solaris, rc on FreeBSD and services on Windows. I never did anything serious with Linux but i suspect there is a way a Linux distribution manages it's services. On Solaris and FreeBSD i found it helpful to always contain the deployed software in packages -- this takes some effort first but saves one from reinventing the wheel all over again (including service management).
- maxdemarzi 15y agoI started using foreman and upstart about two weeks ago. I use it to run redis, solr, workers, schedulers with one shot. http://michaelvanrooijen.com/articles/2011/06/08-managing-and-monitoring-your-ruby-application-with-foreman-and-upstart/ http://michaelvanrooijen.com/articles/2011/06/08-managing-an...