Yes, it&#39;s a poor choice for the daemon to use SIGHUP, I have found a lot of oddities with this program.<br><br>A collateral effect of this is that the router advertisement daemon (radvd) is run as a child and meanwhile gogoc is closing the tunnel, radvd is reloading its configuration, and then dying with SIGKILL, because it never receives a SIGTERM, doesn&#39;t it?<br>
<br>Anyway, now it works ok, and there is always the possibility of creating a shell script.<br><br>Thank you and good work with systemd, it&#39;s fantastic!<br><br><br><div class="gmail_quote">2011/9/19 Lennart Poettering <span dir="ltr">&lt;<a href="mailto:mzerqung@0pointer.de">mzerqung@0pointer.de</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Mon, 19.09.11 13:25, Juan Orti Alcaine (<a href="mailto:j.orti.alcaine@gmail.com">j.orti.alcaine@gmail.com</a>) wrote:<br>

<br>
&gt; Hello, I&#39;m making a systemd service file for gogoc, a program to create IPv6<br>
&gt; tunnels with Freenet6.net<br>
&gt;<br>
&gt; The program gets the network configuration and uses a shell script for<br>
&gt; configuring the interface, and when receives the HUP signal, calls the shell<br>
&gt; script again for shutting down the tunnel, but it needs a few seconds for<br>
&gt; doing this.<br>
&gt;<br>
&gt; What&#39;s the better way for doing this? at the moment, I do:<br>
&gt;<br>
&gt; [Service]<br>
&gt; WorkingDirectory=/var/lib/gogoc<br>
&gt; Type=simple<br>
&gt; EnvironmentFile=-/etc/sysconfig/gogoc<br>
&gt; ExecStart=/usr/bin/gogoc -f /etc/gogoc/gogoc.conf $GOGOC_OPTS<br>
&gt; ExecStop=/bin/kill -s SIGHUP $MAINPID<br>
&gt;<br>
&gt; it sends the HUP, but then it kills the daemon immediately, there&#39;s no time<br>
&gt; for shutting down the tunnel properly.<br>
&gt; Is correct to put a sleep? It looks awful<br>
&gt; ExecStop=/bin/kill -s SIGHUP $MAINPID; sleep 5<br>
<br>
&gt; What do you think?<br>
<br>
</div></div>ExecStop is supposed to synchronously shut down a service. It&#39;s the same<br>
for SysV&#39;s &quot;stop&quot; verb.<br>
<br>
I must say I find it quite a poort choice of this software to use SIGHUP<br>
for termination. They should use SIGSTOP for that, as the generally<br>
accepted default meaning for SIGHUP for daemons is to reload<br>
configuration.<br>
<br>
Note that by default systemd sends SIGSTOP to all processes of a service<br>
and waits for a while to ensure the service shuts down. You can<br>
influence the signal sent via KillSignal=. See systemd.service(5) for<br>
more information.<br>
<br>
Lennart<br>
<br>
--<br>
Lennart Poettering - Red Hat, Inc.<br>
<font color="#888888">--<br>
</font><div><div></div><div class="h5">devel mailing list<br>
<a href="mailto:devel@lists.fedoraproject.org">devel@lists.fedoraproject.org</a><br>
<a href="https://admin.fedoraproject.org/mailman/listinfo/devel" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br>