[syslog-ng] syslog-ng and systemd

Balazs Scheidler bazsi at balabit.hu
Sat Apr 30 22:47:43 CEST 2011


On Thu, 2011-04-28 at 10:41 +0200, Matthias Runge wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello users,
> 
> Fedora 15 (and later) uses systemd as init-replacement.
> Currently, I'm building a fedora package for syslog-ng version 3.2.x.
> 
> It is based on a git-snapshot dated April 24th. Is there a way to signal
> syslog-ng to reload it's configuration other than HUPing its pid?
> 
> The documentation of systemd[1] says:
> 
> ExecReload= should be specified for all services supporting reload. It
> is highly recommended to add code here that synchronously reloads the
> configuration file here (i.e. /bin/kill -HUP $MAINPID is usually a poor
> choice, due to its asynchronous nature). Omit this option if your
> service does not support reloading.
> 
> I would highly appreciate not to maintain a pidfile. Newer linux kernels
> support so called cgroups. Those can be used to group processes. Systemd
> creates a cgroup for each service and starts in our case syslog-ng in
> this cgroup. When no process runs in syslog-ng cgroup, the process
> exited and must be restarted. systemd takes care of this.
> 
> Again, is there any other way to signal syslog-ng to reload its config?

I've just pushed the following patch to the just-opened syslog-ng 3.4
repository. It should apply quite cleanly to older releases as well, but
I've just announced a feature-freeze for 3.3, therefore I don't want to
push it there.

NOTE: this doesn't wait until syslog-ng finishes, only initiates a
reload. It meets your request to avoid the use of PID files, but still,
even better would be to wait and report back with the result, which is
not impossible, but much more difficult to do.

commit 48cf69a28f5aaf9c3397cd0dc5e3f9b66a24683e
Author: Balazs Scheidler <bazsi at balabit.hu>
Date:   Sat Apr 30 22:45:37 2011 +0200

    syslog-ng-ctl: add command to "reload" syslog-ng
    
    This patch adds a "reload" subcommand to syslog-ng-ctl which initiates a
    reload without a SIGHUP.
    
    Requested-By: Matthias Runge <mrunge at matthias-runge.de>
    Signed-off-by: Balazs Scheidler <bazsi at balabit.hu>


-- 
Bazsi




More information about the syslog-ng mailing list