[syslog-ng] systemd syslog-ng does not start CentOS 7.2.1511
Scheidler, Balázs
balazs.scheidler at balabit.com
Wed Apr 13 08:50:25 CEST 2016
There are three modes in which syslog-ng can start, "--process-mode
background" is probably the one that best matches other daemons that don't
have their own supervisor (which is not needed as systemd behaves as one).
The funny thing is that I have just tried my local syslog-ng installation
on ubuntu wily, which is systemd based and is working just fine:
$ systemctl status syslog-ng
● syslog-ng.service - System Logger Daemon
Loaded: loaded (/lib/systemd/system/syslog-ng.service; enabled; vendor
preset: enabled)
Active: active (running) since Wed 2016-04-13 08:48:28 CEST; 29s ago
Docs: man:syslog-ng(8)
Main PID: 17470 (syslog-ng)
Memory: 1.4M
CPU: 26ms
CGroup: /system.slice/syslog-ng.service
└─17470 /usr/sbin/syslog-ng -F
Apr 13 08:48:28 bzorp systemd[1]: Starting System Logger Daemon...
Apr 13 08:48:28 bzorp systemd[1]: Started System Logger Daemon.
$ systemctl stop syslog-ng
$ systemctl start syslog-ng
$ syslog-ng -V
syslog-ng 3.5.6
Installer-Version: 3.5.6
Revision: 3.5.6-2build1 [@416d315] (Ubuntu/15.10)
Compile-Date: Jul 29 2015 03:15:39
Available-Modules:
basicfuncs,syslogformat,affile,afprog,afsocket,json-plugin,dbparser,linux-kmsg-format,afmongodb,afsql,afstomp,system-source,redis,confgen,tfgeoip,afsocket-notls,afsocket-tls,csvparser,afsmtp,afuser,cryptofuncs,afamqp
Enable-Debug: off
Enable-GProf: off
Enable-Memtrace: off
Enable-IPv6: on
Enable-Spoof-Source: on
Enable-TCP-Wrapper: on
Enable-Linux-Caps: on
Enable-Pcre: on
$ dpkg -l systemd
Desired=Unknown/Install/Remove/Purge/Hold
|
Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version
Architecture Description
+++-===========================================-==========================-==========================-============================================================================================
ii systemd 225-1ubuntu9.1
amd64 system and service manager
--
Bazsi
On Wed, Apr 13, 2016 at 8:31 AM, Scot Needy <scotrn at gmail.com> wrote:
> Thanks for the response, The -F flag was based on other posts.
> If I remove the -F it does return but systemd keeps restarting it.
>
>
>
>
> On Apr 13, 2016, at 2:23 AM, Scheidler, Balázs <
> balazs.scheidler at balabit.com> wrote:
>
> -F specifies that syslog-ng should stay in the foreground.
>
> I assumed that it was needed for systemd. You could try --process-mode
> background
>
> That causes syslog-ng to go to the background but without its own
> supervisor.
> On Apr 12, 2016 9:00 PM, "Scot Needy" <scotrn at gmail.com> wrote:
>
>>
>>
>> Hi,
>>
>> I need help setting up my control files for systemd I can’t figure out
>> what I am doing wrong. If I make a SystemV start stop script it runs fine.
>> From systemd I think there is something missing in the control files that
>> lets syslog-ng report that is started successfully.
>>
>> When I add -F to SYSLOGNG_OPTS then systemctl start syslog-g.service
>> never returns but syslog-ng does start.
>>
>> Compiled syslog-ng syslog-ng 3.8.0alpha0 no problems.
>> On the command line syslog-ng will start fine.
>> /opt/syslog-ng/sbin/syslog-ng -f /opt/syslog-ng/etc/syslog-ng.conf -p
>> /var/run/syslogd.pid
>>
>>
>> Using contrib/systemd/syslog-ng.service as an example I
>> created /usr/lib/systemd/system/syslog-ng.service
>>
>> [Unit]
>> Description=System Logger Daemon
>> Documentation=man:syslog-ng(8)
>>
>> [Service]
>> Type=notify
>> ExecStart=/opt/syslog-ng/sbin/syslog-ng $SYSLOGNG_OPTS
>> ExecReload=/bin/kill -HUP $MAINPID
>> EnvironmentFile=-/opt/syslog-ng/etc/syslog-ng.env
>> StandardOutput=journal
>> StandardError=journal
>> Restart=on-failure
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>> cat /opt/syslog-ng/etc/syslog-ng.env
>>
>> LD_LIBRARY_PATH=/usr/java/jdk1.8.0_77/jre/lib/amd64/server:$LD_LIBRARY_PATH
>> SYSLOGNG_OPTS="-f /opt/syslog-ng/etc/syslog-ng.conf -p
>> /var/run/syslogd.pid"
>>
>>
>> systemctl daemon-reload
>> systemctl restart systemd-journald
>> systemctl start syslog-ng.service
>> systemctl status syslog-ng.service
>> ● syslog-ng.service - System Logger Daemon
>> Loaded: loaded (/usr/lib/systemd/system/syslog-ng.service; enabled;
>> vendor preset: enabled)
>> Active: inactive (dead) since Tue 2016-04-12 14:51:04 EDT; 29s ago
>> Docs: man:syslog-ng(8)
>> Process: 2494 ExecStart=/opt/syslog-ng/sbin/syslog-ng $SYSLOGNG_OPTS
>> (code=exited, status=0/SUCCESS)
>> Main PID: 2494 (code=exited, status=0/SUCCESS)
>>
>>
>> Apr 12 14:41:08 loghost systemd[1]: Unit syslog-ng.service entered failed
>> state.
>> Apr 12 14:41:08 loghost systemd[1]: syslog-ng.service failed.
>> Apr 12 14:41:08 loghost systemd[1]: syslog-ng.service holdoff time over,
>> scheduling restart.
>> Apr 12 14:41:08 loghost systemd[1]: Starting System Logger Daemon...
>>
>>
>> I can see syslog-ng starting and stoping over and over from
>> /var/log/messages
>>
>>
>>
>>
>> ______________________________________________________________________________
>> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
>> Documentation:
>> http://www.balabit.com/support/documentation/?product=syslog-ng
>> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
>>
>>
>>
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation:
> http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
>
>
>
>
> ______________________________________________________________________________
> Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng
> Documentation:
> http://www.balabit.com/support/documentation/?product=syslog-ng
> FAQ: http://www.balabit.com/wiki/syslog-ng-faq
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.balabit.hu/pipermail/syslog-ng/attachments/20160413/7296b136/attachment.htm
More information about the syslog-ng
mailing list