Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
TIP: Complete network stack without net.* scripts
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6709
Location: Blighty

PostPosted: Mon Sep 08, 2014 2:45 pm    Post subject: Reply with quote

charles17 wrote:
Thanks for your fast action. Compilation works and I did a first test with "99-openrc".
Code:
set -x
# https://bugs.gentoo.org/show_bug.cgi?id=522206#c1

if $if_oneup && if_ipwaited then;
   mark_service_started dhcpcd
else
   mark_service_inactive dhcpcd
fi


Try this

Code:
if $if_oneup && if_ipwaited; then
   mark_service_started dhcpcd
else
   mark_service_inactive dhcpcd
fi


Notice the position of the ;
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2569

PostPosted: Mon Sep 08, 2014 3:10 pm    Post subject: Reply with quote

That one error has gone. But how to deal with the following?
Quote:
$ su -c "dhcpcd -DB"
Password:
dhcpcd[7566]: version 6.4.3 starting
dhcpcd[7566]: dev: loaded udev
++ false
++ mark_service_inactive dhcpcd
/lib/dhcpcd/dhcpcd-hooks/99-openrc: line 7: mark_service_inactive: command not found
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
++ false
++ mark_service_inactive dhcpcd
/lib/dhcpcd/dhcpcd-hooks/99-openrc: line 7: mark_service_inactive: command not found
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
++ false
++ mark_service_inactive dhcpcd
/lib/dhcpcd/dhcpcd-hooks/99-openrc: line 7: mark_service_inactive: command not found
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
++ false
++ mark_service_inactive dhcpcd
/lib/dhcpcd/dhcpcd-hooks/99-openrc: line 7: mark_service_inactive: command not found
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[7566]: enp2s14: waiting for carrier
dhcpcd[7566]: DUID 00:01:00:01:0f:02:bb:59:00:1b:77:b1:c8:8e
dhcpcd[7566]: wlp8s0: IAID 77:b1:c8:8e
ntpd | * Stopping ntpd ... [ ok ]
ntpd | * Starting ntpd ... [ ok ]
dhcpcd[7566]: wlp8s0: rebinding lease of 192.168.178.23
dhcpcd[7566]: wlp8s0: leased 192.168.178.23 for 864000 seconds
dhcpcd[7566]: wlp8s0: adding route to 192.168.178.0/24
dhcpcd[7566]: wlp8s0: adding default route via 192.168.178.1
++ true
++ if_ipwaited
/lib/dhcpcd/dhcpcd-hooks/99-openrc: line 4: if_ipwaited: command not found
++ mark_service_inactive dhcpcd
/lib/dhcpcd/dhcpcd-hooks/99-openrc: line 7: mark_service_inactive: command not found
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
ntpd | * Stopping ntpd ... [ ok ]
ntpd | * Starting ntpd ... [ ok ]
dhcpcd[7566]: wlp8s0: soliciting an IPv6 router
dhcpcd[7566]: wlp8s0: no IPv6 Routers available
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6709
Location: Blighty

PostPosted: Mon Sep 08, 2014 3:22 pm    Post subject: Reply with quote

Maybe the mark_service foo isn't in $PATH?
Try appending the path to them where it is
/lib/rc/sbin/mark_service_inactive dhcpcd
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2569

PostPosted: Mon Sep 08, 2014 4:09 pm    Post subject: Reply with quote

Much better, with
Code:
if $if_oneup && if_ipwaited; then
        /lib/rc/sbin/mark_service_started dhcpcd
else
        /lib/rc/sbin/mark_service_inactive dhcpcd
fi
I get some problem with if_ipwaited and if_disable_autolinklocal
Quote:
$ su -c "dhcpcd -dB"
Password:
dhcpcd[10816]: version 6.4.3 starting
dhcpcd[10816]: udev: starting
dhcpcd[10816]: dev: loaded udev
dhcpcd[10816]: enp2s14: if_disable_autolinklocal: Invalid argument
dhcpcd[10816]: wlp8s0: if_disable_autolinklocal: Invalid argument
dhcpcd[10816]: enp2s14: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
++ false
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[10816]: enp2s14: executing `/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER
++ false
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[10816]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
++ false
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[10816]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
++ false
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[10816]: enp2s14: waiting for carrier
dhcpcd[10816]: DUID 00:01:00:01:0f:02:bb:59:00:1b:77:b1:c8:8e
dhcpcd[10816]: wlp8s0: IAID 77:b1:c8:8e
dhcpcd[10816]: wlp8s0: delaying IPv6 router solictation for 0.9 seconds
dhcpcd[10816]: wlp8s0: delaying DHCP for 0.1 seconds
ntpd | * Stopping ntpd ... [ ok ]
dhcpcd[10816]: wlp8s0: reading lease `/var/lib/dhcpcd/dhcpcd-wlp8s0.lease'
dhcpcd[10816]: wlp8s0: rebinding lease of 192.168.178.23
dhcpcd[10816]: wlp8s0: sending REQUEST (xid 0xa35ac8ac), next in 4.3 seconds
dhcpcd[10816]: wlp8s0: acknowledged 192.168.178.23 from 192.168.178.1
dhcpcd[10816]: wlp8s0: leased 192.168.178.23 for 864000 seconds
dhcpcd[10816]: wlp8s0: renew in 432000 seconds, rebind in 756000 seconds
dhcpcd[10816]: wlp8s0: IP address 192.168.178.23/24 already exists
dhcpcd[10816]: wlp8s0: adding route to 192.168.178.0/24
dhcpcd[10816]: wlp8s0: adding default route via 192.168.178.1
dhcpcd[10816]: wlp8s0: writing lease `/var/lib/dhcpcd/dhcpcd-wlp8s0.lease'
dhcpcd[10816]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' REBOOT
ntpd | * Starting ntpd ... [ ok ]
++ true
++ if_ipwaited
/lib/dhcpcd/dhcpcd-hooks/99-openrc: line 4: if_ipwaited: command not found
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[10816]: wlp8s0: sending ARP announce (1 of 2), next in 2.0 seconds
ntpd | * Stopping ntpd ... [ ok ]
ntpd | * Starting ntpd ... [ ok ]
dhcpcd[10816]: wlp8s0: soliciting an IPv6 router
dhcpcd[10816]: wlp8s0: sending Router Solicitation
dhcpcd[10816]: wlp8s0: sending ARP announce (2 of 2)
dhcpcd[10816]: wlp8s0: sending Router Solicitation
dhcpcd[10816]: wlp8s0: sending Router Solicitation
dhcpcd[10816]: wlp8s0: sending Router Solicitation
dhcpcd[10816]: wlp8s0: no IPv6 Routers available
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6709
Location: Blighty

PostPosted: Mon Sep 08, 2014 4:23 pm    Post subject: Reply with quote

charles17 wrote:
Much better, with
Code:
if $if_oneup && if_ipwaited; then
        /lib/rc/sbin/mark_service_started dhcpcd
else
        /lib/rc/sbin/mark_service_inactive dhcpcd
fi
I get some problem with if_ipwaited and if_disable_autolinklocal


Code:
if $if_oneup && $if_ipwaited; then


Notice the $ before each variable name

if_disable_autolinklocal: This is reported because your kernel is too old for the feature and it's only reported when debugging is enabled.
You should be good to go now :)
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2569

PostPosted: Mon Sep 08, 2014 5:00 pm    Post subject: Reply with quote

Thanks so much. Starting manually seems ok now.
Quote:
$ su -c "dhcpcd -dB"
Password:
dhcpcd[3494]: version 6.4.3 starting
dhcpcd[3494]: udev: starting
dhcpcd[3494]: dev: loaded udev
dhcpcd[3494]: enp2s14: if_disable_autolinklocal: Invalid argument
dhcpcd[3494]: wlp8s0: if_disable_autolinklocal: Invalid argument
dhcpcd[3494]: enp2s14: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
++ false
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[3494]: enp2s14: executing `/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER
++ false
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[3494]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
++ false
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[3494]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
++ false
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[3494]: enp2s14: waiting for carrier
dhcpcd[3494]: DUID 00:01:00:01:0f:02:bb:59:00:1b:77:b1:c8:8e
dhcpcd[3494]: wlp8s0: IAID 77:b1:c8:8e
dhcpcd[3494]: wlp8s0: delaying IPv6 router solictation for 0.2 seconds
dhcpcd[3494]: wlp8s0: delaying DHCP for 0.2 seconds
ntpd | * Stopping ntpd ... [ ok ]
ntpd | * Starting ntpd ... [ ok ]
dhcpcd[3494]: wlp8s0: soliciting an IPv6 router
dhcpcd[3494]: wlp8s0: sending Router Solicitation
dhcpcd[3494]: wlp8s0: reading lease `/var/lib/dhcpcd/dhcpcd-wlp8s0.lease'
dhcpcd[3494]: wlp8s0: rebinding lease of 192.168.178.23
dhcpcd[3494]: wlp8s0: sending REQUEST (xid 0x7552c642), next in 4.0 seconds
dhcpcd[3494]: wlp8s0: acknowledged 192.168.178.23 from 192.168.178.1
dhcpcd[3494]: wlp8s0: leased 192.168.178.23 for 864000 seconds
dhcpcd[3494]: wlp8s0: renew in 432000 seconds, rebind in 756000 seconds
dhcpcd[3494]: wlp8s0: IP address 192.168.178.23/24 already exists
dhcpcd[3494]: wlp8s0: adding route to 192.168.178.0/24
dhcpcd[3494]: wlp8s0: adding default route via 192.168.178.1
dhcpcd[3494]: wlp8s0: writing lease `/var/lib/dhcpcd/dhcpcd-wlp8s0.lease'
dhcpcd[3494]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' REBOOT
++ true
++ true
++ /lib/rc/sbin/mark_service_started dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[3494]: wlp8s0: sending ARP announce (1 of 2), next in 2.0 seconds
ntpd | * Stopping ntpd ... [ ok ]
ntpd | * Starting ntpd ... [ ok ]
dhcpcd[3494]: wlp8s0: sending ARP announce (2 of 2)
dhcpcd[3494]: wlp8s0: sending Router Solicitation
dhcpcd[3494]: wlp8s0: sending Router Solicitation
dhcpcd[3494]: wlp8s0: sending Router Solicitation
dhcpcd[3494]: wlp8s0: no IPv6 Routers available

When I press the hardware rfkill button on this laptop I get
Quote:
dhcpcd[3494]: wlp8s0: dhcp if_readrawpacket: Network is down
dhcpcd[3494]: wlp8s0: carrier lost
dhcpcd[3494]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER
++ true
++ true
++ /lib/rc/sbin/mark_service_started dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[3494]: wlp8s0: deleting route to 192.168.178.0/24
dhcpcd[3494]: wlp8s0: deleting default route via 192.168.178.1
dhcpcd[3494]: wlp8s0: deleting IP address 192.168.178.23/24
dhcpcd[3494]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' EXPIRE
++ false
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
ntpd | * Stopping ntpd ... [ ok ]
ntpd | * Starting ntpd ... [ ok ]
But it should have only stopped without starting again.
The same button again for restarting wireless
Quote:
dhcpcd[3494]: wlp8s0: carrier acquired
dhcpcd[3494]: wlp8s0: if_disable_autolinklocal: Invalid argument
dhcpcd[3494]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
++ false
++ /lib/rc/sbin/mark_service_inactive dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[3494]: wlp8s0: adding address fe80::114b:1c80:cc61:e102
dhcpcd[3494]: wlp8s0: vltime infinity, pltime infinity
dhcpcd[3494]: wlp8s0: IAID 77:b1:c8:8e
dhcpcd[3494]: wlp8s0: delaying IPv6 router solictation for 0.3 seconds
dhcpcd[3494]: wlp8s0: delaying DHCP for 0.7 seconds
dhcpcd[3494]: wlp8s0: soliciting an IPv6 router
dhcpcd[3494]: wlp8s0: delaying Router Solicitation for LL address
dhcpcd[3494]: wlp8s0: reading lease `/var/lib/dhcpcd/dhcpcd-wlp8s0.lease'
dhcpcd[3494]: wlp8s0: rebinding lease of 192.168.178.23
dhcpcd[3494]: wlp8s0: sending REQUEST (xid 0x8c85ae2f), next in 3.2 seconds
dhcpcd[3494]: wlp8s0: acknowledged 192.168.178.23 from 192.168.178.1
dhcpcd[3494]: wlp8s0: checking for 192.168.178.23
dhcpcd[3494]: wlp8s0: sending ARP probe (1 of 3), next in 1.3 seconds
dhcpcd[3494]: wlp8s0: sending Router Solicitation
dhcpcd[3494]: wlp8s0: sending ARP probe (2 of 3), next in 1.4 seconds
dhcpcd[3494]: wlp8s0: sending ARP probe (3 of 3), next in 2.0 seconds
dhcpcd[3494]: wlp8s0: sending Router Solicitation
dhcpcd[3494]: wlp8s0: leased 192.168.178.23 for 864000 seconds
dhcpcd[3494]: wlp8s0: renew in 432000 seconds, rebind in 756000 seconds
dhcpcd[3494]: wlp8s0: adding IP address 192.168.178.23/24
dhcpcd[3494]: wlp8s0: adding route to 192.168.178.0/24
dhcpcd[3494]: wlp8s0: adding default route via 192.168.178.1
dhcpcd[3494]: wlp8s0: writing lease `/var/lib/dhcpcd/dhcpcd-wlp8s0.lease'
dhcpcd[3494]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' REBOOT
++ true
++ true
++ /lib/rc/sbin/mark_service_started dhcpcd
+ for hook in /etc/dhcpcd.enter-hook '/lib/dhcpcd/dhcpcd-hooks/*' /etc/dhcpcd.exit-hook
+ for skip in '$skip_hooks'
+ case "$hook" in
+ '[' -f /etc/dhcpcd.exit-hook ']'
dhcpcd[3494]: wlp8s0: sending ARP announce (1 of 2), next in 2.0 seconds
ntpd | * Stopping ntpd ... [ ok ]
ntpd | * Starting ntpd ... [ ok ]

dhcpcd[3494]: wlp8s0: sending ARP announce (2 of 2)
dhcpcd[3494]: wlp8s0: sending Router Solicitation
dhcpcd[3494]: wlp8s0: sending Router Solicitation
dhcpcd[3494]: wlp8s0: no IPv6 Routers available
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6709
Location: Blighty

PostPosted: Mon Sep 08, 2014 5:03 pm    Post subject: Reply with quote

That looks ok to me. What problem do you see?
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2569

PostPosted: Mon Sep 08, 2014 6:38 pm    Post subject: Reply with quote

UberLord wrote:
That looks ok to me. What problem do you see?
From a powersaving perspective I don't like network dependant services running when network is not available.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6709
Location: Blighty

PostPosted: Mon Sep 08, 2014 7:14 pm    Post subject: Reply with quote

charles17 wrote:
UberLord wrote:
That looks ok to me. What problem do you see?
From a powersaving perspective I don't like network dependant services running when network is not available.


I'm unsure what you mean. the hook script has marked dhcpcd as inactive, so either one of the following is true

1) The dhcpcd service does not provide net (the default one does)
2) Something else is providing net and is active
3) There's a bug

I'll try and look into it later
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2569

PostPosted: Mon Sep 08, 2014 8:29 pm    Post subject: Reply with quote

UberLord wrote:
I'm unsure what you mean. the hook script has marked dhcpcd as inactive,
So far it's ok for me. I can see dhcpcd marked inactive. But ntpd is still running.

UberLord wrote:
so either one of the following is true

1) The dhcpcd service does not provide net (the default one does)
2) Something else is providing net and is active
How could I check if and how net is provided?
Also, I am not sure about the correct settings of these parameters
/etc/rc.conf wrote:
rc_depend_strict="NO"
/etc/conf.d/ntpd wrote:
# rc_need="net"
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6709
Location: Blighty

PostPosted: Mon Sep 08, 2014 8:53 pm    Post subject: Reply with quote

There's a few bugs with OpenRC and the dhcpcd init script which stop the hook from running.
I've updated bug #522206 with the information and we should continue any discussion there.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5037
Location: The Peanut Gallery

PostPosted: Mon Sep 08, 2014 9:42 pm    Post subject: Reply with quote

UberLord wrote:
steveL wrote:
Hmm what do you want to happen?


Me? Nothing, I'm not entirely sure of the usefulness of this feature.
You either have complex scripts to update the IP services bind to (heh, like my hook scripts in dhcpcd - good examples there!) or you have the IP hard coded and made the running of DHCP for central IP management kinda redundant.

Well there needs to be some sort of event-handling at the init-manager side, which has come up in other contexts too, so I'm trying to get a grasp of just what is essential and what isn't. I've consistently advocated for using dhcpcd to handle the netlink, so the first sounds better to me: no complexity til the admin explicitly specifies it, at which point it's their script on their machine, and not our problem ;)
Quote:
Saying that, I have made this patch upstream:
http://roy.marples.name/projects/dhcpcd/ci/1113488b81673c23b3b079e1fc5ea6df5ffc0ee5?sbs=0

Which will aid the creation of a hook. I've even provided a rough idea of how it would look here:
https://bugs.gentoo.org/show_bug.cgi?id=522206#c1

Ah thanks; commented on the sh. I'd want to tweak that test a bit, codewise, though the compiler may do it for you, there's no guarantee; ie test the DHCPCD_WAITIP | DHCPCD_WAITIP4 | DHCPCD_WAITIP6 bits first.
Quote:
Sorry that you think it's gone down hill, but I really don't have the time to maintain it anymore. All my free time goes into dhcpcd, dhcpcd-ui (working on a dhcpcd-qt port as we speak).

Eh, no bother, pretty much what I expected; istr you saying sth similar a few years ago. Just wish it wasn't being left to languish, as it'll bitrot at this rate. Mostly what the current "upstream" seems passionate about is sucking up to systemd to get in with the "big boys"; openrc is just a step imo; it's not being crafted any more, in the history I reviewed at least. (Everything from about 6-9 months ago, back to when you first started: I had to go back just to escape the crap, to reassure myself it wasn't your output.)
Quote:
If you feel that passionate about it, then join the team and help out!

Blimey tried that; I guess I was spoilt by hanging out in #-portage for all these years; it's amazing the difference a good project lead makes.. anyhow let's not get into that discussion as it's not cogent to forward progress. If I were to sort anything with openrc at this point, I'd have to go back to your days, and filter out the crappy commits since, and add the bits they were trying to fix, only without the amateur-hour Gentoo-lol bashish, so that's not going to happen too soon, given current commitments. But it will happen at some point, since we need the software. *shrug* not your problem.

I'm glad you're still about though, and look forward to scripting with dhcpcd on my next install (after I sort this toolchain nonsense out.)
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2569

PostPosted: Thu Sep 18, 2014 11:05 am    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

Dr.Willy wrote:
charles17 wrote:
Also, I am wondering why Gentoo handbook hasn't yet adopted this simplified setup.

That is a good question.
Just comparing the handbook
https://wiki.gentoo.org/wiki/Complete_Handbook/Configuring_the_system#Networking_information
with what's so far in
https://wiki.gentoo.org/wiki/Network_management_using_DHCPCD
the second one does not mention static IP addresses.

Could we handle static IP addresses without netifrc? If so, how is the setup?
And, when will one ever need a static IP address?
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5037
Location: The Peanut Gallery

PostPosted: Thu Sep 18, 2014 12:15 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

charles17 wrote:
Could we handle static IP addresses without netifrc? If so, how is the setup?
And, when will one ever need a static IP address?

I'm pretty sure that was discussed earlier in the thread, as it was something I asked about.

On your second point, anyone on a LAN, not using a laptop or other mobile device, can easily use a static IP.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2569

PostPosted: Thu Sep 18, 2014 1:35 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

steveL wrote:
charles17 wrote:
Could we handle static IP addresses without netifrc? If so, how is the setup?
And, when will one ever need a static IP address?

I'm pretty sure that was discussed earlier in the thread, as it was something I asked about.
Got it
https://wiki.gentoo.org/wiki/Network_management_using_DHCPCD#Static_IP_address
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2146
Location: Bardowick, Germany

PostPosted: Fri Sep 19, 2014 3:09 pm    Post subject: Reply with quote

This method works great for me.

Unfortunately I have one issue:

When I wakeup my laptop from suspend, wifi is not working. I have a little script that removes the wl module (from net-wireless/broadcom-sta), reinserts it and uses rfkill, ifconfig and iw to set things up. But after a suspend, dhcpcd does not start wpa_supplicant for it automatically. Even restarting dhcpcd does not help, I have to manually start /etc/init.d/wpa_supplicant.

Any idea what the cause might be?
Oh, I have the following in dhcpcd.conf :
Code:
 ~ $ grep -P "^[^#]\S" /etc/dhcpcd.conf
allowinterfaces eth* wlan*
denyinterfaces ppp* vmnet*
hostname
duid
persistent
option rapid_commit
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
option ntp_servers
option interface_mtu
require dhcp_server_identifier
slaac private
nohook lookup-hostname
interface lo
static ip_adress=127.0.0.1/8
interface wlan1
env ifwireless=1

_________________
elogind
CygwinOnSteroids
"A conservative is a man who is too cowardly to fight and too fat to run."
-- Elbert Hubbard
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6709
Location: Blighty

PostPosted: Fri Sep 19, 2014 5:36 pm    Post subject: Reply with quote

Yamakuzure wrote:
When I wakeup my laptop from suspend, wifi is not working. I have a little script that removes the wl module (from net-wireless/broadcom-sta), reinserts it and uses rfkill, ifconfig and iw to set things up. But after a suspend, dhcpcd does not start wpa_supplicant for it automatically. Even restarting dhcpcd does not help, I have to manually start /etc/init.d/wpa_supplicant.

Any idea what the cause might be?


dhcpcd only starts wpa_supplicant if it's not running and even then only during reconfigure or preinit phases.
Now, if you remove the kernel module, that implies the interface will vanish (if it removes the interface).
If dhcpcd spots this, it will stop wpa_supplicant.
When the kernel module is re-inserted, dhcpcd will spot (if it adds an interface) this, trigger preinit and start wpa_supplicant.

Have to ask why do this anyway? Just keep the module and don't rfkill on suspend?

Quote:

Oh, I have the following in dhcpcd.conf :
Code:
 ~ $ grep -P "^[^#]\S" /etc/dhcpcd.conf
allowinterfaces eth* wlan*
denyinterfaces ppp* vmnet*



Going to assume that the interface it will add is allowed.
Quote:
Code:

interface wlan1
env ifwireless=1


You shouldn't need that with dhcpcd-6.4.5
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2146
Location: Bardowick, Germany

PostPosted: Fri Sep 19, 2014 7:13 pm    Post subject: Reply with quote

UberLord wrote:
dhcpcd only starts wpa_supplicant if it's not running and even then only during reconfigure or preinit phases.
Now, if you remove the kernel module, that implies the interface will vanish (if it removes the interface).
If dhcpcd spots this, it will stop wpa_supplicant.
When the kernel module is re-inserted, dhcpcd will spot (if it adds an interface) this, trigger preinit and start wpa_supplicant.
That is the thing. The interface vanishes, re-appears, no wpa_supplicant is running, but dhcpcd won't start it for the interface. Even when dhcpcd itself is started.
UberLord wrote:
Have to ask why do this anyway? Just keep the module and don't rfkill on suspend?
There is a bug that causes the driver to fail to connect anywhere when the card came out of resume. rmmod+insmod is the "official" workaround.
UberLord wrote:
Going to assume that the interface it will add is allowed.
Quote:
Code:

interface wlan1
env ifwireless=1


You shouldn't need that with dhcpcd-6.4.5
I have updated today after spotting the update. Haven't tried out whether the issue might be fixed completely with the new version. I'll reply to that once I have tested it.
_________________
elogind
CygwinOnSteroids
"A conservative is a man who is too cowardly to fight and too fat to run."
-- Elbert Hubbard
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6709
Location: Blighty

PostPosted: Fri Sep 19, 2014 7:17 pm    Post subject: Reply with quote

I think the clue is that you're starting wpa_supplicant via /etc/init.d

With everything working, do this
Code:

dhcpcd -x
pkill wpa_supplicant
dhcpcd -dB


Watch in the console.
If you don't get the message that dhcpcd is starting wpa_supplicant then something is wrong with your setup - probably the wpa_supplicant.conf dhcpcd is using.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2569

PostPosted: Sun Sep 21, 2014 5:45 pm    Post subject: Reply with quote

UberLord wrote:
With everything working, do this
Code:

dhcpcd -x
pkill wpa_supplicant
dhcpcd -dB

Tried watching the startup procedure with wpa_supplicat and dhcpcd killed. So just only
Code:
dhcpcd -dB

And everything runs fine. But what is "if_disable_autolinklocal: Invalid argument"?
Code:
$ su -c "dhcpcd -dB"
Password:
dhcpcd[23772]: version 6.4.5 starting
dhcpcd[23772]: udev: starting
dhcpcd[23772]: dev: loaded udev
dhcpcd[23772]: enp2s14: if_disable_autolinklocal: Invalid argument
dhcpcd[23772]: wlp8s0: if_disable_autolinklocal: Invalid argument
dhcpcd[23772]: wlp8s0: adding address fe80::b7ef:4566:e492:4625
dhcpcd[23772]: wlp8s0: vltime infinity, pltime infinity
dhcpcd[23772]: enp2s14: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
dhcpcd[23772]: enp2s14: executing `/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER
dhcpcd[23772]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
dhcpcd[23824]: wlp8s0: starting wpa_supplicant
ntpd             | * Stopping ntpd ... [ ok ]
ntpd             | * Starting ntpd ... [ ok ]
dhcpcd[23772]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER
dhcpcd[23772]: no interfaces have a carrier
dhcpcd[23772]: enp2s14: waiting for carrier
dhcpcd[23772]: wlp8s0: waiting for carrier
dhcpcd[23772]: wlp8s0: carrier acquired
dhcpcd[23772]: wlp8s0: if_disable_autolinklocal: Invalid argument
dhcpcd[23772]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' CARRIER
dhcpcd[23772]: DUID 00:01:00:01:0f:02:bb:59:00:1b:77:b1:c8:8e
dhcpcd[23772]: wlp8s0: IAID 77:b1:c8:8e
dhcpcd[23772]: wlp8s0: delaying IPv6 router solictation for 0.5 seconds
dhcpcd[23772]: wlp8s0: delaying IPv4 for 0.3 seconds
dhcpcd[23772]: wlp8s0: reading lease `/var/lib/dhcpcd/dhcpcd-wlp8s0.lease'
dhcpcd[23772]: wlp8s0: rebinding lease of 192.168.178.23
dhcpcd[23772]: wlp8s0: sending REQUEST (xid 0xdec22e04), next in 4.3 seconds
dhcpcd[23772]: wlp8s0: acknowledged 192.168.178.23 from 192.168.178.1
dhcpcd[23772]: wlp8s0: leased 192.168.178.23 for 864000 seconds
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6709
Location: Blighty

PostPosted: Sun Sep 21, 2014 6:42 pm    Post subject: Reply with quote

charles17 wrote:
startup procedure with wpa_supplicat and dhcpcd killed. So just only
Code:
dhcpcd -dB

And everything runs fine. But what is "if_disable_autolinklocal: Invalid argument"?


It means you kernel is too old for that feature.
Due to the wisdom the of the linux kernel devs, we have no way of knowing if it exists at compile time so we force the value but only show an error with debugging enabled.

OK, so it does appear to be working. Could be a race somewhere. Try changing your kernel hack to this

Code:
rmmod module
sleep 3
insmod module


Or this

Code:

dhcpcd -x
rmmod module
insmod module
dhcpcd -d

_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2146
Location: Bardowick, Germany

PostPosted: Mon Sep 22, 2014 7:29 am    Post subject: Reply with quote

Yamakuzure wrote:
UberLord wrote:
Have to ask why do this anyway? Just keep the module and don't rfkill on suspend?
There is a bug that causes the driver to fail to connect anywhere when the card came out of resume. rmmod+insmod is the "official" workaround.
UberLord wrote:
Going to assume that the interface it will add is allowed.
Quote:
Code:

interface wlan1
env ifwireless=1


You shouldn't need that with dhcpcd-6.4.5
I have updated today after spotting the update. Haven't tried out whether the issue might be fixed completely with the new version. I'll reply to that once I have tested it.
One try with the new version yesterday. After wakeup the network status applet showed that the device does not exist (module not loaded), after a second it changed to "not connected", a second later it changed to "connected". Tried a ping on google, it worked.

Wow. That new version of dhcpcd really seemed to do do the trick! Thank you very much!
_________________
elogind
CygwinOnSteroids
"A conservative is a man who is too cowardly to fight and too fat to run."
-- Elbert Hubbard
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4911
Location: Dark side of the mood

PostPosted: Fri Nov 07, 2014 11:20 pm    Post subject: Reply with quote

I have an issue here. I have gone through a huge upgrade (stayed months without upgrading) and a lot of packages have been touched so I have really no idea what causes this. Anyway.

I'm running kernel 3.16.6, OpenRC 0.12.4 (without netifrc) and dhcpcd 6.4.7. I noticed when the computer rebooted the loopback interface is down (causing a few services not to start) and I have to either enable /etc/init.d/loopback (which I'd like to avoid) or bring lo up manually and restart all depending services... which I'd like to avoid as well :D . Is there a reason dhcpcd would not bring up lo?
_________________
Dealing with computers is the best way to get sucked into more troubles than any sane person can cope with!
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6709
Location: Blighty

PostPosted: Sat Nov 08, 2014 12:44 am    Post subject: Reply with quote

VinzC wrote:
I have an issue here. I have gone through a huge upgrade (stayed months without upgrading) and a lot of packages have been touched so I have really no idea what causes this. Anyway.

I'm running kernel 3.16.6, OpenRC 0.12.4 (without netifrc) and dhcpcd 6.4.7. I noticed when the computer rebooted the loopback interface is down (causing a few services not to start) and I have to either enable /etc/init.d/loopback (which I'd like to avoid) or bring lo up manually and restart all depending services... which I'd like to avoid as well :D . Is there a reason dhcpcd would not bring up lo?


dhcpcd does not bring up a loopback interface unless instructed to.

EDIT: To be fair, I've never tested it bringing one up either
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
VinzC
Advocate
Advocate


Joined: 17 Apr 2004
Posts: 4911
Location: Dark side of the mood

PostPosted: Sat Nov 08, 2014 3:35 pm    Post subject: Reply with quote

UberLord wrote:
dhcpcd does not bring up a loopback interface unless instructed to.

Thanks, Roy. I must confess I crawled the man page several times but couldn't find a hint. Is it through a hook of some sort?

UberLord wrote:
EDIT: To be fair, I've never tested it bringing one up either

I might be soon :D .
_________________
Dealing with computers is the best way to get sucked into more troubles than any sane person can cope with!
Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3, 4, 5  Next
Page 4 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum