Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #210173 > unrolled thread

Unreliable systemd user service

Started byAidan Gauland <aidalgol@fastmail.net>
First post2019-06-21 01:30 +0200
Last post2019-06-25 03:50 +0200
Articles 9 — 5 participants

Back to article view | Back to linux.debian.user


Contents

  Unreliable systemd user service Aidan Gauland <aidalgol@fastmail.net> - 2019-06-21 01:30 +0200
    Re: Unreliable systemd user service Ansgar Burchardt <"\<script\>alert\('Ohhai'\)\<\/script\>"@43-1.org> - 2019-06-21 08:50 +0200
      Re: Unreliable systemd user service Aidan Gauland <aidalgol@fastmail.net> - 2019-06-21 09:10 +0200
        Re: Unreliable systemd user service john doe <johndoe65534@mail.com> - 2019-06-21 09:50 +0200
          Re: Unreliable systemd user service Aidan Gauland <aidalgol@fastmail.net> - 2019-06-22 00:30 +0200
        Re: Unreliable systemd user service Jonathan Dowland <jmtd@debian.org> - 2019-06-21 11:00 +0200
          Re: Unreliable systemd user service Aidan Gauland <aidalgol@fastmail.net> - 2019-06-22 00:40 +0200
            Re: Unreliable systemd user service Michael Biebl <biebl@debian.org> - 2019-06-24 18:10 +0200
              Re: Unreliable systemd user service Aidan Gauland <aidalgol@fastmail.net> - 2019-06-25 03:50 +0200

#210173 — Unreliable systemd user service

FromAidan Gauland <aidalgol@fastmail.net>
Date2019-06-21 01:30 +0200
SubjectUnreliable systemd user service
Message-ID<ybeFb-4QJ-1@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

I have a user service for running xautolock that does not start on login
reliably, and I have no idea why, because there is no error message,
just an exit code of 1.  (Unit file and output of systemctl status
attached.)  Any suggestions on what to do next to troubleshoot this?

Regards,
Aidan Gauland

[toc] | [next] | [standalone]


#210176

FromAnsgar Burchardt <"\<script\>alert\('Ohhai'\)\<\/script\>"@43-1.org>
Date2019-06-21 08:50 +0200
Message-ID<yblx0-DL-1@gated-at.bofh.it>
In reply to#210173
Aidan Gauland writes:
> I have a user service for running xautolock that does not start on login
> reliably, and I have no idea why, because there is no error message,
> just an exit code of 1.  (Unit file and output of systemctl status
> attached.)  Any suggestions on what to do next to troubleshoot this?

I would guess `xautolock` might be started before X is
running/accessible by your user.

Does the journal contain any useful log messages?  Note that there is a
race condition that some messages might not be logged as part of the
user service[1], so you might have to check all log messages and cannot
rely on journalctl's `--user-unit` option.

Ansgar

  [1] https://github.com/systemd/systemd/issues/2913

[toc] | [prev] | [next] | [standalone]


#210178

FromAidan Gauland <aidalgol@fastmail.net>
Date2019-06-21 09:10 +0200
Message-ID<yblQl-ZB-1@gated-at.bofh.it>
In reply to#210176

[Multipart message — attachments visible in raw view] — view raw

On 21/06/19 6:25 PM, Ansgar Burchardt wrote:
> Aidan Gauland writes:
>> I have a user service for running xautolock that does not start on login
>> reliably, and I have no idea why, because there is no error message,
>> just an exit code of 1.  (Unit file and output of systemctl status
>> attached.)  Any suggestions on what to do next to troubleshoot this?
> I would guess `xautolock` might be started before X is
> running/accessible by your user.
>
> Does the journal contain any useful log messages?  Note that there is a
> race condition that some messages might not be logged as part of the
> user service[1], so you might have to check all log messages and cannot
> rely on journalctl's `--user-unit` option.

Nope, absolutely nothing in the logs.

Someone else suggested running xautolock from my .xsessionrc script so
that it is always run after X is running, and that seems to work.  I
wanted to run this via systemd because that's easier to restart after
making tweaks than something run as part of a startup script, but I have
not been able to find any mechanism to delay starting a /user/ service
until the graphical login is ready.

[toc] | [prev] | [next] | [standalone]


#210181

Fromjohn doe <johndoe65534@mail.com>
Date2019-06-21 09:50 +0200
Message-ID<ybmt3-1cJ-5@gated-at.bofh.it>
In reply to#210178
On 6/21/2019 8:50 AM, Aidan Gauland wrote:
> On 21/06/19 6:25 PM, Ansgar Burchardt wrote:
>> Aidan Gauland writes:
>>> I have a user service for running xautolock that does not start on login
>>> reliably, and I have no idea why, because there is no error message,
>>> just an exit code of 1.  (Unit file and output of systemctl status
>>> attached.)  Any suggestions on what to do next to troubleshoot this?
>> I would guess `xautolock` might be started before X is
>> running/accessible by your user.
>>
>> Does the journal contain any useful log messages?  Note that there is a
>> race condition that some messages might not be logged as part of the
>> user service[1], so you might have to check all log messages and cannot
>> rely on journalctl's `--user-unit` option.
>
> Nope, absolutely nothing in the logs.
>
> Someone else suggested running xautolock from my .xsessionrc script so
> that it is always run after X is running, and that seems to work.  I
> wanted to run this via systemd because that's easier to restart after
> making tweaks than something run as part of a startup script, but I have
> not been able to find any mechanism to delay starting a /user/ service
> until the graphical login is ready.
>

Is it always working if you run the command manually?

--
John Doe

[toc] | [prev] | [next] | [standalone]


#210212

FromAidan Gauland <aidalgol@fastmail.net>
Date2019-06-22 00:30 +0200
Message-ID<ybAcF-22r-1@gated-at.bofh.it>
In reply to#210181
On 21/06/19 7:24 PM, john doe wrote:
> Is it always working if you run the command manually?
It has so far, yes.

[toc] | [prev] | [next] | [standalone]


#210182

FromJonathan Dowland <jmtd@debian.org>
Date2019-06-21 11:00 +0200
Message-ID<ybnyO-1Pe-1@gated-at.bofh.it>
In reply to#210178
On Fri, Jun 21, 2019 at 06:50:14PM +1200, Aidan Gauland wrote:
>Someone else suggested running xautolock from my .xsessionrc script so
>that it is always run after X is running, and that seems to work.  I
>wanted to run this via systemd because that's easier to restart after
>making tweaks than something run as part of a startup script,

What about starting the service *via systemd* in your .xsessionrc?
something like "systemctl start xautolock".

-- 
Jonathan Dowland

[toc] | [prev] | [next] | [standalone]


#210213

FromAidan Gauland <aidalgol@fastmail.net>
Date2019-06-22 00:40 +0200
Message-ID<ybAml-26n-1@gated-at.bofh.it>
In reply to#210182
On 21/06/19 8:33 PM, Jonathan Dowland wrote:
> On Fri, Jun 21, 2019 at 06:50:14PM +1200, Aidan Gauland wrote:
>> Someone else suggested running xautolock from my .xsessionrc script so
>> that it is always run after X is running, and that seems to work.  I
>> wanted to run this via systemd because that's easier to restart after
>> making tweaks than something run as part of a startup script,
>
> What about starting the service *via systemd* in your .xsessionrc?
> something like "systemctl start xautolock".
I had thought of that, but it feels even messier to use both .xsessionrc
and systemd together.  Why is there no "the graphical session is ready"
systemd target?

[toc] | [prev] | [next] | [standalone]


#210335

FromMichael Biebl <biebl@debian.org>
Date2019-06-24 18:10 +0200
Message-ID<yczHA-5CG-7@gated-at.bofh.it>
In reply to#210213

[Multipart message — attachments visible in raw view] — view raw

Hi

>  Why is there no "the graphical session is ready"
> systemd target?

There is, incidentally it is named graphical-session.target :-)
See man systemd.special

Unfortunately, no display/session manager is hooked up yet to manage the
lifetime of that target, so you can't make use of that target as of now.

Martin Pitt has been working on that in the past, see
https://lists.freedesktop.org/archives/systemd-devel/2018-June/040952.html
which contains a few references to work from 2016.

When Martin left Canonical, work on this mostly stopped and I don't know
what the current state is in that regard.
I did find
https://blogs.gnome.org/laney/2018/06/26/starting-sessions-with-systemd/
so I hope we will eventually see proper support for
graphical-session.target.

Regards,
Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

[toc] | [prev] | [next] | [standalone]


#210346

FromAidan Gauland <aidalgol@fastmail.net>
Date2019-06-25 03:50 +0200
Message-ID<ycIKR-2t9-1@gated-at.bofh.it>
In reply to#210335

[Multipart message — attachments visible in raw view] — view raw

On 25/06/19 3:46 AM, Michael Biebl wrote:
>>  Why is there no "the graphical session is ready"
>> systemd target?
> There is, incidentally it is named graphical-session.target :-)
> See man systemd.special
>
> Unfortunately, no display/session manager is hooked up yet to manage the
> lifetime of that target, so you can't make use of that target as of now.
Ah, that would be why using that was valid but did not work.  Good to
know, thanks!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web