Re: [systemd-devel] Question about the cross session dependence

2013-04-25 Thread Łukasz Stelmach
It was 2013-04-22 pon 17:43, when Lennart Poettering wrote:
 On Mon, 22.04.13 00:58, Kok, Auke-jan H (auke-jan.h@intel.com) wrote:
 On Sun, Apr 21, 2013 at 6:49 PM, Li, Min A min.a...@intel.com wrote:
  I have a question about the dependence of user and system
  session. At system session, there is a service which need to be
  started after X(user session).
 
  At first I added “After=xorg.target” at this service, but It is
  said that the dependence of cross session is not work. Is that
  true?
 
 The user session instance does not know anything about the state of
 system services. So yes.

[...]

 The much nicer way it to simply teach X11 socket activation. Then you
 can run it either from the system instance of systemd, or the user
 instance, and things would just work...

I've got a patch for X to make it socket activatable. I hope to
release it soon.

-- 
Łukasz Stelmach
Software wizzard
Samsung Poland RD Center

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


Re: [systemd-devel] Question about the cross session dependence

2013-04-22 Thread Kok, Auke-jan H
On Sun, Apr 21, 2013 at 6:49 PM, Li, Min A min.a...@intel.com wrote:
 Hi systemd experts,



 I have a question about the dependence of user and system session. At system
 session, there is a service which need to be started after X(user session).

 At first I added “After=xorg.target” at this service, but It is said that
 the dependence of cross session is not work. Is that true?

The user session instance does not know anything about the state of
system services. So yes.

 If Yes, what’s the solution for this kind of issue?

If you start your xorg through systemd --system, you will have to find
an alternative way to tell the systemd --user how to determine that
the service is ready. You can make a hack with a path unit, or write a
user session service that uses IPC to communicate with the system
session in some way. Nobody has looked at that, afaik.

This is why user-session-units starts the X server from within the
systemd --user environment - it removes that problem entirely.

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


Re: [systemd-devel] Question about the cross session dependence

2013-04-22 Thread Lennart Poettering
On Mon, 22.04.13 01:49, Li, Min A (min.a...@intel.com) wrote:

 Hi systemd experts,
 
 I have a question about the dependence of user and system session. At
 system session, there is a service which need to be started after
 X(user session).

 At first I added After=xorg.target at this service, but It is said
 that the dependence of cross session is not work. Is that true?

Yes, it is.

 If Yes, what's the solution for this kind of issue?

The idea is that system services get socket or bus activated, so that
clients can just connect to them, and if the services are not running
yet they would be started and if they are already being starte that the
client wouldn't have to know.

In the case of X this would mean adding socket activation support to
it. This has been discussed many times, and the X folks are open to
it. It's probably not useful for the desktop case, but for most emebdded
cases it is. Doing socket-activated X isn't even that hard, it's just
that somebody has to sit down and hack it up. By doing socket activation
for X you not only get rid of any explicit dependencies, but you also
get performance wins via the best possible parallelization, and the
thing even becomes more robust, too.

Porting X to socket activation is just a matter of patching it to use
sd_listen_fds() instead of directly binding the listening
socket. There's plenty documentation for it, just google for it!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Question about the cross session dependence

2013-04-22 Thread Lennart Poettering
On Mon, 22.04.13 00:58, Kok, Auke-jan H (auke-jan.h@intel.com) wrote:

 
 On Sun, Apr 21, 2013 at 6:49 PM, Li, Min A min.a...@intel.com wrote:
  Hi systemd experts,
 
 
 
  I have a question about the dependence of user and system session. At system
  session, there is a service which need to be started after X(user session).
 
  At first I added “After=xorg.target” at this service, but It is said that
  the dependence of cross session is not work. Is that true?
 
 The user session instance does not know anything about the state of
 system services. So yes.
 
  If Yes, what’s the solution for this kind of issue?
 
 If you start your xorg through systemd --system, you will have to find
 an alternative way to tell the systemd --user how to determine that
 the service is ready. You can make a hack with a path unit, or write a
 user session service that uses IPC to communicate with the system
 session in some way. Nobody has looked at that, afaik.
 
 This is why user-session-units starts the X server from within the
 systemd --user environment - it removes that problem entirely.

The much nicer way it to simply teach X11 socket activation. Then you
can run it either from the system instance of systemd, or the user
instance, and things would just work...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Question about the cross session dependence

2013-04-21 Thread Li, Min A
Hi systemd experts,

I have a question about the dependence of user and system session. At system 
session, there is a service which need to be started after X(user session).
At first I added After=xorg.target at this service, but It is said that the 
dependence of cross session is not work. Is that true?
If Yes, what's the solution for this kind of issue?
Thanks a lot!

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