You are not logged in.

#1 2020-03-12 10:35:01

VannTen
Member
Registered: 2019-09-26
Posts: 1

Netctl-auto special unit works, netctl-auto cli does not see profiles

Hi.

I tried the other day to use

netctl-auto switch-to $PROFILE

, and I encountered the error

Profile '$PROFILE' does not exist or is not available

which is weird, since my special systemd unit has no trouble loading the various profiles and my connection works
Output of `journalctl -u netctl-auto@wlp2s0 -e -n 40`

-- Logs begin at Mon 2019-09-02 11:50:10 CEST, end at Thu 2020-03-12 11:22:20 CET. --
Mar 12 09:39:51 maxpc dhcpcd[190143]: wlp2s0: adding default route via 192.168.10.253
Mar 12 09:39:51 maxpc dhcpcd[190143]: forked to background, child pid 190163
Mar 12 11:21:50 maxpc systemd[1]: Stopping Automatic wireless network connection using netctl profiles...
Mar 12 11:21:50 maxpc dhcpcd[193799]: sending signal TERM to pid 190163
Mar 12 11:21:50 maxpc dhcpcd[193799]: waiting for pid 190163 to exit
Mar 12 11:21:50 maxpc dhcpcd[190163]: received SIGTERM, stopping
Mar 12 11:21:50 maxpc dhcpcd[190163]: wlp2s0: removing interface
Mar 12 11:21:50 maxpc dhcpcd[190163]: dhcpcd exited
Mar 12 11:21:50 maxpc systemd[1]: netctl-auto@wlp2s0.service: Succeeded.
Mar 12 11:21:50 maxpc systemd[1]: Stopped Automatic wireless network connection using netctl profiles.
Mar 12 11:22:11 maxpc systemd[1]: Starting Automatic wireless network connection using netctl profiles...
Mar 12 11:22:11 maxpc netctl-auto[193921]: Included profile '$PROFILE'
# Same thing for all the other profile in my /etc/netctl dir
Mar 12 11:22:11 maxpc systemd[1]: Started Automatic wireless network connection using netctl profiles.
Mar 12 11:22:14 maxpc dhcpcd[193994]: wlp2s0: connected to Access Point `OL-PARIS-WIFI-GUEST'
Mar 12 11:22:14 maxpc dhcpcd[193994]: DUID 00:04:4c:4c:45:44:00:51:47:10:80:5a:c8:c0:4f:4c:37:32
Mar 12 11:22:14 maxpc dhcpcd[193994]: wlp2s0: IAID b5:9a:ea:61
Mar 12 11:22:15 maxpc dhcpcd[193994]: wlp2s0: rebinding lease of 192.168.10.72
Mar 12 11:22:15 maxpc dhcpcd[193994]: wlp2s0: probing address 192.168.10.72/24
Mar 12 11:22:20 maxpc dhcpcd[193994]: wlp2s0: leased 192.168.10.72 for 7200 seconds
Mar 12 11:22:20 maxpc dhcpcd[193994]: wlp2s0: adding route to 192.168.10.0/24
Mar 12 11:22:20 maxpc dhcpcd[193994]: wlp2s0: adding default route via 192.168.10.253
Mar 12 11:22:20 maxpc dhcpcd[193994]: forked to background, child pid 194003
netctl-auto list

does not show anything either, but

nectl list

does show all of my profiles ! Somehow, netctl-auto does not find the profiles.

Does anyone would have an idea of what's going on ? (I probably missed something, but can't think anything in the manual or in the forums that would point me to the problem)

Btw, the netctl version is 1.20.

Thanks in advance if you have any idea smile

Offline

#2 2020-03-13 12:33:52

daniel.appelt
Member
Registered: 2012-12-29
Posts: 3

Re: Netctl-auto special unit works, netctl-auto cli does not see profiles

Hey there! I am seeing the same phenomenon. Connection via the netctl-auto systemd unit seems to work as before, but

netctl-auto list

produces no output. The last time that I have used this command - some days, maybe weeks ago - the list was produced as expected.

Offline

#3 2020-03-13 15:27:13

orsa
Member
Registered: 2016-08-23
Posts: 2

Re: Netctl-auto special unit works, netctl-auto cli does not see profiles

I believe I've found the problem. The script /usr/bin/netctl-auto has a function list_netctl_auto_interfaces(), which searches all network interfaces controlled by netctl-auto by running the command

systemctl --full --no-legend --no-pager --type=service --state=running list-units | sed -nr 's/^netctl-auto@([[:alnum:]]+).*/\1/p'

I tried running this manually and got nothing in return. Changing the above command to simply

echo "wlo1"

fixed the issue for me (of course, you should replace wlo1 with whatever your wireless interface name is).

Given the timing of the issue and the recently upgraded packages in my system, I'm guessing what caused this issue systemd (netctl hasn't changed since November 2019). There has probably been some change in how "systemctl --list-units" displays its results, causing the "sed" part of the command to not pick up the interface names correctly. I don't know enough about regexp to fix the issue without hardcoding my interface name into the script tongue but it should be pretty simple.

Also, it seems like the netctl package is orphaned, so I'm not sure who we should report this to...

Offline

#4 2020-03-13 16:49:47

radmac
Member
Registered: 2019-03-12
Posts: 2

Re: Netctl-auto special unit works, netctl-auto cli does not see profiles

The problem seems to be those two spaces at the begining of the output of

systemctl --full --no-legend --no-pager --type=service --state=running list-units

therefore if you change the sed command to

sed -nr 's/^  netctl-auto@([[:alnum:]]+).*/\1/p'

it should work.
But I am no expert neither on sed nor on systemd...

Offline

#5 2020-03-14 17:28:50

stepnem
Member
Registered: 2019-08-04
Posts: 12

Re: Netctl-auto special unit works, netctl-auto cli does not see profiles

radmac wrote:

But I am no expert neither on sed nor on systemd...

Neither am I, but according to systemctl(1) man page, the command intended for computer-parsable output is "show", not "list-units".

Maybe something like

systemctl --state=running --property=Id show '*' | sed -nr 's/.*netctl-auto@([[:alnum:]]+).*/\1/p'

would be more like it.

Offline

#6 2020-03-17 01:39:49

bhagwan
Member
Registered: 2020-01-28
Posts: 1

Re: Netctl-auto special unit works, netctl-auto cli does not see profiles

I just discovered this bug today, fixed it myself with a similar fix to what was posted by @radmac, didn't see this thread before so I came here to post about this issue and you guys beat me to it.

Anyways I opened an issue at the netctl github page:
https://github.com/joukewitteveen/netctl/issues/176

Offline

#7 2020-03-17 03:33:03

Brocellous
Member
Registered: 2017-11-27
Posts: 39

Re: Netctl-auto special unit works, netctl-auto cli does not see profiles

The change in output formats is a bug in systemd: https://github.com/systemd/systemd/issues/15077.

You should file an archlinux bug report for issues with netctl. You can reference the issue and the fix, or this bug/request: https://bugs.archlinux.org/task/65823

Offline

Board footer

Powered by FluxBB