<div dir="ltr"><div class="gmail_default" style="font-size:small">Hello all, <br></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I have scripted a service unit as follow.</div><div class="gmail_default" style="font-size:small"><pre style="color:rgb(0,0,0)">[Unit]
Description="A test service"
After=epmd.service epmd.socket<br></pre><pre style="color:rgb(0,0,0)">[Service]
ExecStart=/home/otpuser/bin/start
Type=notify
NotifyAccess=all
WorkingDirectory=~
User=otpuser
Group=otp
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target</pre></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">ExecStart directs to a shell script which starts a Erlang run_erl daemon.</div><div class="gmail_default" style="font-size:small">This daemon is forking a process which is the BEAM virtual machine. In the forked process Im sending "<span style="color:rgb(0,0,0)">READY=1\nSTATUS=Initialized\nMAINPID=" <<Forked-Process-Pid>> "\n</span> to systemd via sd_notify. The problem is service is getting restarted constantly.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">journalctl give this</div><div class="gmail_default" style="font-size:small"><pre style="color:rgb(0,0,0)"><pre style="user-select: text; top: -99px;">abc.service: Service hold-off time over, scheduling restart.
Stopped "A test service.".<br></pre></pre></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Is it required to send READY=1 from the daemon it self ? or can systemd allow forked process of the daemon to send REDAY=1 notification?</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It works when Type=forking and PIDFile is specified, but can we have Type=forking and without PIDFIle, notify READY=1 via forked process ? </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">My systemd version</div><div class="gmail_default" style="font-size:small"><pre style="color:rgb(0,0,0)">$ systemd --version
systemd 229</pre></div></div>