Reputation: 1473
I am trying to write a config file to run supervisord and daemonize some tasks. Right now I have a dummy program that echos "hello" to the cli so that I know supervisord using my conf file. There are two commands I've tried to start supervisord, one which uses my config file and the other which fails to use my config file, and I'm not sure why.
Command that fails:
sudo service supervisord start --configuration=/current/director/path/supervisord.conf --nodaemon=true
Result:
Starting supervisor: supervisord.
Command that works:
sudo supervisord --configuration=/current/directory/path/supervisord.conf
Result:
2014-11-10 22:46:07,332 DEBG fd 6 closed, stopped monitoring <POutputDispatcher at 140621301889000 for <Subprocess at 140621301888424 with name flower in state STARTING> (stdout)>
2014-11-10 22:46:07,333 DEBG fd 8 closed, stopped monitoring <POutputDispatcher at 140621301954896 for <Subprocess at 140621301888424 with name flower in state STARTING> (stderr)>
2014-11-10 22:46:07,334 INFO exited: flower (exit status 1; not expected)
2014-11-10 22:46:07,335 DEBG received SIGCLD indicating a child quit
2014-11-10 22:46:08,336 INFO gave up: flower entered FATAL state, too many start retries too quickly
2014-11-10 22:46:28,858 WARN received SIGHUP indicating restart request
2014-11-10 22:47:03,170 CRIT Supervisor running as root (no user in config file)
2014-11-10 22:47:03,175 INFO supervisord started with pid 28776
2014-11-10 22:47:04,178 INFO spawned: 'flower' with pid 28779
2014-11-10 22:47:04,185 DEBG 'flower' stdout output:
hello
The fact that the second result dies is fine because I expect it to after echoing "hello" at least I know it's using the conf file in the path specified. I'm confused why the first command does not use my config file and what the difference are between the two?
supervisord.conf:
[supervisord]
logfile=/logfile/user/has/access/to/supervisord.log
loglevel=debug
[program:flower]
command=echo hello
process_name=%(program_name)s
autostart=True
autorestart=True
Upvotes: 0
Views: 4824
Reputation: 516
Short version: It is completely ignoring the parameters you are providing.
Longer version:
The first command you indicated, sudo service supervisord start --configuration=/current/director/path/supervisord.conf --nodaemon=true
, is not designed to take parameters in the method you are providing them. Instead, service
takes the name of a service (found in /etc/init.d/ usually) and an operation. There are additional parameters that can be passed, which likely vary based on operating system. Consult the man page (man service
) for the specifics of your operating system.
The operation to perform is usually one of the following:
The proper way of using the service command would be sudo service supervisord start
. This would use a configuration file that is located somewhere in a subdirectory of /etc/default
, /etc/sysconfig
, /etc
, or in the root of /etc
. The location is going to be different, and depend on the particular linux distribution you are using.
To find out details about what actually happened, causing supervisord to run and exit, check in /var/log
, specifically look in the file /var/log/messages
if it exists, or /var/log/syslog
, or for a file or subdirectory with the name supervisord
.
Upvotes: 1