How can I stop a server service in circus?

1.2k Views Asked by At

Does anybody know how to turn off services in circus? I'm able to start services by using this line

 cmd =  /sbin/service mysqld restart

but apparently when I turn off the watcher in circusctl the service is still running

 [root@devel1 bin]# service mysqld status
 mysqld (pid  7571) is running...
 [root@devel1 bin]# circusctl
 circusctl 0.11.1
 circusd-stats: active
 hello: active
 httpd: active
 mysql: active
 plugin:myplugin: active
 webapp: stopped
 (circusctl) stop mysql
 ok
 (circusctl)
 [root@devel1 bin]# service mysqld status
 mysqld (pid  8342) is running...
 [root@devel1 bin]#

here is my circus.ini file.

 [circus]
 statsd = True
 httpd_host = 127.0.0.1
 httpd_port = 8080
 endpoint = tcp://127.0.0.1:5555

 [watcher:webapp]
 cmd = bin/chaussette --fd $(circus.sockets.web)
 numprocesses = 3
 use_sockets = True

 [watcher:hello]
 cmd = php /home/joseph/php/helloworld.php --fd $(circus.sockets.web)
 numprocess = 2
 use_sockets = True
 stdout_stream.filename = /home/joseph/test.log

 [watcher:mysql]
 cmd =  /sbin/service mysqld restart
 numprocess = 1
 stdout_stream.filename = /tmp/circus.log

 [watcher:httpd]
 cmd =  /sbin/service httpd $(circus.env.shell)
 numprocess = 1
 stdout_stream.filename = /tmp/circus.log

 [socket:web]
 host = 127.0.0.1
 port = 8888
1

There are 1 best solutions below

0
On

What you see is the result of /sbin/service, as that demonize mysql process.

If you want circus to manage the process then you need to handle the process undaemonised to circus.

Change the line to run the actual mysql process::

cmd =  /sbin/service mysqld restart