argument -S with systemctl break the boot of minidlna
Brought to you by:
jmaggard
minidlna does not start via systemctl in openSUSE_13.1, leaving out the -S argument in the systemctrl unit makes it work. As the -S option is especially designed for systemctl, it is unexpected that it breaks systemctl.
See for a discussion about this in the openSUSE forums
Looking at the code (file minidlna.c) shows:
918 else if (GETFLAG(SYSTEMD_MASK))
919 {
920 pid = getpid();
921 }
922 else
923 {
924 pid = process_daemonize();
925 #ifdef READYNAS
926 unlink("/ramfs/.upnp-av_scan");
927 path = "/var/log/upnp-av.log";
928 #else
929 if (access(db_path, F_OK) != 0)
930 make_dir(db_path, S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO);
931 snprintf(buf, sizeof(buf), "%s/minidlna.log", log_path);
932 path = buf;
933 #endif
934 }
Is it desired that the lines 924 and up and including 934 are not executed with systemctl?
Anyway, why does the -S argument break the boot of minidlna when using systemctl.
You can't use Type=forking with -S, because it seems like -S prevents minidlna from daemonizing (forking itself into a new process, then exiting the main process). Simply use Type=simple in the systemd service unit to tell systemd that it shouldn't expect the daemon to fork as a sign of "I'm ready" when using -S.