The Challenge
The client reported their OpenVPN access server was down. Users could not connect. A quick check showed the service in a restart loop:
systemd[1]: openvpn-server@server.service: Scheduled restart job, restart counter is at 10.
systemd[1]: Started openvpn-server@server.service ...
systemd[1]: Main process exited, code=exited, status=1/FAILURE
The restart counter climbed past 20. systemctl status and journalctl offered no obvious clue — just exit code 1. We needed to find out why OpenVPN itself refused to start.
The Investigation
Disk space, file permissions, and the OpenVPN configuration all looked normal. We tailed the OpenVPN daemon's own log file.
Buried beneath warnings about the deprecated --topology net30 setting, a single line stood out:
MANAGEMENT: Socket bind failed on local address [AF_INET]127.0.0.1:1197: Address already in use (errno=98)
Exiting due to fatal error
OpenVPN could not bind its management interface — something else was already listening on port 1197.
The Root Cause
ss and lsof confirmed:
ss -ltnp | grep ':1197'
LISTEN 0 1 127.0.0.1:1197 0.0.0.0:* users:(("openvpn",pid=3112668,fd=3))
A stale OpenVPN process — PID 3112668 — still held the management socket. Leftover from a partial restart or crash during the maintenance window.
Systemd spawned a new instance, which immediately failed because the port was taken, exited, and let systemd try again. The restart loop worked exactly as designed — but could not recover from a stale process not owned by the current service unit.
The Resolution
Killed the orphaned process:
kill 3112668
Confirmed the port was free:
ss -ltnp | grep ':1197'
# (no output)
Reset systemd's restart counter and started the service cleanly:
systemctl reset-failed openvpn-server@server.service
systemctl start openvpn-server@server.service
The service came up immediately. Clients reconnected. Total resolution time was under ten minutes.
The Outcome
- Service restored with zero configuration changes.
- No data loss, no client cert reissue, no firewall changes.
- Configuration remains stable and unchanged.
Key Takeaways
- Systemd restart loops mask root causes. When the service exits immediately, systemd retries so fast that operators may not catch the real error message. Always check the application's own log, not just systemd's journal.
- Stale processes outlive systemd unit boundaries. A process spawned manually or left behind from a crash can hold ports, files, or locks that systemd's
Restart=logic cannot clear. Verify port availability withssorlsofbefore assuming the service is at fault. - The management interface is a single point of failure. OpenVPN's
managementdirective binds to a fixed port. If that port is taken — by anything — the daemon refuses to start. Consider using a Unix socket (management /var/run/openvpn/management.sock unix) to avoid port conflicts entirely. - Deprecation warnings deserve attention too. The
--topology net30warning was not the cause of this outage, but it flags a migration that should be scheduled before it becomes a problem in a future OpenVPN release.
Dealing with recurring service failures?
Validus helps organisations design, migrate, and maintain open-source infrastructure — from VPN platforms and identity management to full data-centre refreshes. If your team is dealing with recurring service failures or planning an infrastructure migration, we offer a no-obligation assessment.
Book Free Assessment