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

2013-08-10 Thread Roger Price
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

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] udev: fail firmware loading immediately if no search path is defined

2013-08-10 Thread Tom Gundersen
Hi Maarten,

On 7 Aug 2013 09:52, Maarten Lankhorst m.b.lankho...@gmail.com wrote:
 So what is wrong with my 'fail in udev immediately if not configured'
idea? In that case it
 doesn't matter whether CONFIG_FW_LOADER_USER_HELPER is set or not.

Well that would break the case for anyone who actually wants to use a
non-udev user space helper (which is the only situation where this
configuration actually makes sense). I don't necessarily think that using
such a helper is a sensible thing to do, but if we don't want to support
that we should just drop the option from the kernel rather than make udev
override the kernel configuration.

 You could even print a useful message for the user in udev to the log, so
they have an idea of what
 happened. Breaking udev on older still supported kernels by default
without printing any debug info
 is silly, and the only cost is a small increase in disk space when
unused. I did so in below patch.

It would be simple enough to add an udev rule to just print 'ignoring
firmware event' to the logs. We should really ignore the event though, and
not cancel it. Not sure if this is something we want upstream (after all,
there are plenty of situations where we don't warn if the recommendations
in the README file are not followed), or if distros and whoever wants it
should ship that themselves. I'll leave that for Kay to decide.

Lastly, note that the plan is to drop all the firmware code from udev in
the not too distant future, so it doesn't really maker much sense to add
new functionality to that at this point.

Cheers,

Tom
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2013-08-10 Thread Roger Price

On Sat, 10 Aug 2013, Andrey Borzenkov wrote:


Home made service should normally go into /etc/systemd.


I moved my service to /etc/systemd/system/


[Unit]

You need to add DefaultDependencies=no. Otherwise your service will
conflict with shutdown.target.


I added DefaultDependencies=no and my service works!


systemd --system --test --unit poweroff.target --log-level debug
can be used to see what would be started and why.


Thanks for your help!
Roger

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel