Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 472328 - sys-fs/eudev-1.0 - rule-generator does not work, rename network interfaces with existing names failed
Summary: sys-fs/eudev-1.0 - rule-generator does not work, rename network interfaces wi...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: eudev team
URL:
Whiteboard:
Keywords:
: 475276 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-06-04 18:46 UTC by Alexey Prokopchuk
Modified: 2013-07-12 00:01 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Prokopchuk 2013-06-04 18:46:38 UTC
When use eudev in new freshly installed system, udevd does not create persistent-net.rules. If start udev in debug mode - following messages appears:

*****

May 20 14:45:09 router kernel: <31>udevd[2150]: 'write_net_rules'(err) 'info: unrecognized option '--run''
May 20 14:45:09 router kernel: <31>udevd[2152]: 'write_net_rules'(err) '+ RULES_FILE=/etc/udev/rules.d/70-persistent-net.rules'
May 20 14:45:09 router kernel: <31>udevd[2152]: 'write_net_rules'(err) '+ . /lib/udev/rule_generator.functions'

*****

May 20 14:45:09 router kernel: <31>udevd[2156]: passed -1 bytes to netlink monitor 0xa230f0
May 20 14:45:09 router kernel: <31>udevd[2156]: seq 2290 processed with 0
May 20 14:45:09 router kernel: <31>udevd[2150]: 'write_net_rules'(err) '+ RULES_FILE=/etc/udev/rules.d/70-persistent-net.rules'
May 20 14:45:09 router kernel: <31>udevd[2151]: 'write_net_rules'(err) '+ RULES_FILE=/etc/udev/rules.d/70-persistent-net.rules'
May 20 14:45:09 router kernel: <31>udevd[2150]: 'write_net_rules'(err) '+ . /lib/udev/rule_generator.functions'
May 20 14:45:09 router kernel: <31>udevd[2150]: 'write_net_rules'(err) '++ PATH=/sbin:/bin'
May 20 14:45:09 router kernel: <31>udevd[2150]: 'write_net_rules'(err) '++ PATH=/sbin:/bin'

******

When I create rules by hand, system startup hangs in "Waiting for uevents to be processed" on 2-3 seconds and i have interface "eth2.rename" instead of eth1. Nothing in logs about described above.

Unfortunately, I can't reproduce this now (system not in my hands). But I can try reproduce it in my home system.

I tried to research what can be happened and found that udevadm does not have option '--run' with command 'info'.

Thanks for attention.
Comment 1 Anthony Basile gentoo-dev 2013-06-05 14:11:23 UTC
I'm working on a new release now.  If you can give me cleaner steps to reproduce, I can probably nail it.
Comment 2 Anthony Basile gentoo-dev 2013-06-05 14:51:04 UTC
Oh wait, did you do rc-update add udev-postmount default?
Comment 3 Alexey Prokopchuk 2013-06-05 16:39:29 UTC
(In reply to Anthony Basile from comment #1)
>I'm working on a new release now.  If you can give me cleaner steps to >reproduce, I can probably nail it.

1. Remove directory /etc/udev/rules.d
2. Reboot (reload/restart udev)

reboot or restart/reload udev does not create persistent-net.rules

In case with renaming create or modify existing persistent-net.rules and reboot (reload/restart udev). I don't know why, but 'udevadm trigger' does not sufficient for applying rules to device names.

(In reply to Anthony Basile from comment #2)
> Oh wait, did you do rc-update add udev-postmount default?

Of course, I did it :)
Comment 4 Anthony Basile gentoo-dev 2013-07-04 00:30:37 UTC
(In reply to Alexey Prokopchuk from comment #3)
> (In reply to Anthony Basile from comment #1)
> >I'm working on a new release now.  If you can give me cleaner steps to >reproduce, I can probably nail it.
> 
> 1. Remove directory /etc/udev/rules.d
> 2. Reboot (reload/restart udev)
> 
> reboot or restart/reload udev does not create persistent-net.rules
> 
> In case with renaming create or modify existing persistent-net.rules and
> reboot (reload/restart udev). I don't know why, but 'udevadm trigger' does
> not sufficient for applying rules to device names.
> 
> (In reply to Anthony Basile from comment #2)
> > Oh wait, did you do rc-update add udev-postmount default?
> 
> Of course, I did it :)

Okay we've go this working with eudev-9999.  There were actually two things that were broken making it hard to find.  We've tested along the lines described in bug #475276 and its good.

Can you please test and let us know.
Comment 5 Anthony Basile gentoo-dev 2013-07-04 00:33:27 UTC
(In reply to Alexey Prokopchuk from comment #3)

> 1. Remove directory /etc/udev/rules.d
> 

Actually don't remove the directory, just its contents.  We can work on making this more robust, but as of right now, if the directory isn't there, the 70-persistent-X rules are not written.
Comment 6 Anthony Basile gentoo-dev 2013-07-04 00:34:36 UTC
*** Bug 475276 has been marked as a duplicate of this bug. ***
Comment 7 Ian Stakenvicius (RETIRED) gentoo-dev 2013-07-04 15:24:31 UTC
(In reply to Anthony Basile from comment #5)
> (In reply to Alexey Prokopchuk from comment #3)
> 
> > 1. Remove directory /etc/udev/rules.d
> > 
> 
> Actually don't remove the directory, just its contents.  We can work on
> making this more robust, but as of right now, if the directory isn't there,
> the 70-persistent-X rules are not written.

I think udev-postmount should probably create that dir if missing, in case a user does remove it on their own.  Will commit a change to portage prior to the next release.
Comment 8 Anthony Basile gentoo-dev 2013-07-04 17:33:30 UTC
(In reply to Ian Stakenvicius from comment #7)
> (In reply to Anthony Basile from comment #5)
> > (In reply to Alexey Prokopchuk from comment #3)
> > 
> > > 1. Remove directory /etc/udev/rules.d
> > > 
> > 
> > Actually don't remove the directory, just its contents.  We can work on
> > making this more robust, but as of right now, if the directory isn't there,
> > the 70-persistent-X rules are not written.
> 
> I think udev-postmount should probably create that dir if missing, in case a
> user does remove it on their own.  Will commit a change to portage prior to
> the next release.

Yeah that works for me.  I have mixed feelings about what to do when users go around deleting stuff installed by package.  In this case, suppose I *want* this behavior?
Comment 9 Ian Stakenvicius (RETIRED) gentoo-dev 2013-07-04 19:24:05 UTC
(In reply to Anthony Basile from comment #8)
> (In reply to Ian Stakenvicius from comment #7)
> > (In reply to Anthony Basile from comment #5)
> > > (In reply to Alexey Prokopchuk from comment #3)
> > > 
> > > > 1. Remove directory /etc/udev/rules.d
> > > > 
> > > 
> > > Actually don't remove the directory, just its contents.  We can work on
> > > making this more robust, but as of right now, if the directory isn't there,
> > > the 70-persistent-X rules are not written.
> > 
> > I think udev-postmount should probably create that dir if missing, in case a
> > user does remove it on their own.  Will commit a change to portage prior to
> > the next release.
> 
> Yeah that works for me.  I have mixed feelings about what to do when users
> go around deleting stuff installed by package.  In this case, suppose I
> *want* this behavior?

It's a path-must-exist-at-runtime issue; if it doesn't (user did something silly), make sure it does.  Even though we install that dir now as part of eudev's build system, if the user removes it then udev-postmount (as well as write_net_rules, probably?) will still fail.  

..Actually I wonder if that means write_net_rules (or rule_generator.functions) should create that dir if it's missing...
Comment 10 Ian Stakenvicius (RETIRED) gentoo-dev 2013-07-04 21:23:32 UTC
(In reply to Ian Stakenvicius from comment #9)
> (In reply to Anthony Basile from comment #8)
> > (In reply to Ian Stakenvicius from comment #7)
> > > (In reply to Anthony Basile from comment #5)
> > > > (In reply to Alexey Prokopchuk from comment #3)
> > > > 
> > > > > 1. Remove directory /etc/udev/rules.d
> > > > > 
> > > > 
> > > > Actually don't remove the directory, just its contents.  We can work on
> > > > making this more robust, but as of right now, if the directory isn't there,
> > > > the 70-persistent-X rules are not written.
> > > 
> > > I think udev-postmount should probably create that dir if missing, in case a
> > > user does remove it on their own.  Will commit a change to portage prior to
> > > the next release.
> > 
> > Yeah that works for me.  I have mixed feelings about what to do when users
> > go around deleting stuff installed by package.  In this case, suppose I
> > *want* this behavior?
> 
> It's a path-must-exist-at-runtime issue; if it doesn't (user did something
> silly), make sure it does.  Even though we install that dir now as part of
> eudev's build system, if the user removes it then udev-postmount (as well as
> write_net_rules, probably?) will still fail.  
> 
> ..Actually I wonder if that means write_net_rules (or
> rule_generator.functions) should create that dir if it's missing...


..something along the lines of: 

--- a/rule_generator/rule_generator.functions
+++ b/rule_generator/rule_generator.functions
@@ -76,6 +76,10 @@ choose_rules_file() {
        local tmp_rules_file="$RUNDIR/tmp-rules--${RULES_FILE##*/}"
        [ -e "$RULES_FILE" -o -e "$tmp_rules_file" ] || PRINT_HEADER=1
 
+       [ -d "${RULES_FILE%/*}" ] || if writeable ${RULES_FILE%/rules.d/*}; then
+               mkdir -p "${RULES_FILE%/*}"
+       fi
+
        if writeable ${RULES_FILE%/*}; then
                RO_RULES_FILE='/dev/null'
        else


.. good idea to apply, or no?
Comment 11 Anthony Basile gentoo-dev 2013-07-09 06:00:07 UTC
(In reply to Ian Stakenvicius from comment #10)
> (In reply to Ian Stakenvicius from comment #9)
> > (In reply to Anthony Basile from comment #8)
> > > (In reply to Ian Stakenvicius from comment #7)
> > > > (In reply to Anthony Basile from comment #5)
> > > > > (In reply to Alexey Prokopchuk from comment #3)
> > > > > 
> > > > > > 1. Remove directory /etc/udev/rules.d
> > > > > > 
> > > > > 
> > > > > Actually don't remove the directory, just its contents.  We can work on
> > > > > making this more robust, but as of right now, if the directory isn't there,
> > > > > the 70-persistent-X rules are not written.
> > > > 
> > > > I think udev-postmount should probably create that dir if missing, in case a
> > > > user does remove it on their own.  Will commit a change to portage prior to
> > > > the next release.
> > > 
> > > Yeah that works for me.  I have mixed feelings about what to do when users
> > > go around deleting stuff installed by package.  In this case, suppose I
> > > *want* this behavior?
> > 
> > It's a path-must-exist-at-runtime issue; if it doesn't (user did something
> > silly), make sure it does.  Even though we install that dir now as part of
> > eudev's build system, if the user removes it then udev-postmount (as well as
> > write_net_rules, probably?) will still fail.  
> > 
> > ..Actually I wonder if that means write_net_rules (or
> > rule_generator.functions) should create that dir if it's missing...
> 
> 
> ..something along the lines of: 
> 
> --- a/rule_generator/rule_generator.functions
> +++ b/rule_generator/rule_generator.functions
> @@ -76,6 +76,10 @@ choose_rules_file() {
>         local tmp_rules_file="$RUNDIR/tmp-rules--${RULES_FILE##*/}"
>         [ -e "$RULES_FILE" -o -e "$tmp_rules_file" ] || PRINT_HEADER=1
>  
> +       [ -d "${RULES_FILE%/*}" ] || if writeable ${RULES_FILE%/rules.d/*};
> then
> +               mkdir -p "${RULES_FILE%/*}"
> +       fi
> +
>         if writeable ${RULES_FILE%/*}; then
>                 RO_RULES_FILE='/dev/null'
>         else
> 
> 
> .. good idea to apply, or no?

Yes please apply and then we'll test.
Comment 12 Anthony Basile gentoo-dev 2013-07-12 00:01:59 UTC
This should all be fixed with eudev-1.1 which is in the tree now.  Thanks everyone!

Please reopen if this is still an issue.