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
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
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’
from google search it look like dbus.service issue. i guess dietpi masked systemd.logind service
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.
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
even i unmask & enable sysemd.logind & install dbus. even than hibernate command on home assistant machine gives this error
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
Instead of hibernate i change command to poweroff. then system is able to poweroff remote server.
sudo -u homeassistant dbclient -i /home/homeassistant/.ssh/tiny homeassistant@192.168.1.11 'sudo systemctl poweroff'