Skip to content

babeld: too much options prevent babeld from starting up #33

Closed
zorun opened this Issue Jun 8, 2014 · 10 comments

3 participants

@zorun
zorun commented Jun 8, 2014

When specifying a lot of options in /etc/config/babeld, babeld does not start anymore: "Couldn't parse configuration from command line."

After a bit of debugging, it seems like the command line length is limited in OpenWRT. When specifying too much options, the generated command line is too big and gets cut off, so that we feed babeld with invalid command line arguments.

Experimentally, the maximum length of a command (using the shell) seems to be 510 characters. I guess the same limit is applied to shell scripts, especially since babeld is run through eval.

@kerneis
kerneis commented Jun 8, 2014

Ok, I need to do things properly and finally get rid of this ugly eval hack. It might be worth moving to procd at the same time (see #17).

@kerneis kerneis self-assigned this Jun 8, 2014
@zorun
zorun commented Jun 9, 2014

Maybe generate a config file, like dnsmasq and other packages do?

Since 1.4.2, it is possible to specify absolutely everything in a config file (even the interfaces to operate on)

However, it might be difficult to keep the same semantic regarding /etc/config/babeld and /etc/babeld.conf. Currently, command-line options take precedence over options defined in /etc/babeld.conf, but this is no longer possible if we generate another config file. I'm not sure merging the two config files would be such a great idea, either.

What about a switch in /etc/config/babeld specifying either "use the uci-based config" or "use native babeld.conf"?

@jech
jech commented Jul 2, 2014

Wouldn't it be simpler to allow multiple instances of -c on the babeld command line? Now's the right time to submit a patch to do that, since I'll be more reluctant to release a 1.5.1 after we've merged Matthieu's work.

@jech
jech commented Jul 2, 2014

Done upstream. Gabriel, please let me know when you want me to release 1.5.1 with the change.

@jech
jech commented Jul 4, 2014

1.5.1 has been released.

@zorun
zorun commented Aug 28, 2014

I am currently reworking the init script to generate a config file, which turns out to be less straightforward than expected.

By the way, options in the openwrt config do not have the same name as babeld options. This is because the openwrt options are actually older than the new options in babeld 1.4.2 and above. I am using the new option names (since this is much clearer and simpler to parse), but I will map the old option names to keep backward compatibility of configuration files.

@kerneis
@zorun
zorun commented Aug 28, 2014

I probably missed that renaming of options, I'm not sure what you are talking about. The only generic caveat about option names that I remember is the dash/underscore substitution made necessary by UCI.

No option has been renamed in babeld. A whole bunch of new options have been added in babeld 1.4.2, so that everything can be configured through a configuration file (no need for command-line switches). For instance, "random_router_id" in the openwrt config, which currently uses the "-r" flag, can now (1.4.2) be configured through the "random-id" option in babeld.

@jech
jech commented Aug 28, 2014
@zorun zorun pushed a commit to zorun/packages that referenced this issue Aug 29, 2014
Baptiste Jonglez babeld: Generate a configuration file instead of passing cmdline argu…
…ments

This is the first step toward fixing issue #33.

This still lacks some features:

- no support for "ignore" options
- no backward compatibility for option names
- no support for default interface options
f81d53f
@zorun
zorun commented Aug 30, 2014

What options exactly?

The new version does not use any command-line argument, and is fairly generic regarding options (options are just copied to babeld.conf, replacing _ by -). So it should not matter much, except that removing options often confuses users :)

@zorun zorun referenced this issue Aug 30, 2014
Merged

Updates to babeld #47

@kerneis kerneis closed this in #47 Sep 1, 2014
@zorun zorun pushed a commit that referenced this issue Sep 3, 2014
Baptiste Jonglez babeld: Generate a configuration file instead of passing cmdline argu…
…ments

This is the first step toward fixing issue #33.

This still lacks some features:

- no support for "ignore" options
- no backward compatibility for option names
- no support for default interface options
20004f0
@cjkoenig cjkoenig added a commit to cjkoenig/routing-packages that referenced this issue Sep 3, 2014
Baptiste Jonglez babeld: Generate a configuration file instead of passing cmdline argu…
…ments

This is the first step toward fixing issue #33.

This still lacks some features:

- no support for "ignore" options
- no backward compatibility for option names
- no support for default interface options
8bebfee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.