I am running syslog-ng
on debian.
How do I check which conf file was loaded upon startup?
Neither
systemctl status syslog-ng
nor
systemctl show syslog-ng
tell me.
By default, syslog-ng loads the configuration from a hard-coded default configuration path (you can check that path with the syslog-ng --help
command, it's next to the --cfgfile
option.
This can be changed via the command line with the mentioned option.
If you want to see all the configuration files loaded recursively (@include
), you can run syslog-ng in debug mode:
$ syslog-ng -Fed
Starting to read include file; filename='/usr/share/syslog-ng/include/scl/sudo/sudo.conf', depth='2'
...
If you want to see the full preprocessed configuration of a running syslog-ng instance, you can query it with the sbin/syslog-ng-ctl config --preprocessed
command.
If you want to ensure that the correct version of the configuration is running in syslog-ng (there might be a newer config on the disk that hasn't been applied yet), you can use the following command:
sbin/syslog-ng-ctl config --verify
Configuration file matches active configuration
You can also get a hash or identifier for similar purposes:
sbin/syslog-ng-ctl config --id
try syslog-ng-ctl config
That should display the currently used configuration (I'm not sure if it displays where it was loaded from)
https://axoflow.com/docs/axosyslog-core/app-man-syslog-ng/syslog-ng-ctl.1/#displaying-the-configuration
/usr/sbin/syslog-ng-ctl config
- apparently not in my path. As you mentioned, it doesn't appear to tell me which file it was loaded from. There is also /usr/sbin/syslog-ng-ctl list-files
, but for me it returns No files available
, even though there is a loaded configuration. Strange...
Commented
May 31 at 0:39