troglobit / pimd

PIM-SM/SSM multicast routing for UNIX and Linux
http://troglobit.com/projects/pimd/
BSD 3-Clause "New" or "Revised" License
194 stars 86 forks source link

Refactor command line options #95

Closed troglobit closed 6 years ago

troglobit commented 7 years ago

Since pimd 3.0 will not be fully backwards compatible (see #93), this is a good time to simplify and streamline the command line options. A user which does not read the ChangeLog and notices the change in major number on upgrade, may actually read it if the old options no longer work.

Proposed new usage:

pimd [OPTIONS]

 -f FILE          Configuration file, default uses ident NAME: /etc/pimd.conf
 -d [SYS]         Debug subsystem, see below for valid systems, default all
 -h               Show this help text
 -i NAME          Identity for config + PID file, and syslog, default: pimd
 -l LEVEL         Set log level: none, err, info, notice*, debug
 -n               Run in foreground, do not detach from calling terminal
 -N               Disable all virtual interfaces (phyint) by default
 -p USER[:GROUP]  Drop privs after init
 -P FILE          PID file for signaling pimd, default uses ident: /run/pimd.pid
 -s               Use syslog, default unless running in foreground, -n
 -t ID            Set multicast routing table ID. 
 -v               Show pimd version
troglobit commented 7 years ago

First stage committed in aa7bdfe, probably also remove --long-options.

ipinlnd commented 6 years ago

May I know the reason for this change? I mean, for example, wasn't it easier to just read the routes with a "pimd -r" ? This way we have to run the program in foreground or watch syslog messages. Thanks

troglobit commented 6 years ago

Race conditions and poor design, are the main reasons.

The intention is to add a pimctl tool to interact with a running pimd, similar to how other daemons work.

You can still use signals and look for the status file, which is what pimd -r wrapping anyway.

troglobit commented 6 years ago

Hidden feature request for privilege separation moved to separate issue, #115