[syslog-ng] issues with starting syslog-ng from systemd

Russell Fulton r.fulton at auckland.ac.nz
Thu Nov 19 20:19:06 UTC 2020


version 3.26.1  — ubuntu 14.04

I can start syslog-ng from the command line without issues (apart form a warning to stderr) but when I try and start it from systemd it starts up (it prints the warning message to the logs) and then exits silently.

This version was compiled locally i.e. it was not installed from a package. The .service file was adapted from a sample in the contrib directory. I also had the same behaviour from and other .service file that I put together myself.

It is presumably some to do with the environment.

I did try starting it with -i (interactive) in the hope that it would spit something out on the console but instead it hung and I had to ^C it

Any thoughts on how to figure out what is going on?

=====================================

here are two different attempts (first commented)

rful011 at secmgrprd02:~$ cat /etc/systemd/system/syslog-ng.service 
#[Unit]
#Description=syslog next generation
#After=network.target auditd.service

#[Service]
#EnvironmentFile=/etc/default/syslog-ng
#ExecStart=/usr/local/sbin/syslog-ng -f /usr/local/etc/syslog-ng.conf
#ExecReload=/usr/local/sbin/syslog-ng-ctl reload
#Restart=on-failure
#RestartPreventExitStatus=255
#Type=notify

#[Install]
#WantedBy=multi-user.target
#Alias=syslog-ng.service


[Unit]
Description=System Logger Daemon
Documentation=man:syslog-ng(8)
Conflicts=emergency.service emergency.target
Wants=network.target network-online.target
After=network.target network-online.target

[Service]
Type=notify
EnvironmentFile=-/etc/default/syslog-ng
EnvironmentFile=-/etc/sysconfig/syslog-ng
ExecStart=/usr/local/sbin/syslog-ng -f /usr/local/etc/syslog-ng.conf 
ExecReload=/usr/local/sbin/syslog-ng-ctl reload
StandardOutput=journal
StandardError=journal
Restart=on-failure

[Install]
WantedBy=multi-user.target



More information about the syslog-ng mailing list