On Tue, Apr 18, 2023, 02:59 Bill Steinberg <bill@xxxxxxxxxxxxxx> wrote:
Hi Barry,Thanks for the response. Answers inline below.On Apr 17, 2023, at 5:09 PM, Barry <barry@xxxxxxxxxxxxxxxx> wrote:Hello systemd devel,I have a systemd service that I’ve run on prior versions of fedora which fails to start via systemd on Fedora release 37. It is a oneshot service that starts the distributed checksum clearing house’s dccifd service via a shell script. Here is the definition of the service:[Unit]Description=Distributed Checksum Clearinghouses dccifd daemonAfter=syslog.target network.target[Service]Type=oneshotOneshot seems wrong.Does this run a background daemon?RemainAfterExit=yesExecStart=/var/dcc/libexec/rcDCC -m dccifd startYes, the rcDCC shell script starts and runs a linux executable, a background daemon as you call it.
A "background daemon" is just Type=forking.
Can you just run that daemon directly?I could run the shell script directly to start the dccifd executable however if the fedora linux server is rebooted I would need to remember to run the shell script manually. I’d like the dccifd daemon to start automatically when the fedora linux server is started. Isn’t systemd meant for this?
"Directly" means *not using wrapper scripts.* You can put command line arguments in ExecStart.
Hopefully that program can be run without demonising.If it is oneshot it does not need a stopExecStop=/var/dcc/libexec/rcDCC -m dccifd stopIs there another type that should be used besides oneshot? I may want to run systemctl stop dccifd.service, for example when dccifd is being upgraded to a new version.The dccifd executable is started and stopped using a shell script. It is not run directly. One reason is that the shell script contains the arguments that are passed to the dccifd linux executable.
That's still just Type=forking.
Make sure the script `exec`s the main process rather than spawning it underneath as usual.
But why put those arguments in a shell script? Isn't systemd meant for this?
Restart=no[Install]WantedBy=multi-user.targetThe error in the journalctl log is:The two scripts in ExecStart and ExecStop run successfully outside of systemd. Any info as to why systemd fails when executing these scripts would be appreciated.systemd[1]: Starting dccifd.service - Distributed Checksum Clearinghouses dccifddaemon…systemd[1]: dccifd.service: Main process exited, code=killed, status=11/SEGVsystemd[1]: dccifd.service: Failed with result 'signal’.systemd[1]: Failed to start dccifd.service - Distributed Checksum Clearinghouses dccifddaemon.Best,Bill Steinberg