Skip to content

Commit

Permalink
contrib/systemd/syslog-ng@service: added templated service file
Browse files Browse the repository at this point in the history
contrib/systemd/syslog-ng@default: added template parameter file
contrib/systemd/syslog-ng.service: removed old service file

    * introduced multi-instance support to systemd service file
    * WARNING: packaging/installer scripts will have to be updated
    * parameter files have to be installed to /etc/default or
      /etc/sysconfig
    * parameter file have to be named like: syslog-ng@instancename
    * service installation looks like: systemctl enable syslog-ng@default
    * service template has to be installed to /usr/lib/systemd/system

Signed-off-by: Janos SZIGETVARI <jszigetvari@gmail.com>
  • Loading branch information
jszigetvari committed Jul 10, 2017
1 parent c6bf2e2 commit 649d115
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 18 deletions.
5 changes: 3 additions & 2 deletions contrib/Makefile.am
Expand Up @@ -70,10 +70,11 @@ EXTRA_DIST += \
contrib/balabit-initscripts/init-functions \
\
contrib/upstart/syslog-ng.conf.upstart \
contrib/systemd/syslog-ng.service \
contrib/systemd/syslog-ng@.service \
contrib/systemd/syslog-ng@default \
\
contrib/valgrind/syslog-ng.supp

if ENABLE_SYSTEMD_UNIT_INSTALL
systemdsystemunit_DATA = contrib/systemd/syslog-ng.service
systemdsystemunit_DATA = contrib/systemd/syslog-ng@.service
endif
16 changes: 0 additions & 16 deletions contrib/systemd/syslog-ng.service

This file was deleted.

17 changes: 17 additions & 0 deletions contrib/systemd/syslog-ng@.service
@@ -0,0 +1,17 @@
[Unit]
Description=System Logger Daemon "%i" instance
Documentation=man:syslog-ng(8)
Conflicts=emergency.service emergency.target

[Service]
Type=notify
EnvironmentFile=-/etc/default/syslog-ng@%i
EnvironmentFile=-/etc/sysconfig/syslog-ng@%i
ExecStart=/usr/sbin/syslog-ng -F $OTHER_OPTIONS --cfgfile $CONFIG_FILE --control $CONTROL_FILE --persist-file $PERSIST_FILE --pidfile $PID_FILE
ExecReload=/bin/kill -HUP $MAINPID
StandardOutput=journal
StandardError=journal
Restart=on-failure

[Install]
WantedBy=multi-user.target
5 changes: 5 additions & 0 deletions contrib/systemd/syslog-ng@default
@@ -0,0 +1,5 @@
CONFIG_FILE=/etc/syslog-ng.conf
PERSIST_FILE=/var/lib/syslog-ng/syslog-ng.persist
CONTROL_FILE=/var/lib/syslog-ng/syslog-ng.ctl
PID_FILE=/var/run/syslog-ng.pid
OTHER_OPTIONS="--enable-core"

0 comments on commit 649d115

Please sign in to comment.