I spent hours to understand why I had all my bacula (sd, fd and dir) services considered as crashed. Port number is hardcoded in the pid filename in init scripts: # grep pidfile /etc/init.d/bacula* /etc/init.d/bacula-dir:pidfile=/var/run/bacula-dir.9101.pid /etc/init.d/bacula-fd:pidfile=/var/run/bacula-fd.9102.pid /etc/init.d/bacula-sd:pidfile=/var/run/bacula-sd.9103.pid So, if you change thoses ports, all the services are considered as crashed, even if all is ok # grep "[Pp]ort =" /etc/bacula/bacula-{fd,sd,dir}.conf /etc/bacula/bacula-fd.conf: FDport = 19102 /etc/bacula/bacula-sd.conf: SDPort = 19103 /etc/bacula/bacula-dir.conf: DIRport = 19101 # rc-status | grep bacula bacula-fd [ crashed ] bacula-sd [ crashed ] bacula-dir [ crashed ] # sed -i 's/91/191/g' /etc/init.d/bacula* # openrc * Caching service dependencies ... [ ok ] * Starting bacula-fd ... [ ok ] * Starting bacula-sd ... [ ok ] * Starting bacula-dir ... [ ok ] # rc-status | grep bacula bacula-fd [ started ] bacula-sd [ started ] bacula-dir [ started ]
Normally you do not need to change the default ports for baculas different parts. It seems especially weird as even /etc/services have them listed. Anyway after checking how other distros handles the problem it seems that at least ubuntu and suse have the portnumbers also hardcoded in pid-filename or start/stop scripts. That enables it to run bacula components more than once on the same server. But you are right, that you have to adapt the start/stop script is not quite easy to find out. I will not change the behaviour but add some comments to bacula-{dir|sd|fd}.conf files to point to the additional needed change of the start/stop scripts.
If you have several stations behind a router, I don't think you have much choice other than to use several different ports for the same service (apart from a VPN). This is the freedom of free software. And then, whatever the reason, if the port is configurable in the bacula configuration, it is because I may have to change it, for whatever reason I like.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cd534404378c3efa83fb42d45e6836cd1be7bc4 commit 9cd534404378c3efa83fb42d45e6836cd1be7bc4 Author: Thomas Beierlein <tomjbe@gentoo.org> AuthorDate: 2023-11-10 10:03:46 +0000 Commit: Thomas Beierlein <tomjbe@gentoo.org> CommitDate: 2023-11-10 10:07:41 +0000 app-backup/bacula: Add comment When changing port numbers of baculas components one needs to adapt the pidfile naming in init.d scripts. Add a comment to emphasize this. Thanks chris@novazur.fr for pointing to the problem. Closes: https://bugs.gentoo.org/915613 Signed-off-by: Thomas Beierlein <tomjbe@gentoo.org> app-backup/bacula/bacula-11.0.6-r4.ebuild | 5 +++++ app-backup/bacula/bacula-11.0.6-r5.ebuild | 5 +++++ app-backup/bacula/bacula-13.0.2-r2.ebuild | 5 +++++ app-backup/bacula/bacula-13.0.3-r1.ebuild | 5 +++++ app-backup/bacula/files/newscripts/bacula-dir.initd | 4 +++- app-backup/bacula/files/newscripts/bacula-fd.initd | 3 ++- app-backup/bacula/files/newscripts/bacula-sd.initd | 4 +++- 7 files changed, 28 insertions(+), 3 deletions(-)