Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
start/stop services with dhcpcd
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3685

PostPosted: Tue Sep 02, 2014 12:21 pm    Post subject: start/stop services with dhcpcd Reply with quote

No luck here. With wpa_supplicant and dhcpcd in runlevel boot the interface would not come up. I only get
Code:
$ su -c "/etc/init.d/dhcpcd start && /etc/init.d/wpa_supplicant start"
Password:
dhcpcd           | * Starting DHCP Client Daemon ...                                                                                              [ ok ]
wpa_supplicant   | * Starting WPA Supplicant Daemon ...
wpa_supplicant   |Successfully initialized wpa_supplicant
wpa_supplicant   |ioctl[SIOCSIWPMKSA]: Invalid argument
wpa_supplicant   |ioctl[SIOCSIWMODE]: Invalid argument
wpa_supplicant   |ioctl[SIOCGIWRANGE]: Invalid argument
wpa_supplicant   |ioctl[SIOCGIWMODE]: Invalid argument
wpa_supplicant   |ioctl[SIOCSIWAP]: Invalid argument
wpa_supplicant   |ioctl[SIOCSIWESSID]: Invalid argument
wpa_supplicant   |ioctl[SIOCSIWENCODEEXT]: Invalid argument
wpa_supplicant   |ioctl[SIOCSIWENCODEEXT]: Invalid argument
wpa_supplicant   |ioctl[SIOCSIWENCODEEXT]: Invalid argument
wpa_supplicant   |ioctl[SIOCSIWENCODEEXT]: Invalid argument
wpa_supplicant   |ioctl[SIOCSIWPMKSA]: Invalid argument 
Code:
$ ifconfig -a
enp2s14: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet6 fe80::21a:4bff:fe61:9985  prefixlen 64  scopeid 0x20<link>
        ether 00:1a:4b:61:99:85  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Local Loopback)
        RX packets 2526  bytes 201302 (196.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2526  bytes 201302 (196.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

sit0: flags=128<NOARP>  mtu 1480
        sit  txqueuelen 0  (IPv6-in-IPv4)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp8s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet6 fe80::21b:77ff:feb1:c88e  prefixlen 64  scopeid 0x20<link>
        ether 00:1b:77:b1:c8:8e  txqueuelen 1000  (Ethernet)
        RX packets 13986  bytes 10451263 (9.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 13023  bytes 1653377 (1.5 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

In /etc/conf.d/net I have
Code:
# /etc/conf.d/net:

modules_wlp8s0="wpa_supplicant"
wpa_supplicant_wlp8s0="-Dnl80211"


Last edited by charles17 on Wed Sep 10, 2014 12:10 pm; edited 2 times in total
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Tue Sep 02, 2014 12:35 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

charles17 wrote:
No luck here. With wpa_supplicant and dhcpcd in runlevel boot the interface would not come up. I only get[code]$ su -c "/etc/init.d/dhcpcd start && /etc/init.d/wpa_supplicant start"

Some notes:
- I think you don't need to start wpa_supplicant manually, dhcpcd should take care of that
Try stopping both services, kill any leftover wpa_supplicant instances (should there be any) and restart just dhcpcd.
- /etc/conf.d/net is not used (or needed) by dhcpcd or wpa_supplicant
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3685

PostPosted: Tue Sep 02, 2014 1:11 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

No chance. Removed wpa_supplicant from the runlevels, but still no interface. Even the wireless LED stays dark. Should I recompile opnerc with USE=-netifrc?
Back to top
View user's profile Send private message
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Tue Sep 02, 2014 1:31 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

charles17 wrote:
Should I recompile opnerc with USE=-netifrc?

I have USE=-netifrc set, but I don't know if you actually have to do that.
Does wpa_supplicant start at all?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3685

PostPosted: Tue Sep 02, 2014 1:46 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

Dr.Willy wrote:
Does wpa_supplicant start at all?
It does not seem to start automatically. Do I need to put something more in dhcpcd.conf in order to make it start wpa_supplicant?
Code:
$ cat /etc/dhcpcd.conf
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Configure loopback adapter here
interface lo
static ip_address=127.0.0.1/8

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
#clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private

# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Sep 02, 2014 2:00 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

charles17 wrote:
Dr.Willy wrote:
Does wpa_supplicant start at all?
It does not seem to start automatically. Do I need to put something more in dhcpcd.conf in order to make it start wpa_supplicant?


wpa_supplicant.conf needs to have ctrl_interface line configured like so:

Code:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

_________________
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
Dr.Willy
Guru
Guru


Joined: 15 Jul 2007
Posts: 547
Location: NRW, Germany

PostPosted: Tue Sep 02, 2014 2:01 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

charles17 wrote:
Dr.Willy wrote:
Does wpa_supplicant start at all?
It does not seem to start automatically. Do I need to put something more in dhcpcd.conf in order to make it start wpa_supplicant?

No, you just need to have /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant which comes with the default installation.
What does
Code:
ps -A | grep wpa
say?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3685

PostPosted: Tue Sep 02, 2014 2:47 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

UberLord wrote:
wpa_supplicant.conf needs to have ctrl_interface line configured like so:

Code:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
Seems to be equivalent to what I already had in this file, except DIR
Code:
$ cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

# ctrl_interface=/var/run/wpa_supplicant
# ctrl_interface_group=wheel
update_config=1

network={

But this alone didn't make it work. I also had to uncomment the last line in /etc/conf.d/wpa_supplicant which was not needed for the old setup.
Code:
# conf.d file for wpa_supplicant
#
# Please check man 8 wpa_supplicant for more information about the options
# wpa_supplicant accepts.
#
wpa_supplicant_args="-Dnl80211"

Finally putting wpa_supplicant again into default runlevel made it work. At least for wireless.

Dr.Willy wrote:
What does
Code:
ps -A | grep wpa
say?
After the above mentioned changes, it seems top run well and I get
Code:
$ ps -A | grep wpa
 2242 ?        00:00:00 wpa_supplicant

My question now is, should wpa_supplicant automatically be started by dhcpcd or be in runlevel itself?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Sep 02, 2014 2:50 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

charles17 wrote:
My question now is, should wpa_supplicant automatically be started by dhcpcd or be in runlevel itself?


For a fixed interface, it won't matter.
For a hotplugged interface such as a USB stick, dhcpcd is generally better.
_________________
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: 3685

PostPosted: Tue Sep 02, 2014 4:04 pm    Post subject: Re: TIP: Complete network stack without net.* scripts Reply with quote

Dr.Willy wrote:
No, you just need to have /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant which comes with the default installation.
Somehow it seems to not be triggered. How could I make sure it works? If possible I'd like to go without having wpa_supplicant in the runlevel.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Sep 02, 2014 4:13 pm    Post subject: Reply with quote

Edit /lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant and add set -x to the top of the file.
Then kill dhcpcd and run it in a console like so

dhcpcd -dB

Copy n paste the output here. That should be enough information to debug.
_________________
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: 3685

PostPosted: Tue Sep 02, 2014 5:50 pm    Post subject: Reply with quote

UberLord wrote:
dhcpcd -dB
Here is the output, too much for pasting here, sorry.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Sep 02, 2014 7:41 pm    Post subject: Reply with quote

Code:
dhcpcd[3079]: wlp8s0: executing `/lib/dhcpcd/dhcpcd-run-hooks' PREINIT
++ '[' -z '' ']'
++ for x in '/etc/wpa_supplicant/wpa_supplicant-"$interface".conf' /etc/wpa_supplicant/wpa_supplicant.conf '/etc/wpa_supplicant-"$interface".conf' /etc/wpa_supplicant.conf
++ '[' -s /etc/wpa_supplicant/wpa_supplicant-wlp8s0.conf ']'
++ for x in '/etc/wpa_supplicant/wpa_supplicant-"$interface".conf' /etc/wpa_supplicant/wpa_supplicant.conf '/etc/wpa_supplicant-"$interface".conf' /etc/wpa_supplicant.conf
++ '[' -s /etc/wpa_supplicant/wpa_supplicant.conf ']'
++ wpa_supplicant_conf=/etc/wpa_supplicant/wpa_supplicant.conf
++ break
++ : /etc/wpa_supplicant/wpa_supplicant.conf
++ '[' 0 = 1 ']'


The last line shows that dhcpcd doesn't think this is a wireless interface.
Here's the code that dhcpcd uses to work it out on Linux : link

Maybe a driver bug?
_________________
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: 3685

PostPosted: Wed Sep 03, 2014 6:50 am    Post subject: Reply with quote

I am too far from understanding the program code in link.
Could you guide me how to check about a possible driver bug? What informations do you need?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Wed Sep 03, 2014 9:05 am    Post subject: Reply with quote

Well, basically the error condition is that when dhcpcd queries the assigned SSID an error is reported where there should not be one.
Can you post the output of iwconfig?
_________________
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: 3685

PostPosted: Wed Sep 03, 2014 10:01 am    Post subject: Reply with quote

Everything "no wireless extensions."
Code:
$ /sbin/iwconfig
wlp8s0    no wireless extensions.

lo        no wireless extensions.

sit0      no wireless extensions.

enp2s14   no wireless extensions.
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8722
Location: ~Brussels - Belgique

PostPosted: Wed Sep 03, 2014 10:09 am    Post subject: Reply with quote

Take a look at dmesg: is the wireless interface well initialized? does it need a missing firmware? is the rfkill switch OK?
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Wed Sep 03, 2014 10:24 am    Post subject: Reply with quote

charles17 wrote:
Everything "no wireless extensions."
Code:
$ /sbin/iwconfig
wlp8s0    no wireless extensions.

lo        no wireless extensions.

sit0      no wireless extensions.

enp2s14   no wireless extensions.


That is why :)
Solve this problem (no idea how sorry, XavierMiller's solution seems good) and it should start working.
_________________
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: 3685

PostPosted: Wed Sep 03, 2014 11:00 am    Post subject: Reply with quote

XavierMiller wrote:
Take a look at dmesg: is the wireless interface well initialized? does it need a missing firmware? is the rfkill switch OK?

From dmesg and lspci I cannot find anything missing.
Code:
08:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)
   Subsystem: Hewlett-Packard Company PRO/Wireless 3945ABG [Golan] Network Connection
   Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
   Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
   Latency: 0, Cache Line Size: 64 bytes
   Interrupt: pin A routed to IRQ 16
   Region 0: Memory at e8000000 (32-bit, non-prefetchable) [size=4K]
   Capabilities: [c8] Power Management version 2
      Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
      Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
   Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
      Address: 0000000000000000  Data: 0000
   Capabilities: [e0] Express (v1) Legacy Endpoint, MSI 00
      DevCap:   MaxPayload 128 bytes, PhantFunc 0, Latency L0s <512ns, L1 unlimited
         ExtTag- AttnBtn- AttnInd- PwrInd- RBE- FLReset-
      DevCtl:   Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
         RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
         MaxPayload 128 bytes, MaxReadReq 128 bytes
      DevSta:   CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr+ TransPend-
      LnkCap:   Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 <128ns, L1 <64us
         ClockPM+ Surprise- LLActRep- BwNot-
      LnkCtl:   ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
         ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
      LnkSta:   Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
   Kernel driver in use: iwl3945
   Kernel modules: iwl3945

rfkill is ok, I can start /etc/init.d/wpa_supplicant manually without problems.
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8722
Location: ~Brussels - Belgique

PostPosted: Wed Sep 03, 2014 11:08 am    Post subject: Reply with quote

which version of dhcpcd do you have ? wpa support is starting from version 6.
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Wed Sep 03, 2014 11:11 am    Post subject: Reply with quote

XavierMiller wrote:
which version of dhcpcd do you have ? wpa support is starting from version 6.


Irrelevant. If iwconfig won't work, neither will dhcpcd. dhcpcd detected SSID and set the ifwireless flag in version 4.

Have you compiled your kernel with wireless extensions? http://wiki.gentoo.org/wiki/Wifi
_________________
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: 3685

PostPosted: Wed Sep 03, 2014 11:14 am    Post subject: Reply with quote

Code:
$ emerge -pqv dhcpcd
[ebuild   R   ] net-misc/dhcpcd-6.4.3  USE="ipv6 udev"

Code:
$ emerge -pqv wpa_supplicant
[ebuild   R   ] net-wireless/wpa_supplicant-2.0-r2  USE="qt4 readline ssl wps -ap -dbus -eap-sim -fasteap -gnutls -p2p (-ps3) (-selinux) -smartcard -wimax"
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3685

PostPosted: Wed Sep 03, 2014 11:44 am    Post subject: Reply with quote

UberLord wrote:
Have you compiled your kernel with wireless extensions? http://wiki.gentoo.org/wiki/Wifi
I had not, but after recompiling the kernel with CONFIG_CFG80211_WEXT=y it finally works.
May I propose this should be mentioned at the beginning of this guide because the old setup using net-misc/netifrc does not need wext compatibility.
Back to top
View user's profile Send private message
xaviermiller
Bodhisattva
Bodhisattva


Joined: 23 Jul 2004
Posts: 8722
Location: ~Brussels - Belgique

PostPosted: Wed Sep 03, 2014 11:57 am    Post subject: Reply with quote

discussion moved from TIP: Complete network stack without net.* scripts
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3685

PostPosted: Wed Sep 03, 2014 12:46 pm    Post subject: Reply with quote

Thanks to everybody helping me to make it work
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
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