PDA

View Full Version : Autoyast with udev rules = Segfault



fclariolli
21-Feb-2012, 11:47
Hello all,

my first post in the forums, I hope this is the right section for the post. I come from a different background (mainly Solaris and Red Hat) and trying to move first steps in the Suse world, so far so good but I've a problem that I'm unable to solve.

As per title we are deploying some SLES machines via PXE and autoyast configuration files, as these servers are equipped with multiple network cards with different manufacturer/speed/specs I would need to define the network card name in a predictable way so reading around I've found this article (http://www.novell.com/support/search.do?cmd=displayKC&docType=kc&externalId=7006937&sliceId=1&docTypeID=DT_TID_1_1) which explains how to do this via udev rules but whatver I try to implement it I get a segmentation fault after the first reboot and the auconfiguration is not completed leaving me with a server I cannot even access as all passwords/users are managed through post-install scripts. If this makes any difference I also configure bond networks via autoyast, below the interesting bits of my configuration :

<networking>
....
<interface>
<bonding_master>yes</bonding_master>
<bonding_module_opts>mode=active-backup miimon=100</bonding_module_opts>
<bonding_slave0>eth0</bonding_slave0>
<bonding_slave1>eth1</bonding_slave1>
<bootproto>static</bootproto>
<device>bond0</device>
<ipaddr>MY_IP_ADDRESS</ipaddr>
<netmask>MASK</netmask>
<prefixlen>CIDR_MASK</prefixlen>
<startmode>auto</startmode>
<usercontrol>no</usercontrol>
</interface>
</interfaces>
...
</networking>

This works like a charm but if I add the following code to control the udev rules the machine segfaults and does not complete correctly :

<interfaces config:type="list">
<net-udev config:type="list">
<rule>
<name>eth0</name>
<rule>ID</rule>
<value>0000:00:00.1</value>
</rule>
<rule>
<name>eth1</name>
<rule>ID</rule>
<value>0000:00:00.0</value>
</rule>
</net-udev>

As you can see I do this using the bus system ID of the network card and not the mac address, so not sure if this is causing the problem or makes anything different.

Any idea or pointer? Am I doing something wrong?

Thanks in advance!

malcolmlewis
21-Feb-2012, 15:20
Hello all,

my first post in the forums, I hope this is the right section for the
post. I come from a different background (mainly Solaris and Red Hat)
and trying to move first steps in the Suse world, so far so good but
I've a problem that I'm unable to solve.

As per title we are deploying some SLES machines via PXE and autoyast
configuration files, as these servers are equipped with multiple network
cards with different manufacturer/speed/specs I would need to define the
network card name in a predictable way so reading around I've found this
'article'
(http://www.novell.com/support/search.do?cmd=displayKC&docType=kc&externalId=7006937&sliceId=1&docTypeID=DT_TID_1_1)
which explains how to do this via udev rules but whatver I try to
implement it I get a segmentation fault after the first reboot and the
auconfiguration is not completed leaving me with a server I cannot even
access as all passwords/users are managed through post-install scripts.
If this makes any difference I also configure bond networks via
autoyast, below the interesting bits of my configuration :

<networking>
....
<interface>
<bonding_master>yes</bonding_master>
<bonding_module_opts>mode=active-backup
miimon=100</bonding_module_opts>
<bonding_slave0>eth0</bonding_slave0>
<bonding_slave1>eth1</bonding_slave1>
<bootproto>static</bootproto>
<device>bond0</device>
<ipaddr>MY_IP_ADDRESS</ipaddr>
<netmask>MASK</netmask>
<prefixlen>CIDR_MASK</prefixlen>
<startmode>auto</startmode>
<usercontrol>no</usercontrol>
</interface>
</interfaces>
...
</networking>

This works like a charm but if I add the following code to control the
udev rules the machine segfaults and does not complete correctly :

<interfaces config:type="list">
<net-udev config:type="list">
<rule>
<name>eth0</name>
<rule>ID</rule>
<value>0000:00:00.1</value>
</rule>
<rule>
<name>eth1</name>
<rule>ID</rule>
<value>0000:00:00.0</value>
</rule>
</net-udev>

As you can see I do this using the bus system ID of the network card
and not the mac address, so not sure if this is causing the problem or
makes anything different.

Any idea or pointer? Am I doing something wrong?

Thanks in advance!



Hi
Are you sure the values for the SysFS BusID are correct? Can you check
the ID's via;


/sbin/lspci -nnk


--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 3.0.13-0.27-default
up 2 days 16:53, 4 users, load average: 0.00, 0.01, 0.05
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

fclariolli
21-Feb-2012, 15:54
Hi
Are you sure the values for the SysFS BusID are correct?


Hi malcolm first of all thanks for your quick reply.

As far as I can tell yes, the ones in the post are just an example I've written not the actual codes, anyhow I gather them via


hwinfo --netcard

As per KB article.



Can you check
the ID's via;


/sbin/lspci -nnk


Yup I've tried this as well and the ID is correctly there for all the network cards installed on the system as per hwinfo.

I even tried to paste the ID in lspci format (without the leading 0s) in the autoyast file without any success.

malcolmlewis
21-Feb-2012, 16:19
malcolmlewis;2535 Wrote:
> Hi
> Are you sure the values for the SysFS BusID are correct?
>

Hi malcolm first of all thanks for your quick reply.

As far as I can tell yes, the ones in the post are just an example I've
written not the actual codes, anyhow I gather them via


Code:
--------------------
hwinfo --netcard
--------------------


As per KB article.

malcolmlewis;2535 Wrote:
>
> Can you check
> the ID's via;
> >
Code:
--------------------
> >
> /sbin/lspci -nnk
>
--------------------
> >
>
Yup I've tried this as well and the ID is correctly there for all the
network cards installed on the system as per hwinfo.

I even tried to paste the ID in lspci format (without the leading 0s)
in the autoyast file without any success.



Hi
OK, just checking because all 0's is the host controller for the RAM
generally.....

So have you tried creating the rules without the bonding?

What editor are you using to create the file, not getting a trailing ^M
in there?

--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 3.0.13-0.27-default
up 2 days 17:55, 3 users, load average: 0.00, 0.01, 0.14
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

fclariolli
21-Feb-2012, 16:41
No the server has not been reinstalled without the bonding, part because I did not have time (next on the to do list) part because having the bond there is a requirement... well in case I can script this.

As per editor I'm using VI, is there anything else :) ? So no "dirty" characters in the config file.

Between tonight (4:40pm here) and tomorrow I will try to put aside some spare time and rebuild the server without the bond configuration and will let you know how it went.

Thanks once again!

fclariolli
21-Feb-2012, 18:21
Ok finally found where the problem was.

Making a long story short I basically had a "<interfaces config:type="list">" in the wrong place just before the udev rules, while it did not cause the installer to complain it segfaulted when configuring network as per ay.xml file.

I did not notice this immediately but only when I edited the file trying to remove the bond configuration, I removed it and put just AFTER the udev rules and now everything is working as intended, I feel both silly and relieved :)

On a side note I was wondering if any script or tool to validate autoyast xml file do exist, it would be handy in situations like this eheheh

Againthanks for your help and for pointing me in the right direction.

Cheers F.

malcolmlewis
21-Feb-2012, 18:57
Ok finally found where the problem was.

Making a long story short I basically had a "<interfaces
config:type="list">" in the wrong place just before the udev rules,
while it did not cause the installer to complain it segfaulted when
configuring network as per ay.xml file.

I did not notice this immediately but only when I edited the file
trying to remove the bond configuration, I removed it and put just AFTER
the udev rules and now everything is working as intended, I feel both
silly and relieved :)

On a side note I was wondering if any script or tool to validate
autoyast xml file do exist, it would be handy in situations like this
eheheh

Againthanks for your help and for pointing me in the right direction.

Cheers F.


Hi
A second set of eyes helps ;) Have you see this
http://users.suse.com/~ug/AutoYaST_FAQ.html

Not sure about a specific program that validates autoyast files, maybe
use color in vi?

You can post actual configs etc, just put in between the code tags if
it's a large file, then there is also http://paste.opensuse.org/ and you
can select the file format, eg diff, xml etc. Just set the expire to
never expire (and make it private if you want).

There are other options, like http://susestudio.com you can upload your
autoyast files and build the system, test the build in 'Test
Drive', modify it etc and create your own install dvd, cd image etc.
Might be worth while to investigate at least for your testing.

--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 3.0.13-0.27-default
up 2 days 20:29, 3 users, load average: 0.14, 0.08, 0.11
CPU Intel i5 CPU M520@2.40GHz | Intel Arrandale GPU

fclariolli
22-Feb-2012, 20:55
Thanks Malcolm, I already have 4 eyes... but it seems they are not enough ;)

I already do use colors in vi but you know I'm a lazy person eheheh I will give the suse studio a go even if not sure if that can help as in my testing use of custom kernel and repos for packages we develop internally is involved but that's the easy part.

Again thanks for the well worth of info and help you gave me.

Cheers F.