Sometimes, I configure my tablet PC as wifi hotspot to use Internet in my Arch Linux desktop. Yesterday, I messed up with wireless network card's settings, and my hotspot stopped working. I was able to connect with hostpot, but Internet didn't work in my Arch Linux desktop. I tried to start my wifi network profile using command:
$ sudo netctl start wlp9s0-sktab
Here, wlp9s0-sktab is my wifi network profile name. I got the following error message while I trying to start the network profile.
Job for netctl@wlp9s0\x2dsktab.service failed because the control process exited with error code. See "systemctl status "netctl@wlp9s0\\x2dsktab.service"" and "journalctl -xe" for details.
While searching through the Arch Linux wiki, someone has pointed out that this problem might occur if you use hyphen in your network profile's name. So, I deleted my old wifi network profile (i.e wlp9s0-sktab):
$ sudo rm /etc/netctl/wlp9s0-sktab
And then created a new one with name "wlp9s0sktab" (without hyphen) using "wifi-menu" command. But, no luck! I still got the same problem, and Internet doesn't work.
I ran the following command to know the status of my wifi network profile.
$ sudo netctl status wlp9s0sktab
Here, wlp9s0sktab is my wifi hotspot name.
● firstname.lastname@example.org - Automatically generated profile by wifi-menu Loaded: loaded (/email@example.com; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Sun 2017-03-12 12:25:25 IST; 1min 40s ago Docs: man:netctl.profile(5) Process: 390 ExecStart=/usr/lib/network/network start %I (code=exited, status=1/FAILURE) Main PID: 390 (code=exited, status=1/FAILURE) Mar 12 12:25:24 sk systemd: Starting Automatically generated profile by wifi-menu... Mar 12 12:25:25 sk network: Starting network profile 'wlp9s0sktab'... Mar 12 12:25:25 sk network: The interface of network profile 'wlp9s0sktab' is already up Mar 12 12:25:25 sk systemd: firstname.lastname@example.org: Main process exited, code=exited, status=1/FAILURE Mar 12 12:25:25 sk systemd: Failed to start Automatically generated profile by wifi-menu. Mar 12 12:25:25 sk systemd: email@example.com: Unit entered failed state. Mar 12 12:25:25 sk systemd: firstname.lastname@example.org: Failed with result 'exit-code'.While searching through Arch Wiki, someone has pointed out that we shouldn't hypen (-) in network profile name. So, Have deleted the existing network profile as shown below.
I have no idea what I have misconfigured in the network settings. After digging a little bit in the Arch Linux forums, I found that systemd causes this problem. I was testing and configuring a local DHCP server, so I had enabled dhcpcd.service. This is why my wifi hotspot didn't work. If you ever encountered this problem, just follow these steps given below to fix it.
How To Fix "job for netctl service failed" Error In Arch Linux
Disable dhcpcd.service using command:
$ sudo systemctl stop dhcpcd.service
$ sudo systemctl disable dhcpcd.service
Next, Remove old DHCP leases. The following directory contains all dhcp leases.
$ ls /var/lib/dhcpcd/
dhcpcd-enp0s29u1u2.lease dhcpcd-wlp9s0-BlNi-QWtzaHU.lease dhcpcd-enp5s0.lease dhcpcd-wlp9s0-Buew-c3VkaGFu.lease dhcpcd-wlp9s0-AFFLIENCE.lease dhcpcd-wlp9s0-BVof-QWJp.lease dhcpcd-wlp9s0-AFFLIENCE.lease6 'dhcpcd-wlp9s0-Ostechnix\040Tech\040Service.lease' dhcpcd-wlp9s0-AndroidAP.lease 'dhcpcd-wlp9s0-Ostechnix\040Tech\040Service.lease6' dhcpcd-wlp9s0-B12B-amFjb2Jzb3duZGFyMw.lease dhcpcd-wlp9s0-Dev9376.lease dhcpcd-wlp9s0-Bcof-R2luZW91cw.lease dhcpcd-wlp9s0-Dev9376.lease6 dhcpcd-wlp9s0-Bed6-cmFteWE.lease dhcpcd-wlp9s0-ostechnix.lease dhcpcd-wlp9s0-BGD4-cmVudWdhcmFndW5hdGhhbg.lease dhcpcd-wlp9s0-Pratheesh.lease dhcpcd-wlp9s0-BGec-TGVub3ZvIEs1MGE0MA.lease dhcpcd-wlp9s0-Raja.lease dhcpcd-wlp9s0-BgXq-QWtzaHU.lease dhcpcd-wlp9s0-sktab.lease dhcpcd-wlp9s0-BJNQ-bWFkaGFubGF2YTk1.lease dhcpcd-wlp9s0-Sklab.lease dhcpcd-wlp9s0-BKTt-RWxh.lease dhcpcd-wlp9s0-mynet.lease
Just delete all of them or delete only your preferred dhcp leases.
I deleted all DHCP leases of my wif network profiles as shown below.
$ sudo rm -fr /var/lib/dhcpcd/dhcpcd-wlp9s0*
Then, delete all unnecessary and previously enabled services from systemd using command:
$ sudo rm /etc/systemd/system/multi-user.target.wants/netctl*
Finally, delete all connected wifi network profiles. As you may know, all network profiles will be found under /etc/netctl/ directory.
$ sudo rm -fr /etc/netctl/wlp9s0*
Reboot the system.
Once you logged in, create a new network profile for your wifi network.
To do so, run:
$ sudo wifi-menu
Select your wifi network name:
Avoid using hyphen in wifi network names. Click OK to save the profile.
Now, check the status of the newly created wifi network profile using command:
$ sudo netctl status wlp9s0sktab
● email@example.com - Automatically generated profile by wifi-menu Loaded: loaded (/firstname.lastname@example.org; static; vendor preset: disabled) Active: active (exited) since Sun 2017-03-12 13:26:33 IST; 2min 20s ago Docs: man:netctl.profile(5) Process: 851 ExecStart=/usr/lib/network/network start %I (code=exited, status=0/SUCCESS) Main PID: 851 (code=exited, status=0/SUCCESS) Tasks: 2 (limit: 4915) CGroup: /email@example.com ├─860 wpa_supplicant -q -B -P /run/wpa_supplicant_wlp9s0.pid -i wlp9s0 -D nl80211,wext -c/run/network/wpa_supplicant_wlp9s0 └─909 dhcpcd -4 -q -t 30 -L wlp9s0 Mar 12 13:26:24 sk network: Starting network profile 'wlp9s0sktab'... Mar 12 13:26:26 sk dhcpcd: DUID 00:01:00:01:20:57:b7:1b:c0:18:85:50:47:4f Mar 12 13:26:26 sk dhcpcd: wlp9s0: IAID 85:50:47:4f Mar 12 13:26:27 sk dhcpcd: wlp9s0: rebinding lease of 192.168.43.193 Mar 12 13:26:27 sk dhcpcd: wlp9s0: probing address 192.168.43.193/24 Mar 12 13:26:32 sk dhcpcd: wlp9s0: leased 192.168.43.193 for 43200 seconds Mar 12 13:26:32 sk dhcpcd: wlp9s0: adding route to 192.168.43.0/24 Mar 12 13:26:32 sk dhcpcd: wlp9s0: adding default route via 192.168.43.1 Mar 12 13:26:33 sk network: Started network profile 'wlp9s0sktab' Mar 12 13:26:33 sk systemd: Started Automatically generated profile by wifi-menu.
Voila! It worked!!
Additional note: If Internet still doesn't work on your system, you need to update the nameserver details in your /etc/resolv.conf file. In my case, I have added 192.168.43.1 as nameserver and Internet worked just fine!
Hope this helps.