Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rfkill geht nicht persistent

112 views
Skip to first unread message

Christian Knoke

unread,
Sep 6, 2021, 5:00:03 AM9/6/21
to

[Da habe ich eben Unsinn gemacht und 180 KB Logs gesendet. Hoffentlich wird
das gelöscht.]

[Redacted - Resend]

Hallo,

% rfkill block all

blockt WLAN und BT soft. Nur beim Starten ist wieder alles entsperrt.
Das ist nicht sinnvoll.

In der Annahme, ich brauche einen Dienst, der es beim Start richtet,
habe ich urfkill installiert. Das half nicht.

Gestern habe ich noch liburfkill-glib0 installiert. Das half auch nicht.

Nun ist das systemd Journal voll von Meldungen zu rfkill. Vielleicht mag
jemand hineingucken.

Wie soll das funktionieren? systemd startet einen Dienst, der beim booten
die Geräte einstellt, ggffls blockt, und beim runterfahren wieder
speichert? Kann man die Einstellungen nicht einfach in eine conf Datei
schreiben? Das würde reichen, die Tasten (USB-Tastatur) sind weniger wichtig.

Und wie kriege ich einen "hard block"?

TIA

Gruß
Christian

-----------------------
Sep 06 10:08:33 localhost systemd[1]: Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
Sep 06 10:08:35 localhost URfkill[669]: Starting urfkilld version 0.5.0
Sep 06 10:08:35 localhost dbus-daemon[630]: [system] Activating via systemd: service name='org.freedesktop.PolicyKit1' unit='polkit.service' requested by ':1.6' (uid=0 pid=669 comm="/usr/lib/x86_64-linux-gnu/urfkill/urfkilld ")
Sep 06 10:08:35 localhost kernel: rfkill: input handler disabled
Sep 06 10:08:35 localhost URfkill[669]: <warning> Failed to write persistence data: Failed to create file “/var/lib/urfkill/saved-states.OTE280”: No such file or directory
Sep 06 10:08:35 localhost kernel: rfkill: input handler enabled
Sep 06 10:08:35 localhost systemd[1]: urfkill.service: Main process exited, code=exited, status=1/FAILURE
Sep 06 10:08:35 localhost systemd[1]: urfkill.service: Failed with result 'exit-code'.
Sep 06 10:08:35 localhost systemd[1]: urfkill.service: Scheduled restart job, restart counter is at 1.
Sep 06 10:08:35 localhost URfkill[891]: Starting urfkilld version 0.5.0
Sep 06 10:08:35 localhost kernel: rfkill: input handler disabled
Sep 06 10:08:35 localhost URfkill[891]: <warning> Failed to write persistence data: Failed to create file “/var/lib/urfkill/saved-states.Z8ML90”: No such file or directory
Sep 06 10:08:35 localhost systemd[1]: urfkill.service: Main process exited, code=exited, status=1/FAILURE
Sep 06 10:08:35 localhost systemd[1]: urfkill.service: Failed with result 'exit-code'.
Sep 06 10:08:35 localhost kernel: rfkill: input handler enabled
Sep 06 10:08:35 localhost systemd[1]: urfkill.service: Scheduled restart job, restart counter is at 2.
Sep 06 10:08:35 localhost URfkill[897]: Starting urfkilld version 0.5.0
Sep 06 10:08:35 localhost kernel: rfkill: input handler disabled
Sep 06 10:08:35 localhost URfkill[897]: <warning> Failed to write persistence data: Failed to create file “/var/lib/urfkill/saved-states.DEHO90”: No such file or directory
Sep 06 10:08:35 localhost systemd[1]: urfkill.service: Main process exited, code=exited, status=1/FAILURE
Sep 06 10:08:35 localhost systemd[1]: urfkill.service: Failed with result 'exit-code'.
Sep 06 10:08:35 localhost kernel: rfkill: input handler enabled
Sep 06 10:08:35 localhost NetworkManager[633]: <info> [1630915715.6649] rfkill1: found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/ieee80211/phy0/rfkill1) (driver iwlwifi)
Sep 06 10:08:35 localhost NetworkManager[633]: <info> [1630915715.6650] manager[0x55b913e12040]: rfkill: Wi-Fi hardware radio set enabled
Sep 06 10:08:35 localhost NetworkManager[633]: <info> [1630915715.6650] manager[0x55b913e12040]: rfkill: WWAN hardware radio set enabled
Sep 06 10:08:35 localhost NetworkManager[633]: <info> [1630915715.6720] manager: rfkill: Wi-Fi enabled by radio killswitch; enabled by state file
Sep 06 10:08:35 localhost NetworkManager[633]: <info> [1630915715.6721] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
Sep 06 10:08:36 localhost systemd[1]: urfkill.service: Scheduled restart job, restart counter is at 3.
Sep 06 10:08:36 localhost URfkill[905]: Starting urfkilld version 0.5.0
Sep 06 10:08:36 localhost kernel: rfkill: input handler disabled
Sep 06 10:08:36 localhost URfkill[905]: <warning> Failed to write persistence data: Failed to create file “/var/lib/urfkill/saved-states.DH6980”: No such file or directory
Sep 06 10:08:36 localhost kernel: rfkill: input handler enabled
Sep 06 10:08:36 localhost systemd[1]: urfkill.service: Main process exited, code=exited, status=1/FAILURE
Sep 06 10:08:36 localhost systemd[1]: urfkill.service: Failed with result 'exit-code'.
Sep 06 10:08:36 localhost systemd[1]: urfkill.service: Scheduled restart job, restart counter is at 4.
Sep 06 10:08:36 localhost URfkill[909]: Starting urfkilld version 0.5.0
Sep 06 10:08:36 localhost kernel: rfkill: input handler disabled
Sep 06 10:08:36 localhost URfkill[909]: <warning> Failed to write persistence data: Failed to create file “/var/lib/urfkill/saved-states.KXN280”: No such file or directory
Sep 06 10:08:36 localhost systemd[1]: urfkill.service: Main process exited, code=exited, status=1/FAILURE
Sep 06 10:08:36 localhost systemd[1]: urfkill.service: Failed with result 'exit-code'.
Sep 06 10:08:36 localhost kernel: rfkill: input handler enabled
Sep 06 10:08:36 localhost systemd[1]: urfkill.service: Scheduled restart job, restart counter is at 5.
Sep 06 10:08:36 localhost systemd[1]: urfkill.service: Start request repeated too quickly.
Sep 06 10:08:36 localhost systemd[1]: urfkill.service: Failed with result 'exit-code'.
Sep 06 10:08:40 localhost systemd[1]: systemd-rfkill.service: Succeeded.
Sep 06 10:08:43 localhost systemd-xdg-autostart-generator[1416]: Exec binary '/usr/libexec/gsd-rfkill' does not exist: No such file or directory
Sep 06 10:08:54 localhost systemd-xdg-autostart-generator[1539]: Exec binary '/usr/libexec/gsd-rfkill' does not exist: No such file or directory
Sep 06 10:09:03 localhost rfkill[1854]: block set for all
Sep 06 10:09:03 localhost NetworkManager[633]: <info> [1630915743.9307] manager: rfkill: Wi-Fi now disabled by radio killswitch
Sep 06 10:09:08 localhost systemd[1]: systemd-rfkill.service: Succeeded.
Sep 06 10:13:37 localhost systemd-xdg-autostart-generator[2100]: Exec binary '/usr/libexec/gsd-rfkill' does not exist: No such file or directory
--------------

--
http://cknoke.de

Ulf Volmer

unread,
Sep 6, 2021, 12:10:04 PM9/6/21
to
On 06.09.21 10:50, Christian Knoke wrote:

> % rfkill block all
>
> blockt WLAN und BT soft. Nur beim Starten ist wieder alles entsperrt.
> Das ist nicht sinnvoll.

Das mag stimmen, ist aber meines Wissens nicht vorgesehen.
Schreib Dir halt eine Unit, die den Status wegspeichert und nach dem
Reboot wieder restauriert.

> Und wie kriege ich einen "hard block"?

Indem Du den Schalter am Gerät betätigst.

Viele Grüße
Ulf

Ulf Volmer

unread,
Sep 6, 2021, 1:50:03 PM9/6/21
to
On 06.09.21 19:31, Christoph Schmees wrote:
> Am 06.09.21 um 16:04 schrieb Ulf Volmer:
>> On 06.09.21 10:50, Christian Knoke wrote:

>>> Und wie kriege ich einen "hard block"?
>>
>> Indem Du den Schalter am Gerät betätigst.
>> ...
> ..., den nicht alle Geräte haben!

Ja, dann geht halt kein Hard Block.

> Aber was immer geht ist per BIOS deaktivieren.

Was aber nicht zum gleichen Resultat führt.

Viele Grüße
Ulf

Christoph Schmees

unread,
Sep 6, 2021, 1:50:03 PM9/6/21
to
Am 06.09.21 um 16:04 schrieb Ulf Volmer:
> ...
..., den nicht alle Geräte haben!

Aber was immer geht ist per BIOS deaktivieren.

hth
Christoph

--
Bitte keine Mails von USA-Providern wie AOL, me.com(icloud (Apple),
gmail (Google), hotmail/outlook.com (Microsoft) oder yahoo.
Solche Mails werden ohne Rückmeldung gelöscht.

Christian Knoke

unread,
Sep 7, 2021, 6:50:03 AM9/7/21
to

Moin,

On Mon, 6 Sep 2021 18:04:24 +0200
Ulf Volmer <u.vo...@u-v.de> wrote:

> On 06.09.21 10:50, Christian Knoke wrote:
>
> > % rfkill block all
> >
> > blockt WLAN und BT soft. Nur beim Starten ist wieder alles entsperrt.
> > Das ist nicht sinnvoll.
>
> Das mag stimmen, ist aber meines Wissens nicht vorgesehen.
> Schreib Dir halt eine Unit, die den Status wegspeichert und nach dem
> Reboot wieder restauriert.

Glücklicherweise hat das schon jemand gemacht:

~$ apropos rfkill
rfkill (8) - Werkzeug zum Aktivieren und Deaktivieren von Drahtlosgeräten
systemd-rfkill (8) - Laden und Speichern des RF-Kill-Schalters beim Systemstart...
...

Es sieht so aus als ob er läuft, oder doch nicht:

root@localhost:~# systemctl status systemd-rfkill.socket
● systemd-rfkill.socket - Load/Save RF Kill Switch Status /dev/rfkill Watch
Loaded: loaded (/lib/systemd/system/systemd-rfkill.socket; static)
Active: active (listening) since Tue 2021-09-07 11:42:58 CEST; 39min ago
Triggers: ● systemd-rfkill.service
Docs: man:systemd-rfkill.socket(8)
Listen: /dev/rfkill (Special)
CGroup: /system.slice/systemd-rfkill.socket

Sep 07 11:42:58 localhost systemd[1]: Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
root@localhost:~# systemctl status systemd-rfkill
● systemd-rfkill.service - Load/Save RF Kill Switch Status
Loaded: loaded (/lib/systemd/system/systemd-rfkill.service; static)
Active: inactive (dead) since Tue 2021-09-07 11:44:26 CEST; 39min ago
TriggeredBy: ● systemd-rfkill.socket
Docs: man:systemd-rfkill.service(8)
Process: 1841 ExecStart=/lib/systemd/systemd-rfkill (code=exited, status=0/SUCCESS)
Main PID: 1841 (code=exited, status=0/SUCCESS)
CPU: 9ms

Sep 07 11:44:21 localhost systemd[1]: Starting Load/Save RF Kill Switch Status...
Sep 07 11:44:21 localhost systemd[1]: Started Load/Save RF Kill Switch Status.
Sep 07 11:44:26 localhost systemd[1]: systemd-rfkill.service: Succeeded.

Den Logfiles nach wird er gestartet, und schaltet Wi-Fi frei. Dann deaktiviere
ich es von Hand. Beim Shutdown wird aber nichts gespeichert.

Die entsprechenden Meldungen des heutigen Boots hänge ich unten an den Text.
Ich kann den WLAN Status wirksam ändern, aber gespeichert wird er nicht.

chris@localhost:~$ ls -l /var/lib/systemd/rfkill/*
-rw-r--r-- 1 root root 2 7. Sep 11:43 /var/lib/systemd/rfkill/pci-0000:00:14.0-usb-0:10:1.0:bluetooth
-rw-r--r-- 1 root root 2 7. Sep 11:44 /var/lib/systemd/rfkill/pci-0000:02:00.0:wlan
chris@localhost:~$ cat /var/lib/systemd/rfkill/*
1
1

Beide sind als "enabled" gespeichert. Das sind sie aber nicht:

root@localhost:~# LANG= rfkill
ID TYPE DEVICE SOFT HARD
0 bluetooth hci0 blocked unblocked
1 wlan phy0 blocked unblocked

Gruß
Christian



SHUTDOWN 2
--
Sep 07 00:23:17 localhost systemd-xdg-autostart-generator[2035]: Not generating service for XDG autostart app-org.gnome.Evolution\x2dalarm\x2dnotify-autostart.service, error parsing Exec= line: No such file or directory
Sep 07 00:23:17 localhost systemd-xdg-autostart-generator[2035]: Exec binary '/usr/libexec/gsd-rfkill' does not exist: No such file or directory
Sep 07 00:23:17 localhost systemd-xdg-autostart-generator[2035]: Not generating service for XDG autostart app-org.gnome.SettingsDaemon.Rfkill-autostart.service, error parsing Exec= line: No such file or directory
--
Sep 07 00:25:29 localhost systemd[1]: Closed LVM2 poll daemon socket.
Sep 07 00:25:29 localhost systemd[1]: systemd-rfkill.socket: Succeeded.
Sep 07 00:25:29 localhost systemd[1]: Closed Load/Save RF Kill Switch Status /dev/rfkill Watch.
Sep 07 00:25:29 localhost ModemManager[804]: <info> caught signal, shutting down...
--

BOOT 3
--
Sep 07 11:42:58 localhost systemd[1]: Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
Sep 07 11:42:58 localhost systemd[1]: Starting Load/Save RF Kill Switch Status...
--
Sep 07 11:43:00 localhost ModemManager[791]: <info> ModemManager (version 1.14.12) starting in system bus...
Sep 07 11:43:00 localhost bluetoothd[621]: Failed to set mode: Blocked through rfkill (0x12)
--
Sep 07 11:43:01 localhost NetworkManager[627]: <info> [1631007781.0274] dns-mgr[0x561f798f1170]: init: dns=default,systemd-resolved rc-manager=resolvconf (auto)
Sep 07 11:43:01 localhost NetworkManager[627]: <info> [1631007781.0278] rfkill1: found Wi-Fi radio killswitch (at /sys/devices/pci0000:00/0000:00:1c.0/0000:02:00.0/ieee80211/phy0/rfkill1) (driver iwlwifi)
Sep 07 11:43:01 localhost NetworkManager[627]: <info> [1631007781.0279] manager[0x561f798f7030]: rfkill: Wi-Fi hardware radio set enabled
Sep 07 11:43:01 localhost NetworkManager[627]: <info> [1631007781.0279] manager[0x561f798f7030]: rfkill: WWAN hardware radio set enabled
Sep 07 11:43:01 localhost NetworkManager[627]: <info> [1631007781.0299] Loaded device plugin: NMAtmManager (/usr/lib/x86_64-linux-gnu/NetworkManager/1.30.0/libnm-device-plugin-adsl.so)
--
Sep 07 11:43:01 localhost NetworkManager[627]: <info> [1631007781.0346] Loaded device plugin: NMWifiFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/1.30.0/libnm-device-plugin-wifi.so)
Sep 07 11:43:01 localhost NetworkManager[627]: <info> [1631007781.0347] manager: rfkill: Wi-Fi disabled by radio killswitch; enabled by state file
Sep 07 11:43:01 localhost NetworkManager[627]: <info> [1631007781.0347] manager: rfkill: WWAN enabled by radio killswitch; enabled by state file
Sep 07 11:43:01 localhost NetworkManager[627]: <info> [1631007781.0348] manager: Networking is disabled by state file
--
Sep 07 11:43:01 localhost NetworkManager[627]: <info> [1631007781.0401] manager: rfkill: Wi-Fi now enabled by radio killswitch
Sep 07 11:43:01 localhost systemd[1]: Started Network Manager Script Dispatcher Service.
--
Sep 07 11:43:06 localhost systemd[1]: systemd-rfkill.service: Succeeded.
--
Sep 07 11:43:07 localhost systemd-xdg-autostart-generator[1451]: Not generating service for XDG autostart app-org.gnome.SettingsDaemon.Housekeeping-autostart.service, error parsing Exec= line: No such file or directory
Sep 07 11:43:07 localhost systemd-xdg-autostart-generator[1451]: Exec binary '/usr/libexec/gsd-rfkill' does not exist: No such file or directory
Sep 07 11:43:07 localhost systemd-xdg-autostart-generator[1451]: Not generating service for XDG autostart app-org.gnome.SettingsDaemon.Rfkill-autostart.service, error parsing Exec= line: No such file or directory
--
Sep 07 11:43:16 localhost systemd-xdg-autostart-generator[1514]: Not generating service for XDG autostart app-org.gnome.SettingsDaemon.PrintNotifications-autostart.service, error parsing Exec= line: No such file or directory
Sep 07 11:43:16 localhost systemd-xdg-autostart-generator[1514]: Exec binary '/usr/libexec/gsd-rfkill' does not exist: No such file or directory
Sep 07 11:43:16 localhost systemd-xdg-autostart-generator[1514]: Not generating service for XDG autostart app-org.gnome.SettingsDaemon.Rfkill-autostart.service, error parsing Exec= line: No such file or directory
--
Sep 07 11:44:21 localhost rfkill[1839]: block set for all
Sep 07 11:44:21 localhost systemd[1]: Starting Load/Save RF Kill Switch Status...
Sep 07 11:44:21 localhost NetworkManager[627]: <info> [1631007861.9658] manager: rfkill: Wi-Fi now disabled by radio killswitch
Sep 07 11:44:21 localhost systemd[1]: Started Load/Save RF Kill Switch Status.
Sep 07 11:44:26 localhost systemd[1]: systemd-rfkill.service: Succeeded.
--


--
http://cknoke.de

Ulf Volmer

unread,
Sep 7, 2021, 10:10:03 AM9/7/21
to
On 07.09.21 12:42, Christian Knoke wrote:
> On Mon, 6 Sep 2021 18:04:24 +0200
> Ulf Volmer <u.vo...@u-v.de> wrote:

>> Schreib Dir halt eine Unit, die den Status wegspeichert und nach dem
>> Reboot wieder restauriert.
>
> Glücklicherweise hat das schon jemand gemacht:
>
> ~$ apropos rfkill
> rfkill (8) - Werkzeug zum Aktivieren und Deaktivieren von Drahtlosgeräten
> systemd-rfkill (8) - Laden und Speichern des RF-Kill-Schalters beim Systemstart...

Danke, kannte ich noch nicht.

> chris@localhost:~$ ls -l /var/lib/systemd/rfkill/*
> -rw-r--r-- 1 root root 2 7. Sep 11:43 /var/lib/systemd/rfkill/pci-0000:00:14.0-usb-0:10:1.0:bluetooth
> -rw-r--r-- 1 root root 2 7. Sep 11:44 /var/lib/systemd/rfkill/pci-0000:02:00.0:wlan
> chris@localhost:~$ cat /var/lib/systemd/rfkill/*
> 1
> 1
>
> Beide sind als "enabled" gespeichert. Das sind sie aber nicht:
>
> root@localhost:~# LANG= rfkill
> ID TYPE DEVICE SOFT HARD
> 0 bluetooth hci0 blocked unblocked
> 1 wlan phy0 blocked unblocked

Bist Du sicher, dass das 1 für enabled steht? Hier (ich habe gerade nur
ein Fedora zur Hand, booten möchte ich auch nur ungern) sieht das anders
aus:

[ulf@p330 ~]$ rfkill
ID TYPE DEVICE SOFT HARD
0 bluetooth hci0 unblocked unblocked
[ulf@p330 ~]$ cat
/var/lib/systemd/rfkill/pci-0000\:00\:14.0-usb-0\:4\:1.0\:bluetooth

0
[ulf@p330 ~]$ rfkill block 0
[ulf@p330 ~]$ rfkill
ID TYPE DEVICE SOFT HARD
0 bluetooth hci0 blocked unblocked
[ulf@p330 ~]$ cat
/var/lib/systemd/rfkill/pci-0000\:00\:14.0-usb-0\:4\:1.0\:bluetooth
1

Viele Grüße
Ulf

Michael Biebl

unread,
Sep 7, 2021, 11:20:07 AM9/7/21
to
1 bedeuted disabled. Das passt zu dem output von rfkill, der beide geräte
als soft-blocked anzeigt.
signature.asc
0 new messages