Due to the use of a single entry point for daemon startup, the hades script,
some features of systemd can not be used, e.g. distinction between
ExecStartPre and ExecStart.
Secondly, the configuration of the daemons is quite inconsistent. For some
daemons, we have hades directories, e.g. /var/lib/hades/agent for others we use
the directories of the Debian package, e.g. /var/lib/unbound.
This commit:
Run daemons directly from the systemd unit files without scripts if possible
Split the main hades script into smaller, modular scripts, where scripts are
still needed:
the networking setup is done in a script (control-network.sh)
the database setup is done in a script (control-database.sh)
a library for common functions (functions.sh)
Support additional command actions in the scripts like stop
Have dedicated /run directories and /var/lib directories for every daemon
under /run/hades and /var/lib/hades respectively
Store the ephemeral configuration of the daemons in their /run directory. The
config files are ephemeral and are not meant to be changed by the user.
Storing them under /etc/hades may allude users to changing the files by hand.
The current daemon startup is quite messy.
Due to the use of a single entry point for daemon startup, the hades script, some features of systemd can not be used, e.g. distinction between ExecStartPre and ExecStart.
Secondly, the configuration of the daemons is quite inconsistent. For some daemons, we have hades directories, e.g. /var/lib/hades/agent for others we use the directories of the Debian package, e.g. /var/lib/unbound.
This commit: