Syslog-ng fails to start without optional dependency python

Description:

The python package is currently listed in optdepends for syslog-ng, but attempting to run syslog-ng without python installed produces the following error:

Error parsing config, syntax error, unexpected LL_IDENTIFIER, expecting end of file in /usr/lib/syslog-ng/python/syslogng/modules/hypr/scl/hypr.conf:25:1-25:7:
20      # OpenSSL libraries as published by the OpenSSL project. See the file
21      # COPYING for details.
22      #
23      #############################################################################
24
25----> python {
25----> ^^^^^^
26
27      import syslogng.modules.hypr
28
29      syslogng.modules.hypr.register_hypr_config_generator()
30

Included from /usr/share/syslog-ng/include/scl/python/python-modules.conf:25:1-25:1:

Included from /usr/share/syslog-ng/include/scl.conf:31:1-31:1:
26      #
27
28      @module appmodel
29
30      @include 'scl/*/*.conf'
31---->
31----> ^
32      @define java-module-dir "`module-install-dir`/java-modules"

Included from /etc/syslog-ng/syslog-ng.conf:8:1-8:1:
3       # single file called /var/log/messages.
4       #
5
6       @version: 4.8
7       @include "scl.conf"
8----->
8-----> ^
9       source s_local {
10      	system();
11      	internal();
12      };
13

With python installed the error is not present.

I was looking at the Alpine version of the package, and it seems like they separate the python functionality out into its own package (https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/main/syslog-ng/APKBUILD#L152) -- I can confirm that deleting the files they've separated out from my test chroot also resolves the error:

  • /usr/lib/syslog-ng/libmod-python.so
  • /usr/lib/syslog-ng/python
  • /etc/syslog-ng/python

So like Alpine did, the best route is probably to create a separate syslog-ng-python package that depends on python, replace python in optdepends with syslog-ng-python, and move the other python-related optdepends entries to the new package.

Alternatively, python could simply be made into a full dependency.

Additional info:

  • package version(s): 4.8.1
  • config and/or log files: The error is above, and occurs with or without a config.

Steps to reproduce:

  1. Install syslog-ng and ensure python is not installed (a clean chroot with base, base-devel and syslog-ng is how I tested)
  2. Attempt to start the syslog-ng service or run it directly from the command line

Thanks for your time, and let me know if you need anything else.