#!/bin/bash
/usr/bin/logger TEST1
But TEST1 doesn't appear in system journal after reboot.
]]>]]>Immediately before executing the actual system halt/poweroff/reboot/kexec systemd-shutdown will run all executables in /usr/lib/systemd/system-shutdown/ and pass one arguments to them: either "halt", "poweroff", "reboot" or "kexec", depending on the chosen action. All executables in this directory are executed in parallel, and execution of the action is not continued before all executables finished.
udisksctl power-off -b /dev/sdb
Then I want to switch it off automatically during system shutdown. I have tried to make systemd unit
# ehddoff.service
[Unit]
Description=ehdd power-off
DefaultDependencies=no
Before=shutdown.target
[Service]
ExecStart=/usr/bin/udisksctl power-off -b /dev/sdb
Type=oneshot
[Install]
WantedBy=shutdown.target
It doesn't work.
# journalctl
Jun 27 04:16:59 toshibanb ehddoff[2449]: Error connecting to the udisks daemon: Error calling StartServiceByName for org.freedesktop.UDisks2: GDBus.Error:org.freedesktop.systemd1.ShuttingDown: Refusing activation, D-Bus is shutting down.
What can you advice? Is it possible to start service before D-Bus shutdown?
]]>