I'm trying to manage a process with supervisord, but the process does not have an option to run in foreground: it always daemonizes. (That's Zabbix Server).
Is there any way to manage daemons with supervisor? Any tools which will make it run in foreground? Or maybe, use the pidfile somehow?
In order to deal with the problem, we'll need some program running in foreground, which exits whenever the daemon exits, and which also proxies signals to the daemon.
Consider using the following script bash script:
just in case someone comes around this question using search engines as I just did.
Zabbix offers since v3.0.0beta1 the "-f" option to run in foreground (https://support.zabbix.com/browse/ZBXNEXT-611)
As you can see below, we start the process using the absolute path to binary (we compiled it from sources), providing our configuration-file using the "-c" switch and absolute path to the configuration file. And then the mentioned "-f" switch to run the process in foreground.
The supervisord configuration file we use looks like:
Please note that we configured in the zabbix-server.conf
All the best
I use
fg process-name
to switch for foreground as shown in supervisor docs