]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:printing: Allow to run samba-bgqd as a standalone systemd service
authorAndreas Schneider <asn@samba.org>
Fri, 12 Jul 2024 12:18:26 +0000 (14:18 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 19 Jul 2024 11:13:28 +0000 (11:13 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15683

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jul 19 11:13:28 UTC 2024 on atb-devel-224

source3/printing/samba-bgqd.c

index 59ed0cc40dbaa73e8b5e301693758fd3b7c6b8e5..9560fcf9e35816c3a8a042819ce2a4d6102be9f9 100644 (file)
@@ -253,7 +253,9 @@ int main(int argc, const char *argv[])
        log_stdout = (debug_get_log_type() == DEBUG_STDOUT);
 
        /* main process will notify systemd */
-       daemon_sd_notifications(false);
+       if (ready_signal_fd != -1 || watch_fd != -1) {
+               daemon_sd_notifications(false);
+       }
 
        if (!cmdline_daemon_cfg->fork) {
                daemon_status(progname, "Starting process ... ");
@@ -325,6 +327,10 @@ int main(int argc, const char *argv[])
                goto done;
        }
 
+       if (!cmdline_daemon_cfg->fork) {
+               daemon_ready(progname);
+       }
+
        if (ready_signal_fd != -1) {
                pid_t pid = getpid();
                ssize_t written;