Conversation
…ame of the config file
…m dry_run since it's not useful for this daemon
oliviertilmans
left a comment
There was a problem hiding this comment.
Thanks for the PR.
This one is a bit tedious, since it is introducing another PIM daemon beside the FRR one.
@jadinm will certainly more thoughts on this.
| @@ -1,23 +0,0 @@ | |||
| hostname ${node.name} | |||
There was a problem hiding this comment.
Please revert this.
This file configures the FRR pimd, and as such cannot be erased by this commit.
|
|
||
| @property | ||
| def dry_run(self): | ||
| return 'echo 2BeOrNot2Be > /dev/null' |
There was a problem hiding this comment.
A more general solution would be to make this return an empty string/None, and then update the global dry_run callsite to check for these empty/None string (i;e., "if d.dry_run: ... else: log.warning('Cannot check the config validity of daemon %s', d.Name'))
This problem is bound to happen on more than one daemon...
| @@ -0,0 +1,35 @@ | |||
| from .base import RouterDaemon | |||
|
|
|||
| class Pimd(RouterDaemon): | |||
There was a problem hiding this comment.
Please rename this something less ambiguous, given that 'PIMD' already exists...
| """ This class configure the pim Daemon which can be found here: | ||
| https://github.com/troglobit/pimd | ||
| """ | ||
| NAME = 'pimd' |
There was a problem hiding this comment.
Same than above, define a more specific name.
There was a problem hiding this comment.
The issue here is that if I put a more specific name, for example 'pimd_troglobit' I got the following error:
RuntimeError: [pimd_troglobit] is not available in $PATH
| # Fire up all daemons | ||
| for d in self.nconfig.daemons: | ||
| self._processes.popen(shlex.split(d.startup_line)) | ||
| if (hasattr(d,'logfile')): |
There was a problem hiding this comment.
This feature should always be there, and not only for the daemons have a logfile attribute.
I'd suggest to always log stderr/stdout of all daemons, e.g.,
- Create a temp logdir using daemon_logs tempfile.TemporaryDirectory(dir='tmp')
- display it on the global logger
- capture stdout/stderr for all daemon, e.g. stderr='%s/%s_%s_err.log' % (daemon_log, node, daemon_name)
|
yes it's a bit tedious but this is based on a suggestion on prof. Bonaventure. |
|
Something that could work would be to detect at runtime which pimd is present on the system in the Main 'PIMD' daemon (e.g., through the 'pimd --version' output), and then override Another possibility would be to have both daemon installed on the host (i.e., /opt/frr/... pimd, and /opt/pimd_troglobit/... pimd), and then prepend $PATH when starting them to select the right binary. Similarly, you could update the install script to enable/disable FRR's PIMD (see https://github.com/FRRouting/frr/blob/master/configure.ac#L532) and optionally install this one. |
the possibilities to specify a filename where the daemon should output stderr was added.
This can be done by giving a path to the variable log_file when adding the daemon.
This is useful because in the case of the pimd daemon, there is no dry_run since this daemon does not offer the possibility to check his config file. Like that user can easily find the stderr output in a file and check if all goes well or not.