tacho / conman

Automatically exported from code.google.com/p/conman
GNU General Public License v3.0
1 stars 0 forks source link

conman startup doesn't respect PIDFILE argument #20

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Specify a PIDFILE argument in /etc/sysconfig/conman or /etc/init.d/conman

What is the expected output? What do you see instead?
Expect no errors and for pid file to be written to the specified path.

What version of the software are you using? On what operating system?
0.2.8

Please provide any additional information below.
I've changed the user to user conman and would like to write to 
/var/run/console/conman.pid. Here's what I see when trying to start conman; you 
can see it's trying to write to the default location:
[root@dtn2:run]# /etc/init.d/conman restart
Starting ConMan: conmand
PIDFILE is /var/run/console/conmand
ERROR:     Unable to open pidfile "/var/run/conman.pid": Permission denied

I tried manually specifying the -pidfile and --pidfile argumentw, but those 
didn't work either.

Original issue reported on code.google.com by cameron....@gmail.com on 20 Aug 2014 at 11:18

GoogleCodeExporter commented 9 years ago
You need to change the pidfile in /etc/conman.conf:

  server pidfile="/var/run/console/conman.pid"

conmand doesn't support a "-pidfile" or "--pidfile" command-line option.

Original comment by chris.m.dunlap on 21 Aug 2014 at 7:42

GoogleCodeExporter commented 9 years ago
Sure enough, that worked. There is a PIDFILE= argument in both the init file 
and in /etc/sysconfig and I had tried those. Perhaps those should be removed if 
no longer relevant? At any rate, thanks and you can close.

Original comment by cameron....@gmail.com on 21 Aug 2014 at 8:40

GoogleCodeExporter commented 9 years ago
You should also update the PIDFILE value in /etc/sysconfig/conman.  Yes, it's 
needlessly confusing.

By default, conmand behaves as a traditional SysV daemon and performs a 
double-fork.  As such, it must update the pidfile with the pid of the 
grandchild process, so-to-speak.

When you start/stop/restart the service via the SysV init script, that script 
will (often) check the pidfile to see if the service is already running.

Ideally, conmand should support a command-line option to specify the location 
of the pidfile.  The SysV init script could then specify the location of this 
file (which would override the conman.conf value, if present), and its contents 
could be updated by conmand after the double-fork.  systemd could also use it 
with a Type=forking service file.  That way, you won't have to specify the 
pidfile in two configuration files (where it's too easy to overlook one).  I'll 
tag this as a feature request.

Original comment by chris.m.dunlap on 22 Aug 2014 at 12:00