Re: [systemd-devel] systemd and kernel process

2015-10-01 Thread Kay Sievers
On Wed, Sep 30, 2015 at 10:49 PM, Steve Dickson  wrote:
> Is there a way for systemd to monitor kernel process?
> By monitor I mean the existence.

No, and there is no plan to do anything like that.

Kernel tasks are kernel internals, and userspace must not make any
assumptions about them. They can come and go at any time between any
kernel versions.

Custom tools can do what they need, but systemd should not offer to do
that to users.

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


Re: [systemd-devel] failed to change interface name (systemd-networkd)

2015-10-01 Thread James
Hello, just following up to see if there were any ideas on what may be
causing this.

Any thoughts appreciated.

On Wed, Sep 23, 2015 at 10:17 PM, James  wrote:
> Hello,
>
> Hoping someone can point me in the right direction. I'm attempting to
> change the interface name (eth0 -> wired) on one of my servers.
>
> Here's the output from the journal:
>
> ~# journalctl --no-pager | grep -i wired
> Sep 23 17:11:15 vivid systemd-udevd[399]: error changing net interface
> name 'eth0' to 'wired0': Device or resource busy
> Sep 23 17:11:15 vivid systemd-udevd[399]: could not rename interface
> '2' from 'eth0' to 'wired0': Device or resource busy
> Sep 23 17:11:17 vivid sh[566]: Unknown interface wired0
> Sep 23 17:11:17 vivid systemd[1]: Started ifup for wired0.
> Sep 23 17:11:17 vivid systemd[1]: Starting ifup for wired0...
>
> Here's what the .link contains:
>
> # cat 10-ethernet.link
> [Match]
> MACAddress=fa:16:3e:31:7a:4b
> [Link]
> Name=wired0
> MACAddress=fa:15:33:55:33:44
>
> And the .network:
>
> # cat 20-ethernet.network
> [Match]
> Name=wired*
> [Network]
> DNS=8.8.8.8
> DNS=8.8.4.4
> [Address]
> Address=10.1.1.190/24
> [Route]
> Destination=0.0.0.0/0
> Gateway=10.1.1.1
>
> The MAC address of the interface changes properly, so I know that the
> unit is at least being read and parsed.
>
> As an aside, this is happening on Ubuntu 15.04. I've disabled
> NetworkManager and am relying, obviously, on systemd-networkd and
> systemd-resolved. I've also temporarily disabled dhcpd thinking that
> may have had something to do with the interface being busy, to no
> avail.
>
> Any thoughts on why the interface is busy resulting in the name change 
> failing?
>
> Thanks!
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] failed to change interface name (systemd-networkd)

2015-10-01 Thread James
Thanks Kay - that jives with what I was thinking, as well. Is there a
good way to tell?

I've used systemd-analyze critical-chain to see if there is something
being kicked off by systemd before the network scripts can run, but
alas it appears that none of the systemd units are the culprit here.

I'm running into this issue on Ubuntu 15.04 (Vivid). If there are any
pointers on how to best determine the script / root cause I'd be very
much appreciative.

Thank you.

On Thu, Oct 1, 2015 at 2:31 PM, Kay Sievers  wrote:
> On Thu, Oct 1, 2015 at 7:21 PM, James  wrote:
>> Hello, just following up to see if there were any ideas on what may be
>> causing this.
>>
>> Any thoughts appreciated.
>>
>> On Wed, Sep 23, 2015 at 10:17 PM, James  wrote:
>>> Hello,
>>>
>>> Hoping someone can point me in the right direction. I'm attempting to
>>> change the interface name (eth0 -> wired) on one of my servers.
>>>
>>> Here's the output from the journal:
>>>
>>> ~# journalctl --no-pager | grep -i wired
>>> Sep 23 17:11:15 vivid systemd-udevd[399]: error changing net interface
>>> name 'eth0' to 'wired0': Device or resource busy
>>> Sep 23 17:11:15 vivid systemd-udevd[399]: could not rename interface
>>> '2' from 'eth0' to 'wired0': Device or resource busy
>>> Sep 23 17:11:17 vivid sh[566]: Unknown interface wired0
>>> Sep 23 17:11:17 vivid systemd[1]: Started ifup for wired0.
>>> Sep 23 17:11:17 vivid systemd[1]: Starting ifup for wired0...
>>>
>>> Here's what the .link contains:
>>>
>>> # cat 10-ethernet.link
>>> [Match]
>>> MACAddress=fa:16:3e:31:7a:4b
>>> [Link]
>>> Name=wired0
>>> MACAddress=fa:15:33:55:33:44
>>>
>>> And the .network:
>>>
>>> # cat 20-ethernet.network
>>> [Match]
>>> Name=wired*
>>> [Network]
>>> DNS=8.8.8.8
>>> DNS=8.8.4.4
>>> [Address]
>>> Address=10.1.1.190/24
>>> [Route]
>>> Destination=0.0.0.0/0
>>> Gateway=10.1.1.1
>>>
>>> The MAC address of the interface changes properly, so I know that the
>>> unit is at least being read and parsed.
>>>
>>> As an aside, this is happening on Ubuntu 15.04. I've disabled
>>> NetworkManager and am relying, obviously, on systemd-networkd and
>>> systemd-resolved. I've also temporarily disabled dhcpd thinking that
>>> may have had something to do with the interface being busy, to no
>>> avail.
>>>
>>> Any thoughts on why the interface is busy resulting in the name change 
>>> failing?
>
> Most likely you have some other daemon running, or a script executed
> by udev, or the interface is found by some init script, something that
> brings the interface up before the attempt to rename it by
> udev/networkd.
>
> Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] failed to change interface name (systemd-networkd)

2015-10-01 Thread Kay Sievers
On Thu, Oct 1, 2015 at 7:21 PM, James  wrote:
> Hello, just following up to see if there were any ideas on what may be
> causing this.
>
> Any thoughts appreciated.
>
> On Wed, Sep 23, 2015 at 10:17 PM, James  wrote:
>> Hello,
>>
>> Hoping someone can point me in the right direction. I'm attempting to
>> change the interface name (eth0 -> wired) on one of my servers.
>>
>> Here's the output from the journal:
>>
>> ~# journalctl --no-pager | grep -i wired
>> Sep 23 17:11:15 vivid systemd-udevd[399]: error changing net interface
>> name 'eth0' to 'wired0': Device or resource busy
>> Sep 23 17:11:15 vivid systemd-udevd[399]: could not rename interface
>> '2' from 'eth0' to 'wired0': Device or resource busy
>> Sep 23 17:11:17 vivid sh[566]: Unknown interface wired0
>> Sep 23 17:11:17 vivid systemd[1]: Started ifup for wired0.
>> Sep 23 17:11:17 vivid systemd[1]: Starting ifup for wired0...
>>
>> Here's what the .link contains:
>>
>> # cat 10-ethernet.link
>> [Match]
>> MACAddress=fa:16:3e:31:7a:4b
>> [Link]
>> Name=wired0
>> MACAddress=fa:15:33:55:33:44
>>
>> And the .network:
>>
>> # cat 20-ethernet.network
>> [Match]
>> Name=wired*
>> [Network]
>> DNS=8.8.8.8
>> DNS=8.8.4.4
>> [Address]
>> Address=10.1.1.190/24
>> [Route]
>> Destination=0.0.0.0/0
>> Gateway=10.1.1.1
>>
>> The MAC address of the interface changes properly, so I know that the
>> unit is at least being read and parsed.
>>
>> As an aside, this is happening on Ubuntu 15.04. I've disabled
>> NetworkManager and am relying, obviously, on systemd-networkd and
>> systemd-resolved. I've also temporarily disabled dhcpd thinking that
>> may have had something to do with the interface being busy, to no
>> avail.
>>
>> Any thoughts on why the interface is busy resulting in the name change 
>> failing?

Most likely you have some other daemon running, or a script executed
by udev, or the interface is found by some init script, something that
brings the interface up before the attempt to rename it by
udev/networkd.

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


Re: [systemd-devel] systemd and kernel process

2015-10-01 Thread Steve Dickson


On 10/01/2015 09:24 AM, Kay Sievers wrote:
> On Wed, Sep 30, 2015 at 10:49 PM, Steve Dickson  wrote:
>> Is there a way for systemd to monitor kernel process?
>> By monitor I mean the existence.
> 
> No, and there is no plan to do anything like that.
> 
> Kernel tasks are kernel internals, and userspace must not make any
> assumptions about them. They can come and go at any time between any
> kernel versions.
> 
> Custom tools can do what they need, but systemd should not offer to do
> that to users.
First all thanks for the response

kernel process in question is nfsd. The number of thread 
is kept in /proc/fs/nfsd/threads. 

So the idea would be doing a systemctl status nfsd 
and number in /proc/fs/nfsd/threads is zero the
service would be deactive. An non-zero number the
service would active. 

Is this something systemd could be used for?

tia,

steved.

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


Re: [systemd-devel] systemd and kernel process

2015-10-01 Thread Kay Sievers
On Thu, Oct 1, 2015 at 9:30 PM, Steve Dickson  wrote:
>
>
> On 10/01/2015 09:24 AM, Kay Sievers wrote:
>> On Wed, Sep 30, 2015 at 10:49 PM, Steve Dickson  wrote:
>>> Is there a way for systemd to monitor kernel process?
>>> By monitor I mean the existence.
>>
>> No, and there is no plan to do anything like that.
>>
>> Kernel tasks are kernel internals, and userspace must not make any
>> assumptions about them. They can come and go at any time between any
>> kernel versions.
>>
>> Custom tools can do what they need, but systemd should not offer to do
>> that to users.
> First all thanks for the response
>
> kernel process in question is nfsd. The number of thread
> is kept in /proc/fs/nfsd/threads.
>
> So the idea would be doing a systemctl status nfsd
> and number in /proc/fs/nfsd/threads is zero the
> service would be deactive. An non-zero number the
> service would active.
>
> Is this something systemd could be used for?

No, not directly. There is no facility to watch /proc or any other
similar interface for such changes. Plain /proc directories are just
not capable of providing event information to userspace.

The kernel's nfs implementation would need a character device where
events are send out, or possibly a poll()able file in /proc, or
something in /sys/devices/, or a similar approach, where udev can
react to. Such interface could be used to signal systemd that
userspace should react to state changes in the kernel.

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