Allow nocanc to specify a config file

Started by jimh

jimh

Hi Alain,

I have got nocand to run well as a demon process started by system on the raspberry pi. This has been running for the last 4-5 days without problems and I have used logrotate to keep the log files under control.

I would like to start nocanc the same way i.e. via system. To do so it would be really helpful to have a
-config option on nocanc to allow specific config files to be started. Allow the current default to work if the option is not specified by allow the option to override the default if used.

This way I can setup the nocand process and the mqtt and blynk nocanc process to start on boot.

An additional question relating to the config file entries: can the log-file etc options be placed in the config file? This would allow the startup lines in config files for system to shorter.

Best regards,

Jim

Alain

Hi Jim,

The nocand tools uses the configuration file ~/.nocand/config, whereas the nocanc tool uses ~/.nocanc.conf. You can specify a configuration for blynk and MQTT in the same ~/.nocanc.conf configuration file, since there is no overlap between the two services. You can also run multiple instances of nocanc simultaneously.

The nocand tool allows to specify an alternative config file with the -config option, but only when running in server mode. The nocanc tool currently doesn't have a way to specify a config file. This is a feature on our roadmap: it would also help us during testing. However, it might be a couple of months before we release this feature. Another minor problem with the current processing of configuration options is that the configuration file takes priority over command line options, which is not the way most tools work. This also need a fix.

All options from the command line can be specified in the config file, including the 'log-file' stuff.

Best regards,

Alain