In Centos/RHEL 5 was another approach with /etc/inittab file, but in Centos/RHEL6 System V was changed by Upstart system.
Here is config example:
[tsolodovnikov@SomeServer ~]$cat /etc/init/dbmap.conf
#
## This service maintains dbmap monitor process.
#
start on startup
start on runlevel [2345] and stopped rc RUNLEVEL=[2345]
stop on runlevel [S016]
respawn
respawn limit 10 120
exec ruby -C /was/chnaged/just/in/case/ /usr/bin/rake RAILS_ENV=production database:monitor
--------------
[tsolodovnikov@SomeServer ~]$ sudo start dbmap
dbmap start/running, process 9027
Now if you gonna kill PID 9027, new process will be created.
Комментариев нет:
Отправить комментарий