I want systemd service to handle forking (my file doesn't handle forking by itself. So I'm relying on systemd for handling that)
My .service file:
[Unit]
Description=swamp services management service
After=syslog.target
[Service]
Type=forking
ExecStart=/usr/bin/swamp
[Install]
WantedBy=multi-user.target
Question
Is specifying Type=forking
enough for what I'm trying to achieve? Or is it similar to expect forking in upstart which actually tells upstart (if I understand correctly, not sure I do, I'm new at writing initscripts) that my service would handle forking/daemonizing.
Best Answer
systemd has excellent documentation. See the page on service files:
So, using that
type
will just tell systemd to wait untilswamp
returns and then consider it to be still running: making that happen remains your responsibility...