Hello, I&#39;m making a systemd service file for gogoc, a program to create IPv6 tunnels with Freenet6.net<br><br>The program gets the network configuration and uses a shell script for configuring the interface, and when receives the HUP signal, calls the shell script again for shutting down the tunnel, but it needs a few seconds for doing this.<br>
<br>What&#39;s the better way for doing this? at the moment, I do:<br><br>[Service]<br>WorkingDirectory=/var/lib/gogoc<br>Type=simple<br>EnvironmentFile=-/etc/sysconfig/gogoc<br>ExecStart=/usr/bin/gogoc -f /etc/gogoc/gogoc.conf $GOGOC_OPTS<br>
ExecStop=/bin/kill -s SIGHUP $MAINPID<br><br>it sends the HUP, but then it kills the daemon immediately, there&#39;s no time for shutting down the tunnel properly.<br>Is correct to put a sleep? It looks awful<br>ExecStop=/bin/kill -s SIGHUP $MAINPID; sleep 5<br>
<br>What do you think?<br><br><br><br>