[systemd-devel] synchronizing user service

Lennart Poettering lennart at poettering.net
Mon Mar 10 14:16:55 PDT 2014


On Fri, 07.03.14 20:45, Alec Leamas (leamas.alec at gmail.com) wrote:

> 
> Sorry for not being clear. The priob
> 
> On 3/7/14, Lennart Poettering <lennart at poettering.net> wrote:
> > On Fri, 07.03.14 19:58, Alec Leamas (leamas.alec at gmail.com) wrote:
> >
> >> Dear list,
> >>
> >> Being a systemd dummie, I have a problem. It's a about running a
> >> service as a user, which needs to synchronize with a systemd service.
> >
> > What do you mean by "synchronize"?
> >
> >> Since the service needs to be part of the session, I presume that a
> >> /systemd/user service isn't really the way to go (?): This leaves me
> >> with the problem to start a service e. .g,, using a desktop file in
> >> the autostart dir. The service needs a socket created by a systemd
> >> service.
> >
> > You can simply order your system service before
> > systemd-user-sessions.service. All user sessions are only started after
> > that, hence ordering your service before that makes sure for users it is
> > always accesssible.
> >
> >> As of now, I simply poll for the socket creation in a shell script.
> >> It's just that my gut feeling is that this is not  really the way to
> >> do this. Is there a better approach?
> >
> > Well, you can make it socket activated, but otherwise just order it like
> > suggested above...
> 
> Sorry for not being clear...
> 
> I can't make it socket activated, nor can I order it. My user service
> is *not* a systemd service since it needs to be part  of the session.
> As of now, it's started as a desktop service using a desktop file.
> 
> So the question is: is there any "good" way for a non-systemd user
> service to to things that systemd services does, like waiting on a
> socket or somehow become part  of the ordering scheme?

I really don't grok this?

Do you have a system systemd service and a non-systemd session service?

Or do you have a user systemd service and a non-systemd session service?

The former should a non-issue, as pointed above, as you can just order
your system systemd service before systemd-user-session.service. Since
user sessions are only started after that barrier you don't have to
synchronize for anything else...

The latter doesn't make much sense to me... 

Anyway, really not grokking what you are trying to do...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list