[systemd-devel] Trying to turn off a UPS with home-made service unit

Roger Price roger at rogerprice.org
Sat Aug 10 08:02:09 PDT 2013


I am new to systemd and I am trying to power off a UPS unit using a 
home-made service unit /lib/systemd/system/ups-delayed-shutdown.service 
running on openSUSE 12.3.

    [Unit]
    Description=Initiate delayed UPS shutdown
    Before=umount.target

    [Service]
    Type=oneshot
    ExecStart=/usr/lib/ups/driver/upsdrvctl shutdown

    [Install]
    WantedBy=poweroff.target

I ran command "systemctl --system reenable 
/lib/systemd/system/ups-delayed-shutdown.service" to create the link to 
poweroff.target, but when the box is powered down, for example with 
command "systemctl poweroff", my service unit does nothing.

Command "systemctl list-units -t target --all" does not list 
poweroff.target.  Does this mean that systemd does not recognize the 
poweroff target?  I tried replacing poweroff.target with final.target but 
this had no effect.

How should I go about debugging this?  I can find no equivalent of Bash's 
"set -x" to trace the operation of systemd on my unit.

Any help would be much appreciated.

Roger



More information about the systemd-devel mailing list