[syslog-ng] Trouble configuring elasticsearch2 destination
Fabien Wernli
wernli at in2p3.fr
Tue Jul 3 14:12:36 UTC 2018
On Tue, Jul 03, 2018 at 04:02:32PM +0200, T4iga wrote:
> Hi,
>
> I think ld.so.conf will not work for me. I think I have multiple Java
> versions installed.
> I tried to read up on how to implement this in a unit file. It seems
> extremely
> complicated to fully understand compared to what I need it for.
>
> Would creating a file and setting the environment variable there as
> explained in the first answer here suffice?
> https://unix.stackexchange.com/questions/117467/how-to-permanently-set-environmental-variables
>
> Is this universal amongst distributions using systemd?
I don't see any reference to systemd in the thread you pasted.
Chances are you can use /etc/sysconfig/ or /etc/default.
Just check if you've got the corresponding EnvironmentFile entry in your
systemd unit file. Here's what I have on my system:
$ systemctl cat syslog-ng
# /usr/lib/systemd/system/syslog-ng.service
[Unit]
Description=System Logger Daemon
Documentation=man:syslog-ng(8)
[Service]
Type=notify
ExecStart=/usr/sbin/syslog-ng -F $SYSLOGNG_OPTS -p /var/run/syslogd.pid
ExecReload=/bin/kill -HUP $MAINPID
EnvironmentFile=-/etc/default/syslog-ng
EnvironmentFile=-/etc/sysconfig/syslog-ng
StandardOutput=journal
StandardError=journal
Restart=on-failure
as you can see, either /etc/default/syslog-ng or /etc/sysconfig/syslog-ng can be used to
add the LD environment variable
More information about the syslog-ng
mailing list