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

Add a command line option to verify configuration and exit #100

Closed
thedrow opened this issue Aug 26, 2018 · 10 comments
Closed

Add a command line option to verify configuration and exit #100

thedrow opened this issue Aug 26, 2018 · 10 comments
Milestone

Comments

@thedrow
Copy link
Contributor

thedrow commented Aug 26, 2018

It would be useful for our CI process to be able to verify the configuration of smcrouted.
Would you accept a PR that adds a command line option to smcrouted that says only verify configuration and exit?

@troglobit
Copy link
Owner

Sure, I've done something similar for troglobit/inadyn@fd3ef93, so that would be great. How deep are you planning to go, verify interface names and group addresses, or just syntax?

@thedrow
Copy link
Contributor Author

thedrow commented Aug 26, 2018

I thought about simply calling conf_parse(), so whatever it does is fine with me.
We can add more functionality later on right?

@thedrow
Copy link
Contributor Author

thedrow commented Aug 26, 2018

Is -C acceptable as a command line option?

@troglobit
Copy link
Owner

Sounds reasonable, we can add more functionality later.

Hmm, -C is OK I guess, but what do you think about this?

    ...
#ifdef ENABLE_DOTCONF
               "  -f FILE         Set configuration file, default uses ident NAME: %s\n"
               "  -F FILE         Check configuration file syntax, -l LVL to increase verbosity\n"
#endif
    ...

@thedrow
Copy link
Contributor Author

thedrow commented Aug 26, 2018

Also acceptable.
conf_parse() is not part of the header right now. Are you planning to change the signature or can we make it "public"?

@troglobit
Copy link
Owner

Go ahead and change what you need. Personally I might've refactored conf_read() a bit instead, e.g. moved the access() check and error handling to conf_parse(), but it's up to you :-)

@troglobit
Copy link
Owner

Any progress on this?

@thedrow
Copy link
Contributor Author

thedrow commented Sep 10, 2018

I haven't had the chance to reach this yet. You'll see a PR once I will.
I hope it will be soon.

@troglobit
Copy link
Owner

OK, just checking :)

@troglobit troglobit added this to the v2.5 milestone Oct 26, 2018
@troglobit
Copy link
Owner

@thedrow Hi again. I just added a very simple .conf verifyer for the upcoming v2.5 release. I'll see what I can do about making it a bit more strict; error (return 1) on malformed directives and warn on unknown directives.

troglobit added a commit that referenced this issue Mar 19, 2019
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
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

No branches or pull requests

2 participants