Restarting l2tpns only shuts it down
When trying to restart l2tpns, it fails immediately:
# systemctl restart l2tpns
Job for l2tpns.service failed because the control process exited with error code
What actually happens is that l2tpns is trying to shut down, but it can take several seconds, with many messages like this in the logs:
...
00/00 Tunnel 5 still has un-acked control messages.
...
00/00 Tunnel 2 still has un-acked control messages.
...
Kill tunnel 2: Timeout on control message
Shutdown complete
At this point, l2tpns has exited, and it is not restarted.
What I think happens is that systemd calls "/etc/init.d/l2tpns stop", which exits immediately with a success code, and then calls "/etc/init.d/l2tpns start", which fails because l2tpns is still running:
# systemctl status l2tpns.service
● l2tpns.service
Loaded: loaded (/etc/init.d/l2tpns; generated; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2020-11-01 19:08:31 CET; 8min ago
Docs: man:systemd-sysv-generator(8)
Process: 15137 ExecStop=/etc/init.d/l2tpns stop (code=exited, status=0/SUCCESS)
Process: 15143 ExecStart=/etc/init.d/l2tpns start (code=exited, status=1/FAILURE)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/l2tpns.service
systemd[1]: Starting l2tpns.service...
l2tpns[15143]: Starting l2tpns:
systemd[1]: l2tpns.service: Control process exited, code=exited status=1
systemd[1]: Failed to start l2tpns.service.
systemd[1]: l2tpns.service: Unit entered failed state.
systemd[1]: l2tpns.service: Failed with result 'exit-code'.
A solution would be to switch a proper systemd service file.