Hello! I've spent 3 hours reading emacs tutorial and searching for scheme mode 
but did not get result.
Pressing M-q on each paragraph of my config has broke it (attached file with 
suffix emacs).

> Why do you do this all manually instead of using
> wpa-supplicant-service-type and dhcp-client-service-type?

I do have wpa-supplicant-service-type and dhcp-client-service-type, and they do 
not work, cause wlan is soft blocked. I need to use `rfkill unblock wifi` in my 
script, but services do not do this.
After reboot I have `herd status` as in attach, networking is inactive there. I 
think soft blocking happens because there are 2 wlan in my system, a strange 
tun0 has appeared.

# ifconfig
enp3s0    Link encap:Ethernet  HWaddr xx:xx:xx:11
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0  TX bytes:0

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Bcast:0.0.0.0  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0  TX bytes:0

tun0      Link encap:(hwtype unknown)
          inet addr:10.14.0.26  Bcast:0.0.0.0  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:8911 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5637 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:8626006  TX bytes:703476

wlp2s0    Link encap:Ethernet  HWaddr xx:xx:xx:xx:22
          inet addr:192.168.1.33  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10351 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5867 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9765341  TX bytes:1265501

Also I attach some dmesg lines if it will give some info.
Now I have network services, but they do not manage the soft blocking of wifi. 
How to unblock automatically?


April 6, 2019 4:36 AM, "Ricardo Wurmus" <rek...@elephly.net> wrote:

> zna...@tutanota.com writes:
> 
>> Hello! I have several questions about wpa-supplicant + dhcpcd services.
>> 
>> First of all I do not want to use networkmanager and I usually get Internet 
>> working manually with
>> this:
>> # cat startnet
>> #!/bin/sh
>> #connect to wi-fi through wpa_supplicant
>> herd stop wpa-supplicant
>> rfkill unblock wifi
>> wpa_supplicant -B -i wlp2s0 -c /etc/wpa_supplicant/wpa_supplicant.conf
>> sleep 2
>> dhclient -v wlp2s0
> 
> Why do you do this all manually instead of using
> wpa-supplicant-service-type and dhcp-client-service-type?
> 
> Your configuration looks … adventurous. Here are some recommendations:
> 
> * don’t nest modify-services. Nothing good will come of this. It only
> serves to confuse you. “modify-services” can modify more than one
> service at once.
> 
> * don’t leave parentheses on lines all by themselves. They get lonely.
> 
> * don’t use dhcpd-service-type unless you want to run a DHCP server.
> Use dhcp-client-service-type for the DHCP *client*.
> 
> * you don’t need to add wpa-supplicant to the list of globally installed
> packages. The service is enough.
> 
> * maybe try fixing the indentation (Emacs can do this with M-q) — it’s
> very hard to understand the configuration when the indentation tries
> hard to mislead you.
> 
> --
> Ricardo
;;this is znavko's cute config

(use-modules (gnu) (gnu system nss)
             (gnu system locale) ;;for locale-definition
             (gnu services desktop)
             (srfi srfi-1) ;;for remove function
             (gnu services networking) ;;for remove ntp
             (gnu services avahi) ;;for remove avahi
             (gnu services xorg)
             (gnu packages admin) ;;for wpa_supplicant
)
(use-service-modules desktop)
(use-package-modules certs gnome)

(operating-system (host-name "antelope") (timezone "Europe/Moscow") (locale 
"en_US.utf8")
  (bootloader (bootloader-configuration (bootloader grub-bootloader) (target 
"/dev/sda")))
  (file-systems (cons (file-system (device "/dev/sda1") (mount-point "/") (type 
"ext4")) %base-file-systems))
  (swap-devices '("/dev/sda2"))

  (users (cons* (user-account (name "bob") (group "users")
                (supplementary-groups '("wheel" "netdev" "audio" "video"))
                (home-directory "/home/bob"))
                (user-account (name "mom") (group "users")
                (supplementary-groups '("wheel" "netdev" "audio" "video"))
                (home-directory "/home/mom"))
               %base-user-accounts))

  ;; This is where we specify system-wide packages.
  (packages (cons* nss-certs         ;for HTTPS access
                   gvfs              ;for user mounts
                   wpa-supplicant
                   %base-packages))

  (services (cons* 
              (service xfce-desktop-service-type)
              (service dhcp-client-service-type)

              (modify-services      
                (remove (lambda (service)
                  (member (service-kind service)
                    (list ntp-service-type avahi-service-type 
                          bluetooth-service network-manager-service-type)))
                  %desktop-services)  ;end of remove lambda services

                (wpa-supplicant-service-type config =>
                  (wpa-supplicant-configuration
                    (interface "wlp2s0")
                    (config-file "/etc/wpa_supplicant/wpa_supplicant.conf")))

                (gdm-service-type config =>
                  (gdm-configuration
                    (xorg-configuration
                      (xorg-configuration
                        (extra-config  
                          '("Section \"InputClass\"
                              Identifier \"touchpad\"
                              Driver \"libinput\"
                              MatchIsTouchpad \"on\"
                              Option \"Tapping\" \"on\"
                              EndSection")
                )))))

                (elogind-service-type
                  c => (elogind-configuration (handle-lid-switch 'ignore)))
              );;end of modify-services
  ));;end of services

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss)

 (kernel-arguments 
'("modprobe.blacklist=pcspkr,snd_pcsp,wmi,bluetooth,pata_acpi"))

);;end of operating-system

  

;;this is znavko's cute config

(use-modules (gnu) (gnu system nss) (gnu system locale) ;;for
             locale-definition (gnu services desktop) (srfi srfi-1)
             ;;for remove function (gnu services networking) ;;for
             remove ntp (gnu services avahi) ;;for remove avahi (gnu
             services xorg) (gnu packages admin) ;;for wpa_supplicant
             ) (use-service-modules desktop) (use-package-modules
             certs gnome)

(operating-system (host-name "antelope") (timezone "Europe/Moscow")
  (locale "en_US.utf8") (bootloader (bootloader-configuration
  (bootloader grub-bootloader) (target "/dev/sda"))) (file-systems
  (cons (file-system (device "/dev/sda1") (mount-point "/") (type
  "ext4")) %base-file-systems)) (swap-devices '("/dev/sda2"))

  (users (cons* (user-account (name "bob") (group "users")
                (supplementary-groups '("wheel" "netdev" "audio"
                "video")) (home-directory "/home/bob")) (user-account
                (name "mom") (group "users") (supplementary-groups
                '("wheel" "netdev" "audio" "video")) (home-directory
                "/home/mom")) %base-user-accounts))

  ;; This is where we specify system-wide packages.  (packages (cons*
  nss-certs ;for HTTPS access gvfs ;for user mounts wpa-supplicant
  %base-packages))

  (services (cons* (service xfce-desktop-service-type) (service
              dhcp-client-service-type)

              (modify-services (remove (lambda (service) (member
                (service-kind service) (list ntp-service-type
                avahi-service-type bluetooth-service
                network-manager-service-type))) %desktop-services)
                ;end of remove lambda services

                (wpa-supplicant-service-type config =>
                  (wpa-supplicant-configuration (interface "wlp2s0")
                  (config-file
                  "/etc/wpa_supplicant/wpa_supplicant.conf")))

                (gdm-service-type config => (gdm-configuration
                  (xorg-configuration (xorg-configuration
                  (extra-config '("Section \"InputClass\" Identifier
                  \"touchpad\" Driver \"libinput\" MatchIsTouchpad
                  \"on\" Option \"Tapping\" \"on\" EndSection") )))))

                (elogind-service-type c => (elogind-configuration
                  (handle-lid-switch 'ignore))) );;end of
                  modify-services ));;end of services

  ;; Allow resolution of '.local' host names with mDNS.
  (name-service-switch %mdns-host-lookup-nss)

 (kernel-arguments
 '("modprobe.blacklist=pcspkr,snd_pcsp,wmi,bluetooth,pata_acpi"))

);;end of operating-system

  

# herd status
Started:
 + console-font-tty1
 + console-font-tty2
 + console-font-tty3
 + console-font-tty4
 + console-font-tty5
 + console-font-tty6
 + dbus-system
 + elogind
 + file-system-/dev/pts
 + file-system-/dev/shm
 + file-system-/gnu/store
 + file-system-/run/systemd
 + file-system-/run/user
 + file-system-/sys/fs/cgroup
 + file-system-/sys/fs/cgroup/blkio
 + file-system-/sys/fs/cgroup/cpu
 + file-system-/sys/fs/cgroup/cpuacct
 + file-system-/sys/fs/cgroup/cpuset
 + file-system-/sys/fs/cgroup/devices
 + file-system-/sys/fs/cgroup/elogind
 + file-system-/sys/fs/cgroup/freezer
 + file-system-/sys/fs/cgroup/memory
 + file-system-/sys/fs/cgroup/perf_event
 + file-systems
 + guix-daemon
 + host-name
 + loopback
 + nscd
 + root
 + root-file-system
 + swap-/dev/sda2
 + syslogd
 + term-tty1
 + term-tty2
 + term-tty3
 + term-tty4
 + term-tty5
 + term-tty6
 + udev
 + upower-daemon
 + urandom-seed
 + user-file-systems
 + user-processes
 + virtual-terminal
 + wpa-supplicant
 + xorg-server
Stopped:
 - networking
 - term-auto
 - user-homes

[    6.436738] Bluetooth: HCI UART protocol Marvell registered
[    6.445066] 1-1.4.3: Missing Free firmware (non-Free firmware loading is 
disabled)
[    6.449163] cfg80211: Loaded X.509 cert 'sforshee: 00b11111111'
[    6.453753] platform regulatory.0: Direct firmware load for regulatory.db 
failed with error -2
[    6.453837] cfg80211: failed to load regulatory.db
[    6.455260] Bluetooth: Patch file not found /*(DEBLOBBED)*/
[    6.455358] Bluetooth: Loading patch file failed
[    6.455476] ath3k: probe of 1-1.4.3:1.0 failed with error -2
[    6.455608] usbcore: registered new interface driver ath3k
[    6.462512] libphy: r8169: probed
...
[    6.802155] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[    6.802755] ieee80211 phy0: Atheros AR9565 Rev:1 mem=0x111111111, irq=18
[    6.807723] ath9k 0000:02:00.0 wlp2s0: renamed from wlan0
..
[    9.162302] shepherd[1]: Service guix-daemon has been started.
[    9.757077] random: crng init done
[    9.758506] random: 1 urandom warning(s) missed due to ratelimiting
[   10.853034] 0000:03:00.0: Missing Free firmware (non-Free firmware loading 
is disabled)
[   10.854867] r8169 0000:03:00.0 enp3s0: unable to load firmware patch 
/*(DEBLOBBED)*/ (-2)
[   10.856611] Generic PHY r8169-300:00: attached PHY driver [Generic PHY] 
(mii_bus:phy_addr=r8169-300:00, irq=IGNORE)
[   10.957616] r8169 0000:03:00.0 enp3s0: Link is Down
[   25.073090] fuse init (API version 7.28)


Reply via email to