# Agent cannot re-start after a forceful or ungraceful shutdown

**URL:** <https://openziti.discourse.group/t/agent-cannot-re-start-after-a-forceful-or-ungraceful-shutdown/5761>\
**Category:** zrok\
**Created:** [April 10, 2026, 7:07am UTC](https://openziti.discourse.group/t/agent-cannot-re-start-after-a-forceful-or-ungraceful-shutdown/5761 "2026-04-10T07:07:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tyrrx](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/tyrrx/32/4192_2.png) [@Tyrrx](https://openziti.discourse.group/u/Tyrrx)\
**Post date:** [April 10, 2026, 7:07am UTC](https://openziti.discourse.group/t/agent-cannot-re-start-after-a-forceful-or-ungraceful-shutdown/5761/1 "2026-04-10T07:07:38Z")

</div>

When the agent crashes or is forcefully shutdown in cannot restart due to:  
`agent aborted (listen unix /root/.zrok2/agent.socket: bind: address already in use)`

The agent prints out:  
`{"time":"2026-04-10T07:00:19.294510047Z","level":"INFO","source":{"function":"``github.com/openziti/zrok/v2/agent.(*Agent).Run","file":"/__w/zrok/zrok/agent/agent.go","line":59},"msg":"started``"}`

In the agent systemd-service this is solved by:  
`ExecStartPre=/usr/bin/env rm --force %h/.zrok2/agent.socket`  
but I think this should be done in the agent itself.

Best regards,  
David
