A
A
at0m1x2015-12-27 07:35:29
PHP
at0m1x, 2015-12-27 07:35:29

How to manage demons automatically?

Hello everyone)

There is a project that uses background task queue handlers, for example, sending emails. These background handlers run as daemons. Each daemon is configured in upstart, so that in the event of a crash, the system will automatically start it. But there is a slight inconvenience, it lies in the fact that for each daemon you need to create a separate upstart config manually. OS: Ubuntu.

Question: is there any utility for PHP that would allow creating a config file in the project, according to which the demons would be automatically exported to the upstart. Or that this utility itself monitors the work of demons and restarts them in case of a crash.

I know that there are similar utilities in other programming languages, for example, in ruby ​​it is a foreman, in a node it is, for example, pm2. But I would like to find something more "native" for PHP.

What I would like from this utility:
- you can specify the number of daemon instances
- auto-restart at certain intervals (like by cron)
- auto-start when the daemon crashes
- auto-start at OS startup
- web interface that displays the current memory consumption and strout and strerr

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
at0m1x, 2015-12-29
@at0m1x

I settled on the supervisor, from the pros:
- easy to install via apt-get
- has a web interface in which you can start/stop/restart daemons and view logs
- daemon configs can be stored directly in the project (!) supervisord.org/configuration.html# include-section...
- easy to set up using supervisorctl without root coffeeonthekeyboard.com/using-supervisorctl-with-l...
- you can also group daemons for a project and restart them with the whole group serverfault.com/questions/586708/how -can-i-control...

R
romy4, 2015-12-27
@romy4

update-rc.d

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question