The Bacula director cannot be started using systemd: # systemctl start bacula-dir Job for bacula-dir.service failed. See 'systemctl status bacula-dir.service' and 'journalctl -xn' for details. Journalctl -xn says: Failed at step EXEC spawning /usr/sbin/bacula-dir: Permission denied Systemd tries to execute /usr/sbin/bacula-dir as user 'bacula' (as configured in systemd unit file) but the permissions do not allow this: # ls -la /usr/sbin/bacula-dir -rwxr-x--- 1 root root 516128 12. Mär 20:52 /usr/sbin/bacula-dir My workaround is chmod o+rx /usr/sbin/bacula-dir After this, bacula-dir starts successfully. Reproducible: Always
The problem is not really in systemd side because the value for user comes from: --with-dir-user=bacula configure switch that is passed in src_configure :/
(In reply to Pacho Ramos from comment #1) > The problem is not really in systemd side because the value for user comes > from: > --with-dir-user=bacula > > configure switch that is passed in src_configure :/ Hmm. Very good question here. That switch got changed back in 2006 (version 1.36.3-r3) from --with-dir-user=root to the actual value. No comments about that found in CVS or bugzilla. Normally bacula-dir gets still started as user=root, group=bacula (see conf.d/bacula-dir) so maybe it was just a typo. But let me check the sources to get an idea about possible consequences of changing it back to 'root'
(In reply to Thomas Beierlein from comment #2) > (In reply to Pacho Ramos from comment #1) > > The problem is not really in systemd side because the value for user comes > > from: > > --with-dir-user=bacula > > > > configure switch that is passed in src_configure :/ > > Hmm. Very good question here. > > That switch got changed back in 2006 (version 1.36.3-r3) from > --with-dir-user=root to the actual value. No comments about that found in > CVS or bugzilla. > > Normally bacula-dir gets still started as user=root, group=bacula (see > conf.d/bacula-dir) so maybe it was just a typo. But let me check the sources > to get an idea about possible consequences of changing it back to 'root' No, it seems not to be only a typo. At the same time pkg_postinst() got changed to chown /var/lib/bacula to bacula:bacula. Still we have to find out why.
Bug is still present in app-backup/bacula-7.0.5-r1
During fix of bug 582442 I did some more historical digging up. The change to --with-dir-user=bacula mentioned in comment 1 was introduced by a point in baculas manual "Running bacula as non-root user". As it showed up in bug 125729 shortly after it did not work. To fix the bug the /etc/conf.d/bacula-dir got changed to start bacula-dir as root:bacula again. So from this time on all ebuilds use --with-dir-user=bacula but run bacula as root:bacula. That should be cleaned up in future. Atm there is a test for bacula-7.4.0-r1 to run bacula-dir as root:bacula under systemd also. If that works it will be backported to all other version still in tree.
Backported fixes to bacula-5.2.13-r5 and bacula-7.0.5-r2. > app-backup/bacula: Backport fixes from bug #584442 to let bacula-dir start under systemd