Req: (Linux) odriveagent enhancements

  • odriveagent -h to do the expected.

  • odriveagent to do some minimal logging, e.g. started & status, stopping. Logging automatically turned on to /var/log/odriveagent.log unless specified differently. Therefore command line argument for log location. Including paying attention to environment variables, and so documented. e.g. odriveagentlogdir=/var/log && nohup odriveagent 2>&1 >> /var/log/odriveagent.log & [Yes, that’s deliberately redundant so replies can explain.]

  • alternately, log to syslog, but provide cmd line arguments for facility, etc.

= although odriveagent may not actually spit anything out (normally), when one is looking for why things aren’t working as expected, one is also looking for things that say “I’m healthy and happy.” The above would help with that.

  • create a man page, include links to documentation / best practices. Although very brief, such is positive reinforcement rather than negative reinforcement. (Yes, I must be doing things right. No, there is nothing here as an element to squishing whatever problem one is running in to.)

  • indicate therein the appropriate way to start odriveagent at boot.

No doubt others can expand or refine these points.

2 Likes

Also … REALLY IMPORTANT … document / create a pidfile.

So scripts can include an equivalent of ‘if not exists odriveagent.pidfile start odriveagent’

And a --singleinstanceonly parameter (default), which has more to do with proving a negative / reassuring the user, than anything else.

2 Likes

Yes, an example would be helpful. I’ve done this many times with other programs and services but can’t seem to get this one to stick.

1 Like