syslog-ng 3.1.2 - Changing location of syslog-ng.pid file causes problems
We are running Solaris 10 Update 9, syslog-ng 3.1.2 - version details at bottom of this msg. I wanted the syslog-ng.pid file to be located in swap so it would be cleared after a reboot. I also did not like the idea of creating the /usr/local/var/run directories, so: I modified the /lib/svc/method file and then validated and imported the syslog-ng.xml file. I stopped/disabled the syslog-ng process to make this change. So now, I have 3 problems, but syslog-ng is running, and I can't imagine how:)). 1. I cannot find the 2 files syslog-ng.pid or syslog-ng.ctl files anywhere on the system. I did a global find which searches the entire disk. 2. When syslog-ng started up, I got the following msg, and it is true: Error opening control socket, bind() failed; socket='/usr/local/var/syslog-ng.ctl', error='No such file or directory. 3. Before I made the change, a ps was showing: root 5769 1 7 7 0 Apr 21 ? 0:00 /usr/local/sbin/syslog-ng root 5770 5769 5770 5770 13 Apr 21 ? 5618:33 /usr/local/sbin/syslog-ng cat /usr/local/var/syslog-ng.pid 5770 As you can see, the PID is 5770. Shouldn't that be 5769?? ******End of 3 questions ******** I have this same version of syslog-ng on another server, but I have not yet changed the location of the syslog-ng.pid file. The change I made was FROM: PIDFILE=$SYSLOGNG_PREFIX/var/run/syslog-ng.pid TO: PIDFILE=/var/run/syslog-ng.pid The config part of the method file is now: #SYSLOGNG_PREFIX=/opt/syslog-ng SYSLOGNG_PREFIX=/usr/local SYSLOGNG="$SYSLOGNG_PREFIX/sbin/syslog-ng" CONFFILE=$SYSLOGNG_PREFIX/etc/syslog-ng.conf PIDFILE=/var/run/syslog-ng.pid SYSLOGPIDFILE=/var/run/syslog.pid OPTIONS= MAXWAIT=30 [root] # syslog-ng -V syslog-ng 3.1.2 Installer-Version: 3.1.2 Revision: ssh+git://bazsi@git.balabit //var/scm/git/syslog-ng/syslog-ng-ose--mainline--3.1#master#8bf13c304b6ab5fc1a372b49d55c78370efe14ca Compile-Date: Oct 25 2010 23:56:18 Enable-Threads: off Enable-Debug: off Enable-GProf: off Enable-Memtrace: off Enable-Sun-STREAMS: on Enable-Sun-Door: on Enable-IPv6: on Enable-Spoof-Source: on Enable-TCP-Wrapper: off Enable-SSL: on Enable-SQL: off Enable-Linux-Caps: off Enable-Pcre: on [root@ecrsyslg00/usr/local]#
Zeek Anow <zeekstern@gmail.com> writes:
We are running Solaris 10 Update 9, syslog-ng 3.1.2 - version details at bottom of this msg.
I wanted the syslog-ng.pid file to be located in swap so it would be cleared after a reboot. I also did not like the idea of creating the /usr/local/var/run directories, so:
I modified the /lib/svc/method file and then validated and imported the syslog-ng.xml file. I stopped/disabled the syslog-ng process to make this change.
So now, I have 3 problems, but syslog-ng is running, and I can't imagine how:)).
1. I cannot find the 2 files syslog-ng.pid or syslog-ng.ctl files anywhere on the system. I did a global find which searches the entire disk.
2. When syslog-ng started up, I got the following msg, and it is true: Error opening control socket, bind() failed; socket='/usr/local/var/syslog- ng.ctl', error='No such file or directory.
3. Before I made the change, a ps was showing: root 5769 1 7 7 0 Apr 21 ? 0:00 /usr/local/sbin/syslog-ng root 5770 5769 5770 5770 13 Apr 21 ? 5618:33 /usr/local/sbin/syslog-ng
cat /usr/local/var/syslog-ng.pid 5770
As you can see, the PID is 5770. Shouldn't that be 5769??
The problem is, according to the error message you quoted above, is that syslog-ng is trying to put its pidfile and the control socket to the location that was specified at build time. To override that, you can change the method file to actually pass the $PIDFILE to syslog-ng. It seems to me, that it doesn't do that, and only uses the PIDFILE option for itself. If you change the syslog-ng invocation in that method file to run syslog-ng with the -p $PIDFILE and -c /path/to/syslog-ng.ctl parameters, that should do the trick. If you're using the method file that comes with syslog-ng, then if you add the two parameters I mentioned earlier to the OPTIONS variable, that should do just what you want. -- |8]
Thanks alot Gergely!! I really appreciate the response. I am using the example file and see the OPTIONS variable. The -p option is valid, but the -c option does not appear to be. I checked in the syslog-ng Open Source Edition 3.1 Administrator Guide and the man page. There is a -C for the chroot directory, but I don't think that is what you are referring to. Course it is always possible the documentation is not updated. Have you used the -c before? Also, any thoughts as to why I cannot find the syslog-ng.pid file anywhere on the system? All of the startup/shutdown scripts use it and syslog-ng is running. This really has me scratching my head:)) Thanks!! On Mon, Apr 25, 2011 at 3:08 PM, Gergely Nagy <algernon@balabit.hu> wrote:
Zeek Anow <zeekstern@gmail.com> writes:
We are running Solaris 10 Update 9, syslog-ng 3.1.2 - version details at bottom of this msg.
I wanted the syslog-ng.pid file to be located in swap so it would be cleared after a reboot. I also did not like the idea of creating the /usr/local/var/run directories, so:
I modified the /lib/svc/method file and then validated and imported the syslog-ng.xml file. I stopped/disabled the syslog-ng process to make this change.
So now, I have 3 problems, but syslog-ng is running, and I can't imagine how:)).
1. I cannot find the 2 files syslog-ng.pid or syslog-ng.ctl files anywhere on the system. I did a global find which searches the entire disk.
2. When syslog-ng started up, I got the following msg, and it is true: Error opening control socket, bind() failed; socket='/usr/local/var/syslog- ng.ctl', error='No such file or directory.
3. Before I made the change, a ps was showing: root 5769 1 7 7 0 Apr 21 ? 0:00 /usr/local/sbin/syslog-ng root 5770 5769 5770 5770 13 Apr 21 ? 5618:33 /usr/local/sbin/syslog-ng
cat /usr/local/var/syslog-ng.pid 5770
As you can see, the PID is 5770. Shouldn't that be 5769??
The problem is, according to the error message you quoted above, is that syslog-ng is trying to put its pidfile and the control socket to the location that was specified at build time.
To override that, you can change the method file to actually pass the $PIDFILE to syslog-ng. It seems to me, that it doesn't do that, and only uses the PIDFILE option for itself.
If you change the syslog-ng invocation in that method file to run syslog-ng with the -p $PIDFILE and -c /path/to/syslog-ng.ctl parameters, that should do the trick.
If you're using the method file that comes with syslog-ng, then if you add the two parameters I mentioned earlier to the OPTIONS variable, that should do just what you want.
-- |8]
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
Zeek Anow <zeekstern@gmail.com> writes:
Thanks alot Gergely!! I really appreciate the response.
I am using the example file and see the OPTIONS variable. The -p option is valid, but the -c option does not appear to be. I checked in the syslog-ng Open Source Edition 3.1 Administrator Guide and the man page. There is a -C for the chroot directory, but I don't think that is what you are referring to. Course it is always possible the documentation is not updated. Have you used the -c before?
Truth be told, I checked the options on 3.3 (the current development version), and did not verify that -c exists on 3.1. You're correct though, that it's not the same as -C: -c would work similarly to -p, except it'd override the path of the control socket, not that of the pidfile.
Also, any thoughts as to why I cannot find the syslog-ng.pid file anywhere on the system? All of the startup/shutdown scripts use it and syslog-ng is running. This really has me scratching my head:))
The reason you can't find the pidfile is because without -p, syslog-ng will try to create it at the default location, which does not exist: thus, creating the pidfile will fail. But that's not a fatal error, so syslog-ng will continue running. If -c does not exist in 3.1, then your best bet is either upgrading to 3.2.2 (the latest stable version), or recompiling 3.1 with the appropriate configure flags (./configure --help should give you enough hints, I believe), so that the pidfile & the control socket would end up in the appropriate directories. -- |8]
That makes sense about the PIDFILE. I am using the SunFreeware version and did not compile it. I don't have a test system available right now. I was hoping that the documentation was wrong and that the -c was in 3.1.2:)) I don't guess there is a way to find out without the source other than to just try it. The worse that can happen is that it either doesn't come up or pukes out an error msg. Thanks for your help Gergely!! Regards, Zeek On Tue, Apr 26, 2011 at 11:26 AM, Gergely Nagy <algernon@balabit.hu> wrote:
Zeek Anow <zeekstern@gmail.com> writes:
Thanks alot Gergely!! I really appreciate the response.
I am using the example file and see the OPTIONS variable. The -p option is valid, but the -c option does not appear to be. I checked in the syslog-ng Open Source Edition 3.1 Administrator Guide and the man page. There is a -C for the chroot directory, but I don't think that is what you are referring to. Course it is always possible the documentation is not updated. Have you used the -c before?
Truth be told, I checked the options on 3.3 (the current development version), and did not verify that -c exists on 3.1. You're correct though, that it's not the same as -C: -c would work similarly to -p, except it'd override the path of the control socket, not that of the pidfile.
Also, any thoughts as to why I cannot find the syslog-ng.pid file anywhere on the system? All of the startup/shutdown scripts use it and syslog-ng is running. This really has me scratching my head:))
The reason you can't find the pidfile is because without -p, syslog-ng will try to create it at the default location, which does not exist: thus, creating the pidfile will fail. But that's not a fatal error, so syslog-ng will continue running.
If -c does not exist in 3.1, then your best bet is either upgrading to 3.2.2 (the latest stable version), or recompiling 3.1 with the appropriate configure flags (./configure --help should give you enough hints, I believe), so that the pidfile & the control socket would end up in the appropriate directories.
-- |8]
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
Zeek Anow <zeekstern@gmail.com> writes:
That makes sense about the PIDFILE. I am using the SunFreeware version and did not compile it. I don't have a test system available right now. I was hoping that the documentation was wrong and that the -c was in 3.1.2:)) I don't guess there is a way to find out without the source other than to just try it. The worse that can happen is that it either doesn't come up or pukes out an error msg.
I just checked the sources, and 3.1.2 should have -c, despite the admin guide not mentioning it. -- |8]
Fantastic!! Thanks, I owe you one!! On second thought, it might be 2 or 3:)) Really appreciate your help. On Tue, Apr 26, 2011 at 5:46 PM, Gergely Nagy <algernon@balabit.hu> wrote:
Zeek Anow <zeekstern@gmail.com> writes:
That makes sense about the PIDFILE. I am using the SunFreeware version and did not compile it. I don't have a test system available right now. I was hoping that the documentation was wrong and that the -c was in 3.1.2:)) I don't guess there is a way to find out without the source other than to just try it. The worse that can happen is that it either doesn't come up or pukes out an error msg.
I just checked the sources, and 3.1.2 should have -c, despite the admin guide not mentioning it.
-- |8]
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.campin.net/syslog-ng/faq.html
participants (2)
-
Gergely Nagy
-
Zeek Anow