# 'sudo systemctl hibernate' command not working through homeassitant automation

**URL:** <https://dietpi.com/forum/t/sudo-systemctl-hibernate-command-not-working-through-homeassitant-automation/24056>\
**Category:** Troubleshooting\
**Created:** [26 August 2025 14:53 UTC](https://dietpi.com/forum/t/sudo-systemctl-hibernate-command-not-working-through-homeassitant-automation/24056 "2025-08-26T14:53:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mail2rst](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/ee59a6/32.png) [@mail2rst](https://dietpi.com/forum/u/mail2rst)\
**Post date:** [26 August 2025 14:53 UTC](https://dietpi.com/forum/t/sudo-systemctl-hibernate-command-not-working-through-homeassitant-automation/24056/1 "2025-08-26T14:53:16Z")

</div>

In past my home-assistant shell command automation was working fine to hibernate remote server . While i update from bookworm to Trixie after that this automation not working  
homeassistant configration.yml

```auto
shell_command:
  turn_off_media_server: "dbclient -i /home/homeassistant/.ssh/homeassistant homeassistant@192.168.1.12 'sudo systemctl hibernate'"
  turn_off_office_server: "dbclient -i /home/homeassistant/.ssh/tiny homeassistant@192.168.1.11 'sudo systemctl hibernate'"

```

from home assistant machine i can get ssh authorization with this command

```auto
sudo -u homeassistant dbclient -i /home/homeassistant/.ssh/homeassistant homeassistant@192.168.1.12 

```

without password. but the hibernate command is not working through home-assistant to remote server. please suggest me workable procedure so that i can give hibernate command to remote server.

Basically my this command in home assistant machine terminal not go through in trixie machine which was working fine with bookworm before upgradation

`sudo -u homeassistant dbclient -i /home/homeassistant/.ssh/homeassistant homeassistant@192.168.1.12 ‘sudo systemctl hibernate’`

---

<div class="post-metadata">

**Author:** ![mail2rst](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/ee59a6/32.png) [@mail2rst](https://dietpi.com/forum/u/mail2rst)\
**Post date:** [27 August 2025 14:18 UTC](https://dietpi.com/forum/t/sudo-systemctl-hibernate-command-not-working-through-homeassitant-automation/24056/2 "2025-08-27T14:18:34Z")

</div>

from google search it look like dbus.service issue. i guess dietpi masked systemd.logind service

```auto

root@nuc:~# sudo systemctl status systemd-logind
○ systemd-logind.service
     Loaded: masked (Reason: Unit systemd-logind.service is masked.)
    Drop-In: /usr/lib/systemd/system/systemd-logind.service.d
             └─dbus.conf
     Active: inactive (dead)

```

which lead to the error for this command & homeassistant or even machine itself not execute this command on dietpi terminal window.

```auto
root@nuc:~# sudo systemctl hibernate
Failed to connect to system scope bus via local transport: No such file or directory
Failed to connect to system scope bus via local transport: No such file or directory

```

---

<div class="post-metadata">

**Author:** ![mail2rst](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/ee59a6/32.png) [@mail2rst](https://dietpi.com/forum/u/mail2rst)\
**Post date:** [27 August 2025 16:29 UTC](https://dietpi.com/forum/t/sudo-systemctl-hibernate-command-not-working-through-homeassitant-automation/24056/3 "2025-08-27T16:29:50Z")

</div>

even i unmask & enable sysemd.logind & install dbus. even than hibernate command on home assistant machine gives this error

```auto

root@wyse:~# sudo -u homeassistant dbclient -i /home/homeassistant/.ssh/tiny homeassistant@192.168.1.11 'sudo systemctl hibernate'
Call to Hibernate failed: Not running on EFI and resume= is not set, or noresume is set. No available method to resume from hibernation

```

---

<div class="post-metadata">

**Author:** ![mail2rst](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/m/ee59a6/32.png) [@mail2rst](https://dietpi.com/forum/u/mail2rst)\
**Post date:** [27 August 2025 17:00 UTC](https://dietpi.com/forum/t/sudo-systemctl-hibernate-command-not-working-through-homeassitant-automation/24056/4 "2025-08-27T17:00:45Z")

</div>

Instead of hibernate i change command to poweroff. then system is able to poweroff remote server.

```auto
sudo -u homeassistant dbclient -i /home/homeassistant/.ssh/tiny homeassistant@192.168.1.11 'sudo systemctl poweroff'

```

---

<div class="post-metadata">

**Author:** ![system](https://dietpi.com/forum/uploads/default/original/1X/7e1021de2213860bce185915ce2c1786e56490ec.png) [@system](https://dietpi.com/forum/u/system)\
**Post date:** [25 November 2025 17:01 UTC](https://dietpi.com/forum/t/sudo-systemctl-hibernate-command-not-working-through-homeassitant-automation/24056/5 "2025-11-25T17:01:40Z")

</div>

Closed on 25 November 2025 17:01 UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
