Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] cnofig file theory, standard approach

In the pkgsrc-wip entry for mosquitto, there is a patch to the default
config file, setting the default port explicitly and changing logging.
Before I can assess if those make sense, I want to understand normal
config file practice.

The example config file is very large, but every line is commented or
blank.  mosquitto.conf(8) indicates that it will use default values, and
presumably those match exactly the example.

So, I conclude that the config file should not be installed in
${PREFIX}/etc/, as 1) no config file is equivalent to 1K lines of
comments, 2) a config file with a few settings that are intended is both
easier to understand and easier to maintain as there are no explicit
merge conflicts.

By default, pid_file is blank, and logging is stderr.  These both seem
off for what feels like the standard approach, which is to start a
single global mosquitto instance as root, which drops privs to the
username mosquitto.  I would expect this to write a pidfile (as root,
before dropping) so that the service management system, whatever that
is, can signal mosquitto to exit.  And to remove this on exit, which I
realize doesn't quite go with priv dropping, but it seems
/var/run/foo.pid is overwhelming owned by root, even for programs that
do implement priv dropping.

Is this indeed what's normal, and does everyone have to configure it?
If so, it seems I should be installing a config file for use which has
these few settings, but it also seems these should be the default.

A further query is that it seems like the command-line args are
backwards in that not daemonizing is default, but I realize it's too
hard to change that and it doesn't really matter.

(Part of my questions may be coming at this from Unix daemon norms, not
knowing Windows norms.)


Back to the top