# switching to systemd and confusted

## mreff555

I am trying to get my network up and running via wpa_supplicant which is how I had it figured before with init scripts.

I followed the tutorial here.

http://wiki.gentoo.org/wiki/Systemd

I created the symbolic link /etc/systemd/system/multi-user.target.wants/wpa_supplicant@wlp4s0.service

The device comes up but an IP address isn't configures. which other net services should be enabled. Like I said I am not using network manager. Just wpa_supplicant. Thanks

----------

## ulenrich

dhcpcd

----------

## hadrons123

if not networkmanager you can use wicd.

----------

## mreff555

 *ulenrich wrote:*   

> dhcpcd

 

Thanks, tried it but it didn't make a difference. everything I would think should be loaded is loaded. the device is up with no IP assigned. 

Do I have to use some type of network manager for systemd? I am beginning to come to the concluesion that systemd's "scripts" (please excuse my terminology) will not work with a manual configuration of /etc/wpa_supplicant/wpa_supplicant.conf which is what I have done in the past. is this the case?

----------

## BobWya

 *mreff555 wrote:*   

>  *ulenrich wrote:*   dhcpcd 
> 
> Thanks, tried it but it didn't make a difference. everything I would think should be loaded is loaded. the device is up with no IP assigned. 
> 
> Do I have to use some type of network manager for systemd? I am beginning to come to the concluesion that systemd's "scripts" (please excuse my terminology) will not work with a manual configuration of /etc/wpa_supplicant/wpa_supplicant.conf which is what I have done in the past. is this the case?

 

Get familiar with the basic commands supplied to interrogate your systemd status they are very powerful!!

View all log messages from last boot...

```
journalctl -b -x
```

View status of dhcpcd.service...

```
systemctl status dhcpcd.service
```

(shows whether dhcpd daemon is running and most recent logged output)

View all log messages of dhcpcd.service...

```
journalctl --unit dhcpcd.service
```

Enable dhcpcd.service at boot...

```
systemctl enable dhcpcd.service
```

Start dhcpcd.service now (if it's not already running or is disabled)...

```
systemctl start dhcpcd.service
```

The dhcpcd.service should assign an IP address to any interface that is up... It certainly does on my system - even when NetworkManager is broken (once again)   :Rolling Eyes: 

Also worth checking out...

freedesktop.org systemd

As the Gentoo Wiki on systemd is a bit lack-lacklustre at present...

Hope that helps.   :Laughing: 

Bob

----------

## Kompi

 *mreff555 wrote:*   

>  Do I have to use some type of network manager for systemd? I am beginning to come to the concluesion that systemd's "scripts" (please excuse my terminology) will not work with a manual configuration of /etc/wpa_supplicant/wpa_supplicant.conf which is what I have done in the past. is this the case?

 

No, you don't have to use a manager, it should work the way you are trying to do it.

The systemd service file should read the /etc/wpa_supplicant/wpa_supplicant.conf file. That is, at least the version I have installed with the wpa_supplicant package does just that:

 */usr/lib/systemd/system/wpa_supplicant@.service wrote:*   

> ExecStart=/usr/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -i%I

 

If you network is up as you say, then there may be only a problem with getting the IP via DHCP.

What is the output of dhcpcd? (try manually: "dhcpcd wlp4s0" or check the journal)

If there is no response, check you are actually connected and authenticated to the right net ("iwconfig wlp4s0") after wpa_supp is started. If you are, there must be something else wrong with the connection to th DHCP server.

----------

## mreff555

Alright. I got wpa_supplicant working, but the method feels a bit unorthodox to me and I was hoping someone had a better solution. 

I noticed two problems within the wpa_supplicant@.service script.

 1. My wireless card does NOT autodetect the driver. It will not work unless I specify -Dnl80211. As far as I can tell from reading man pages there is no way to specify this in /etc/wpa_supplicant/wpa_supplicant.conf. It seems like there should be.

2.Since my udev uses intelligent device naming my wireless device is wlp4s0, not wlan0.

My changes are in bold.

```

[Unit]

Description=WPA supplicant daemon (interface-specific version)

# NetworkManager users will probably want the dbus version instead.

[Service]

Type=simple

ExecStart=/usr/sbin/wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -i%I[b] -Dnl80211[/b]

[Install]

Alias=multi-user.target.wants/wpa_supplicant@[b]%I[/b].service

```

Now if this is what I have to do I think I remember reading that there is a correct way to manage custom scripts in the /etc directory. In that case I would just disable the original and put this script in /etc/.../. I'm just wondering if there is a better way to do this.

----------

