Re: [systemd-devel] How to debug blocking service start?

2015-04-08 Thread Lennart Poettering
On Wed, 08.04.15 10:31, Kai Hendry (hen...@webconverger.com) wrote:

 
 
 On Tue, 7 Apr 2015, at 11:13 PM, Lennart Poettering wrote:
  What does networkctl status say when this happens? And networkctl
  status -a?
 
 Oooh, I love those commands. Here is the output which says I'm routable:
 
 http://s.natalian.org/2015-04-08/networkctl.txt
 
 
 Maybe all of this has something to do with the way I've setup
 systemd-networkd. I have dejavu now... quite possibly this all is
 related to:
 https://bugs.freedesktop.org/show_bug.cgi?id=89352

When you turn on debug logging for networkd, do you see what it is
doing on that configuring interface?

Normally, networkd should care for that interface only if there is a
carrier on it, which it isn't here...

Tom, maybe you got an idea?

Lennart

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


Re: [systemd-devel] How to debug blocking service start?

2015-04-07 Thread Lennart Poettering
On Sat, 04.04.15 15:33, Kai Hendry (hen...@webconverger.com) wrote:

 Thanks for the reply Lennart! I'm sorry I couldn't attend your FOSSASIA
 talk in Singapore. I was on holiday.
 
 On Sat, 4 Apr 2015, at 12:16 AM, Lennart Poettering wrote:
  something else that runs before it is hanging hence. What does
  systemctl list-jobs say before you run this and it hangs?
 
 [root@rpi2 ~]# systemctl list-jobs
 JOB UNIT TYPE  STATE
  95 surf.service start waiting
  97 systemd-networkd-wait-online.service start running
  96 network-online.targetstart waiting
 
 3 jobs listed.
 
 
 So, maybe the network-online target is not ever bring hit? I'm using
 systemd-networkd and I'm certainly online, so I am not sure where the
 problem lies. Any ideas?

Well, systemd-networkd-wait-online.service apparently disagrees with
whether you are online...

What does networkctl status say when this happens? And networkctl
status -a?

Lennart

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


Re: [systemd-devel] How to debug blocking service start?

2015-04-07 Thread Andrei Borzenkov
В Wed, 08 Apr 2015 10:31:18 +0800
Kai Hendry hen...@webconverger.com пишет:

 
 
 On Tue, 7 Apr 2015, at 11:13 PM, Lennart Poettering wrote:
  What does networkctl status say when this happens? And networkctl
  status -a?
 
 Oooh, I love those commands. Here is the output which says I'm routable:
 
 http://s.natalian.org/2015-04-08/networkctl.txt
 

I am not sure what configured means for networkd but comment says

/* wait for all links networkd manages to be in admin state 'configured'
   and at least one link to gain a carrier */

and you have one link in state configuring.

Now if networkd waits for carrier to start configuring interface logic
seems to be flawed somewhere.

 
 Maybe all of this has something to do with the way I've setup
 systemd-networkd. I have dejavu now... quite possibly this all is
 related to:
 https://bugs.freedesktop.org/show_bug.cgi?id=89352
 
 
 Kind regards,
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel

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


Re: [systemd-devel] How to debug blocking service start?

2015-04-07 Thread Kai Hendry


On Tue, 7 Apr 2015, at 11:13 PM, Lennart Poettering wrote:
 What does networkctl status say when this happens? And networkctl
 status -a?

Oooh, I love those commands. Here is the output which says I'm routable:

http://s.natalian.org/2015-04-08/networkctl.txt


Maybe all of this has something to do with the way I've setup
systemd-networkd. I have dejavu now... quite possibly this all is
related to:
https://bugs.freedesktop.org/show_bug.cgi?id=89352


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


Re: [systemd-devel] How to debug blocking service start?

2015-04-04 Thread Kai Hendry
Thanks for the reply Lennart! I'm sorry I couldn't attend your FOSSASIA
talk in Singapore. I was on holiday.

On Sat, 4 Apr 2015, at 12:16 AM, Lennart Poettering wrote:
 something else that runs before it is hanging hence. What does
 systemctl list-jobs say before you run this and it hangs?

[root@rpi2 ~]# systemctl list-jobs
JOB UNIT TYPE  STATE
 95 surf.service start waiting
 97 systemd-networkd-wait-online.service start running
 96 network-online.targetstart waiting

3 jobs listed.


So, maybe the network-online target is not ever bring hit? I'm using
systemd-networkd and I'm certainly online, so I am not sure where the
problem lies. Any ideas?

Here is the surf service file: http://ix.io/hiQ
This is my systemctl http://ix.io/hiR


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


Re: [systemd-devel] How to debug blocking service start?

2015-04-03 Thread Lennart Poettering
On Fri, 27.03.15 10:32, Kai Hendry (hen...@webconverger.com) wrote:

 First, thanks for trying to help me Kai. Awesome name btw.
 
 On Fri, 27 Mar 2015, at 03:26 AM, Kai Krakow wrote:
  Try Type=simple to not let it wait. That is telling systemd, that the
  binary 
  will not daemonize - athough it should be default according to [1].
 
 It's still getting stuck with Type=simple.
 
 http://s.natalian.org/2015-03-27/simple.png
 
 Isn't there a better way to debug than running journalctl -u service
 -f in parallel?
 
 The frustrating thing is that the SAME service file works fine on
 another rpi2.

With the unit file in the screenshot above (and the implied
Type=simple) systemd will fork off the process, and immediately
return. If the systemctl start operation hangs this means that
something else that runs before it is hanging hence. What does
systemctl list-jobs say before you run this and it hangs?

Lennart

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


Re: [systemd-devel] How to debug blocking service start?

2015-04-03 Thread Lennart Poettering
On Thu, 26.03.15 20:26, Kai Krakow (hurikha...@gmail.com) wrote:

 Kai Hendry hen...@webconverger.com schrieb:
 
  Hi there,
  
  How do I figure out why or where something is stuck?
  http://s.natalian.org/2015-03-25/systemd-start-issue.png
  
  `journalctl -u surf -f` prints nothing.
  
  Binary surf runs fine when I run it manually.
 
 It probably is not stuck, it's systemd waiting for the command to return. 
 Try Type=simple to not let it wait. That is telling systemd, that the binary 
 will not daemonize - athough it should be default according to [1].

Note that Type=simple is actually the implied default. Hence no need
to specify this explicitly.

Lennart

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


Re: [systemd-devel] How to debug blocking service start?

2015-03-27 Thread Martin Pitt
Hello Kai,

Kai Hendry [2015-03-27 12:18 +0800]:
 Wish there was a service validator service.

Not sure what you changed, but systemd-analyze verify foo.service
might be a good start?

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to debug blocking service start?

2015-03-26 Thread Kai Hendry
First, thanks for trying to help me Kai. Awesome name btw.

On Fri, 27 Mar 2015, at 03:26 AM, Kai Krakow wrote:
 Try Type=simple to not let it wait. That is telling systemd, that the
 binary 
 will not daemonize - athough it should be default according to [1].

It's still getting stuck with Type=simple.

http://s.natalian.org/2015-03-27/simple.png

Isn't there a better way to debug than running journalctl -u service
-f in parallel?

The frustrating thing is that the SAME service file works fine on
another rpi2.

 However, I'm not sure whether the rest of the setup will work. You should 
 probably make it a user service, so that you won't have to pass DISPLAY. 
 Your special setup may be part of the problem. Also keep in mind that 
 After=graphical.target doesn't imply that X11 is ready to accept
 connections 

You mean systemctl --user right?
https://wiki.archlinux.org/index.php/Systemd/User

I don't like that since it seems like a lot of extra crud. What's the
big deal about passing in the DISPLAY environment?

I don't see the point of having a non-root user. Trying to keep things
as simple as possible to achieve my use case. Which is to start a
browser once online.

 - even worse: it doesn't imply that it is started late in the boot 
 process. Your service may start as early as graphical.target becomes 
 scheduled to start [3] - and that may be well before even basic system
 setup 
 is finished. Instead, I suggest using a DM with autologin, and then spawn
 a 
 user service from there. As an alternative, you may want to try working
 with 
 timer units [2] to activate surf.service a few seconds after X11 is 
 guarenteed to be up, but that would just be a bandaid.

Well, if X wasn't up up, I was hoping Restart=always would do the rest.

 [1]: man systemd.service
 [2]: man systemd.timer

Timers seem like a kluge, just to know when X is ready.

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


Re: [systemd-devel] How to debug blocking service start?

2015-03-26 Thread Kai Hendry


On Fri, 27 Mar 2015, at 12:14 PM, Daurnimator wrote:
 My first guess based on that screenshot is case: Simple vs simple.

No I fixed that problem. :) http://ix.io/h8U

Wish there was a service validator service.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to debug blocking service start?

2015-03-26 Thread Daurnimator
On 27 March 2015 at 13:32, Kai Hendry hen...@webconverger.com wrote:
 It's still getting stuck with Type=simple.

 http://s.natalian.org/2015-03-27/simple.png

 Isn't there a better way to debug than running journalctl -u service
 -f in parallel?

 The frustrating thing is that the SAME service file works fine on
 another rpi2.

What does your .service file currently look like?
My first guess based on that screenshot is case: Simple vs simple.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] How to debug blocking service start?

2015-03-26 Thread Kai Krakow
Kai Hendry hen...@webconverger.com schrieb:

 Hi there,
 
 How do I figure out why or where something is stuck?
 http://s.natalian.org/2015-03-25/systemd-start-issue.png
 
 `journalctl -u surf -f` prints nothing.
 
 Binary surf runs fine when I run it manually.

It probably is not stuck, it's systemd waiting for the command to return. 
Try Type=simple to not let it wait. That is telling systemd, that the binary 
will not daemonize - athough it should be default according to [1].

However, I'm not sure whether the rest of the setup will work. You should 
probably make it a user service, so that you won't have to pass DISPLAY. 
Your special setup may be part of the problem. Also keep in mind that 
After=graphical.target doesn't imply that X11 is ready to accept connections 
- even worse: it doesn't imply that it is started late in the boot 
process. Your service may start as early as graphical.target becomes 
scheduled to start [3] - and that may be well before even basic system setup 
is finished. Instead, I suggest using a DM with autologin, and then spawn a 
user service from there. As an alternative, you may want to try working with 
timer units [2] to activate surf.service a few seconds after X11 is 
guarenteed to be up, but that would just be a bandaid.

[1]: man systemd.service
[2]: man systemd.timer

[3]: A target is, AFAIK, reached as soon as all services making up the 
target are scheduled to start - so you can rely on sockets being ready but 
nothing more. Targets are sets of functionality to offer, not points in time 
of the boot process - this is different to what you know of sysvinit. 
Multiple targets can be active at the same time, e.g. printer.target pulls 
in cups and becomes activated by udev if you plug in your printer.

-- 
Replies to list only preferred.

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


[systemd-devel] How to debug blocking service start?

2015-03-24 Thread Kai Hendry
Hi there,

How do I figure out why or where something is stuck?
http://s.natalian.org/2015-03-25/systemd-start-issue.png

`journalctl -u surf -f` prints nothing.

Binary surf runs fine when I run it manually.

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