Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pragma module-dependency for optional include #1956

Merged
merged 2 commits into from
Apr 17, 2018

Conversation

Kokan
Copy link
Collaborator

@Kokan Kokan commented Apr 2, 2018

A lot of scl has a hidden dependency for modules to be present. In case of that scl uses a plugin, that is not installed; the syslog-ng is not going to start up even if that specific block is not used in the configuration (but only included).

One of the most common example is the json, if the json module is not installed, with the default set of scls syslog-ng is not going to start. There are two main workaround exists for this:

  • install the module
  • remove the scl file

This PR aim to give a solution by creating a new pragma keyword, which can specify module requirement. If the requirement is not specified the syslog-ng is going to skip the current file, thus not causing an issue in case of missing module.

Fixes #827.

@kira-syslogng
Copy link
Contributor

success

@Kokan Kokan force-pushed the pragma-mod-dep branch 2 times, most recently from f40646c to 8b93eb2 Compare April 5, 2018 08:04
@Kokan Kokan changed the title [WIP] pragma require module for optional include [WIP] pragma module-dependency for optional include Apr 5, 2018
@kira-syslogng
Copy link
Contributor

failure

@kira-syslogng
Copy link
Contributor

success

@kira-syslogng
Copy link
Contributor

success

@Kokan Kokan changed the title [WIP] pragma module-dependency for optional include pragma module-dependency for optional include Apr 15, 2018
@@ -34,6 +34,7 @@ static CfgLexerKeyword pragma_keywords[] =
{ "include", KW_INCLUDE, },
{ "module", KW_MODULE, },
{ "define", KW_DEFINE, },
{ "module_dependency", KW_MODULE_DEPENDENCY, },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we call it @requires or similar? That would mean some analogy to php, ruby or emacslisp :)

@furiel
Copy link
Collaborator

furiel commented Apr 16, 2018

I do not have comment to the code itself. Just a little question on the naming. Apart from that, approve from my side.

Copy link
Collaborator

@lbudai lbudai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename module-dependency to requires as @furiel suggested. I think he is right :)

@lbudai
Copy link
Collaborator

lbudai commented Apr 16, 2018

... and thanks for the PR !

kokan added 2 commits April 16, 2018 14:39
Signed-off-by: kokan <peter.kokai@balabit.com>
Signed-off-by: kokan <peter.kokai@balabit.com>
@kira-syslogng
Copy link
Contributor

success

Copy link
Collaborator

@furiel furiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@lbudai
Copy link
Collaborator

lbudai commented Apr 17, 2018

@furiel : thanks!

@lbudai lbudai merged commit 3067905 into syslog-ng:master Apr 17, 2018
@bazsi
Copy link
Collaborator

bazsi commented Apr 18, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants