[systemd-devel] Forward systemd's sleep.target to a systemd user session

Lennart Poettering lennart at poettering.net
Thu Jul 11 15:51:03 PDT 2013


On Wed, 10.07.13 21:04, Jörg Thalheim (joerg at higgsboson.tk) wrote:

> How I can trigger sleep.target in systemd --user session?

What precisely are you trying to do with this?

> Can I use "systemctl --user" only at a login shell and not in a systemd
> unit? Because using "systemd --user" from tty works great.

You need access to the same bus socket. I am note sure how you set up
dbus for your session.

> My use case is to logout my jabber client before suspend (I hope this
> does not sounds to trivial compared to your serious problems, but you
> might come up with other use cases).

It's probably a better idea to patch the client to use a delay inhibitor
for this:

http://www.freedesktop.org/wiki/Software/systemd/inhibit/

> This cannot be done in a normal .service file, because it does require a
> connection to the current dbus session.

Well, systemctl --user needs that too, so you gain nothing...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list