# How to stop zrok-agent on suspend/hibernate

**URL:** <https://openziti.discourse.group/t/how-to-stop-zrok-agent-on-suspend-hibernate/4889>\
**Category:** zrok\
**Created:** [July 20, 2025, 10:28pm UTC](https://openziti.discourse.group/t/how-to-stop-zrok-agent-on-suspend-hibernate/4889 "2025-07-20T22:28:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rantanplan](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/rantanplan/32/3353_2.png) [@Rantanplan](https://openziti.discourse.group/u/Rantanplan)\
**Post date:** [July 20, 2025, 10:28pm UTC](https://openziti.discourse.group/t/how-to-stop-zrok-agent-on-suspend-hibernate/4889/1 "2025-07-20T22:28:51Z")

</div>

It seems that when user _suspends_ his computer zrok-agent has no opportunity to send _unaccess request for frontend_ to zrok controller. There is no SIGTERM in this case.

---

<div class="post-metadata">

**Author:** ![michael.quigley](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/michael.quigley/32/1123_2.png) [@michael.quigley](https://openziti.discourse.group/u/michael.quigley)\
**Post date:** [July 21, 2025, 2:30pm UTC](https://openziti.discourse.group/t/how-to-stop-zrok-agent-on-suspend-hibernate/4889/2 "2025-07-21T14:30:53Z")

</div>

Understood. There are changes coming to improve the agent in several ways, which should cover this scenario.

---

<div class="post-metadata">

**Author:** ![Rantanplan](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/rantanplan/32/3353_2.png) [@Rantanplan](https://openziti.discourse.group/u/Rantanplan)\
**Post date:** [July 21, 2025, 3:07pm UTC](https://openziti.discourse.group/t/how-to-stop-zrok-agent-on-suspend-hibernate/4889/3 "2025-07-21T15:07:43Z")

</div>

It will be great!

On top of suspend/hibernate there is another problem. On a very old linux _systemd --user_ does not kill user's processes:

_When [#Automatic start-up of systemd user instances](https://wiki.archlinux.org/title/Systemd/User#Automatic_start-up_of_systemd_user_instances) is enabled, the instance is started on boot and will not be killed._

The default value KillUserProcesses was changed but people still use old linux.

So this pc never sends _unaccess request_ and every day creates new tokens. From time to time I need to manually delete them:

```auto
curl -s -H "X-TOKEN: secret" -X DELETE -H "Content-Type: application/zrok.v1+json" -d '{"envZId": "ziti_Id","frontendToken":"token","shareToken":"share_name" }' https://domain.name:port/api/v1/unaccess

```

I hope that there is no danger to let the phantom tokens be active for a some time in the database. Then I remove these tokens by a bash script at once.
