Opened 14 years ago

Closed 14 years ago

#26345 closed defect (fixed)

syslog-ng respawn attempts until pid type changed and pidfile added

Reported by: sgilmer50@… Owned by: markd@…
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc:
Port: syslog-ng

Description (last modified by jmroot (Joshua Root))

After 'port install' of syslog-ng, syslog-ng shows in /var/log/system.log to attempt respawning:

===
Sep  2 10:27:14 wanx2 org.macports.syslog-ng[107]: Error binding socket; addr='AF_INET(0.0.0.0:514)', error='Address already in use (48)'
Sep  2 10:27:14 wanx2 org.macports.syslog-ng[107]: Error initializing source driver; source='net', id='net#0'
Sep  2 10:27:14 wanx2 org.macports.syslog-ng[107]: Error initializing message pipeline;
Sep  2 10:27:14 wanx2 com.apple.launchd[1] (org.macports.syslog-ng): Throttling respawn: Will start in 10 seconds
===

Changing /opt/local/etc/LaunchDaemons/org.macports.syslog-ng '--pid' line from 'exec' to 'fileauto' and adding '--pidfile=/opt/local/var/syslog-ng.pid' resolves the problem.

Change History (9)

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Description: modified (diff)
Owner: changed from macports-tickets@… to markd@…

Please remember to preview and use WikiFormatting, and to cc the maintainer.

comment:2 Changed 14 years ago by markd@…

Maybe it needs this added:

startupitem.pidfile auto --pidfile=${prefix}/var/syslog-ng.pid

I'm not clear on whether "auto" or "clean" option is correct, I would think "clean".

comment:3 in reply to:  2 Changed 14 years ago by sgilmer50@…

Replying to markd@…:

Maybe it needs this added:

startupitem.pidfile auto --pidfile=${prefix}/var/syslog-ng.pid

I'm not clear on whether "auto" or "clean" option is correct, I would think "clean".

I think you're right about adding startupitem.pidfile. I tested using both auto and clear by changing the startup plist with --pid=fileauto and fileclean and both seemed to work. For both tests I did a 'port unload syslog-ng', modified the plist, and then 'sudo port load syslog-ng' and then killed the syslog-ng process. In both cases syslog-ng was restarted and did logging successfully. I'm guessing that auto works because syslog-ng probably gets rid of an old pid file if it exists.

comment:4 Changed 14 years ago by markd@…

Ok, I added the --pidfile with 'clean' option on revision 1 of the portfile. Seems like maybe that is a safer option? The guide is wrong about --pidfile (and other options?) for startupitem.executable type -that it isn't needed or can't be used or whatever. I wrote it so it is my fault, but that is what I thought at the time. If the revision looks ok to you I can close the ticket. Thanks for the detailed reporting and testing on this.

comment:5 Changed 14 years ago by markd@…

Changes made in r71276.

comment:6 in reply to:  4 Changed 14 years ago by sgilmer50@…

Replying to markd@…:

Ok, I added the --pidfile with 'clean' option on revision 1 of the portfile. Seems like maybe that is a safer option? The guide is wrong about --pidfile (and other options?) for startupitem.executable type -that it isn't needed or can't be used or whatever. I wrote it so it is my fault, but that is what I thought at the time. If the revision looks ok to you I can close the ticket. Thanks for the detailed reporting and testing on this.

The resulting plist from revision 1 ends up with two --pidfile lines. One with just '--pidfile' and another with '--pidfile=/opt/local/var/syslog-ng.pid'. This causes an attempted restart of syslog-ng about every 30 sec. Also, daemondo isn't running. Removing the line with just '--pidfile' fixes the problem.

Looking at the documentation a little closer, it looks like startupitem.pidfile can't be used with executable type startupitems. I wonder whether the port file without specifying startupitem.pidfile would work if syslog-ng placed it's pid file in ${prefix}/var/run rather than ${prefix}/var. I can't think of anything else that might work.

comment:7 Changed 14 years ago by markd@…

Oops. That was my mistake. I accidentally inserted the "--pidfile" in the statement but the keyword does that. I removed it in revision 2. I think the guide may be wrong that it can't be used with startupitem.executable. I saw it was used in the dovecot port (and some others) before I tried it with this one.

See if the revision 2 works for you.

comment:8 in reply to:  7 Changed 14 years ago by sgilmer50@…

Replying to markd@…:

Oops. That was my mistake. I accidentally inserted the "--pidfile" in the statement but the keyword does that. I removed it in revision 2. I think the guide may be wrong that it can't be used with startupitem.executable. I saw it was used in the dovecot port (and some others) before I tried it with this one.

See if the revision 2 works for you.

Revision 2 fixes it. Thanks.

comment:9 Changed 14 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.