You are not logged in.

#1 2022-03-12 12:13:18

niledolphin
Member
Registered: 2022-03-12
Posts: 3

My dhcpcd is not starting at boot with systemd!

I am trying to ditch NetworkManager and use iwd + dhcpcd instead. The problem is that, even though iwd is working and systemd is starting its service correctly, the same does not happen to dhcpcd. It works if I run dhcpcd as root, but that is annoying and I want to start it automatically. I have done the standard

systemctl enable dhcpcd.service

followed by a reboot, but nothing happens. I check the status with

systemctl status dhcpcd.service

and it says that it's dead. After looking on the ArchWiki, there was a note stating that sometimes there are issues when starting dhcpcd for all the interfaces. They also suggest using

systemctl enable dhcpcd@specificinterface.service

, so I did

systemctl enable dhcpcd@wlan0.service

(wlan0 is the name of my wifi interface). This is still not working, as when I check the status it says dead. What else can I try?

Offline

#2 2022-03-12 12:15:48

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: My dhcpcd is not starting at boot with systemd!

Post the actual status output. A service is also dead if it ran but terminated for some reason. In doubt a full

sudo journalctl -b

FWIW if you just care about getting a connection you could also not use dhcpcd but enable iwd's built-in support instead: https://wiki.archlinux.org/title/Iwd#En … figuration

Last edited by V1del (2022-03-12 12:17:38)

Offline

#3 2022-03-12 12:17:30

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: My dhcpcd is not starting at boot with systemd!

Why use dhcpcd at all?
iwd can handle DHCP by itself...
https://wiki.archlinux.org/title/Iwd#En … figuration


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2022-03-12 12:20:07

niledolphin
Member
Registered: 2022-03-12
Posts: 3

Re: My dhcpcd is not starting at boot with systemd!

So you all pointed out that iwd has its own DHCP handler. I knew that already. I am only using dhcpcd because the iwd one hasn't worked as well. If I could get that one working, it would be even better!

Offline

#5 2022-03-12 12:25:10

niledolphin
Member
Registered: 2022-03-12
Posts: 3

Re: My dhcpcd is not starting at boot with systemd!

V1del wrote:

Post the actual status output. A service is also dead if it ran but terminated for some reason. In doubt a full

sudo journalctl -b

FWIW if you just care about getting a connection you could also not use dhcpcd but enable iwd's built-in support instead: https://wiki.archlinux.org/title/Iwd#En … figuration

For the command

systemctl status dhcpcd@wlan0.service

I get

dhcpcd@wlan0.service - dhcpcd on wlan0
    Loaded: loaded(/usr/lib/systemd/system/dhcpcd@.service; enabled; vendor preset: disabled)
    Active: inactive (dead)
   Process: 440 ExecStart=/usr/bin/dhcpcd -q -w wlan0 (code=killed, signal=TERM)
       CPU: 1ms

Mar 12 12:26:27 niledolphin-pc systemd[1]: Starting dhcpcd on wlan0...
Mar 12 12:26:27 niledolphin-pc systemd[1]: dhcpcd@wlan0.service: Deactivated successfully.
Mar 12 12:26:27 niledolphin-pc systemd[1]: Stopped dhcpcd on wlan0.

.

Last edited by niledolphin (2022-03-12 12:32:31)

Offline

#6 2022-03-12 13:00:19

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: My dhcpcd is not starting at boot with systemd!

Afaik dhcpcd tries to be platform agnostic and iwd is only available on linux.

Make up your mind and either use dhcpcd + wpa_supplicant or use iwd .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2022-03-12 15:14:11

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: My dhcpcd is not starting at boot with systemd!

Either way, dhcpcd will not provide a carrier - https://wiki.archlinux.org/title/Dhcpcd … supplicant - and "the iwd one hasn't worked as well" isn't a useful error message.

V1del wrote:

In doubt a full

sudo journalctl -b

Offline

#8 2023-01-25 06:43:23

phunc20
Member
Registered: 2023-01-25
Posts: 1

Re: My dhcpcd is not starting at boot with systemd!

Hi, I was doing basically the same thing recently as you did; in my case, it was to make my ThinkPad X61s run hopefully without freeze by getting rid of wpa_supplicant and networkmanager

And I also met exactly the same problem as you did, namely, I thought iwd should go hand-in-hand with dhcpcd. But at each reboot, I had to

  • Either $sudo dhcpcd

  • Or $sudo systemctl restart dhcpcd@wlan0

Then I found this discussion, which made me go back and read the arch wiki on iwd. And I think I've found one solution. As was correctly pointed out by

Slithery wrote:

iwd can handle DHCP by itself...

Long story short

Just follow the arch wiki entry.

Long story long

I was using iwd version 2.1, and for it to work w/o dhcpcd,

  1. One could simply uninstall $sudo pacman -Rns dhcpcd

  2. To obtain dynamic IP, put the following lines in the file /etc/iwd/main.conf

    [General]
    EnableNetworkConfiguration=true
  3. To resolve domain names,

    $ sudo systemctl start systemd-resolved
    $ sudo systemctl enable systemd-resolved

Following these three steps hopefully could help you configure your
iwd to what you wish. For more info, read the arch wiki entry on iwd:

Last edited by phunc20 (2023-01-25 06:50:51)

Offline

#9 2023-01-25 08:37:00

seth
Member
Registered: 2012-09-03
Posts: 49,992

Re: My dhcpcd is not starting at boot with systemd!

1. please don't necrobump, the OP seems to have abandoned the thread a year ago
2. please don't post PSAs. As you mentioned: "Just follow the arch wiki entry."
3.

To resolve domain names

Just for clarification: systemd-resolved is absolutely not required to resolve domains, regardless of what sets up the lease.

Offline

#10 2023-01-25 12:16:24

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: My dhcpcd is not starting at boot with systemd!

Closing this old thread.


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

Board footer

Powered by FluxBB