iwd is packaged but there is no iwd shepherd service

  • Open
  • quality assurance status badge
Details
4 participants
  • Jeremiah
  • Hilton Chain
  • Jack Faller
  • Nikita Domnitskii
Owner
unassigned
Submitted by
Jeremiah
Severity
normal
J
J
Jeremiah wrote on 11 Dec 2022 18:10
(address . bug-guix@gnu.org)
87wn6xn9wn.fsf@ITSx01.pdp10.guru
without a proper shepherd service, users are forced to manually start
the iwd service as root and background the process.

Nor is there any documentation provided to work around this defect.

-Jeremiah
H
H
Hilton Chain wrote on 23 Dec 2022 08:35
(name . Jeremiah)(address . Jeremiah@pdp10.guru)(address . 59971@debbugs.gnu.org)
87y1qy608w.wl-hako@ultrarare.space
Hi Jeremiah,

Toggle quote (5 lines)
> without a proper shepherd service, users are forced to manually start
> the iwd service as root and background the process.
>
> Nor is there any documentation provided to work around this defect.

AFAIK, Nikita Domnitskii has defined an iwd-service-type in their dotfiles:
J
J
Jeremiah wrote on 23 Dec 2022 13:19
(name . Hilton Chain)(address . hako@ultrarare.space)(address . 59971@debbugs.gnu.org)
87fsd6mhwt.fsf@ITSx01.pdp10.guru
Well it is nice to see that someone made a iwd-servce-type, perhaps it
should be integrated into guix services, so that we don't have to copy
that into our configuration or import a channel to run a basic iwd
service.

-Jeremiah
N
N
Nikita Domnitskii wrote on 23 Dec 2022 17:00
Re: bug#59971: iwd is packaged but there is no iwd shepherd service
(address . 59971@debbugs.gnu.org)
875ye22jqh.fsf@domnitskii.me
Jeremiah@pdp10.guru writes:

Toggle quote (4 lines)
> Well it is nice to see that someone made a iwd-servce-type, perhaps it
> should be integrated into guix services, so that we don't have to copy
> that into our configuration or import a channel to run a basic iwd
> service.
Well, I haven't upstreamed it yet because it's not very idiomatic for
guix (alists instead of records) and there is dependency on Andrew
Tropin rde channel. Feel free to borrow some code for use in guix though

--
Best Regards,
Nikita Domnitskii
J
J
Jeremiah wrote on 23 Dec 2022 23:18
(name . Nikita Domnitskii)(address . nikita@domnitskii.me)
87cz89n4qv.fsf@ITSx01.pdp10.guru
Toggle quote (3 lines)
> Well, I haven't upstreamed it yet because it's not very idiomatic for
> guix (alists instead of records) and there is dependency on Andrew
> Tropin rde channel. Feel free to borrow some code for use in guix though
completely fair
and thank you for making the details needed more clear with your work
^_^

-Jeremiah
J
J
Jack Faller wrote on 11 Nov 2023 15:27
(address . 59971@debbugs.gnu.org)
CACv+J2LuVbE-fe0qJJYnAxUiT+2vxctPCcs=YwvEOn5WC-yLgQ@mail.gmail.com
Not sure if this is useful for anyone, but here is a version I have been
using without the RDE dependency.
Attachment: file
(define-module (iwd-service) #:export (iwd-configuration iwd-configuration? iwd-configuration-iwd iwd-configuration-openresolv iwd-configuration-coreutils iwd-configuration-config-file iwd-service-type) #:use-module (gnu) #:use-module (gnu services) #:use-module (gnu system setuid) #:use-module (gnu packages networking) #:use-module (gnu packages dns) #:use-module (gnu services admin) #:use-module (gnu services dbus) #:use-module (gnu services base) #:use-module (gnu services shepherd) #:use-module (gnu services configuration) #:use-module (guix gexp) #:use-module (guix records)) (define-record-type* <iwd-configuration> iwd-configuration make-iwd-configuration iwd-configuration? (iwd iwd-configuration-iwd (default iwd)) (coreutils coreutils-configuration-coreutils (default coreutils)) (openresolv openresolv-configuration-openresolv (default openresolv)) (config-file iwd-configuration-config-file (default (plain-file "iwd-main.conf" (string-join '("[General]" "EnableNetworkConfiguration=true" "[Network]" "NameResolvingService=resolvconf") "\n" 'suffix))))) (define (iwd-shepherd-service config) (match-record config <iwd-configuration> (iwd openresolv coreutils) (let ((environment #~(list (string-append "PATH=" (string-append #$openresolv "/sbin") ":" (string-append #$coreutils "/bin"))))) (list (shepherd-service (documentation "Run Iwd") (provision '(iwd networking)) (requirement '(user-processes dbus-system loopback)) (start #~(make-forkexec-constructor (list (string-append #$iwd "/libexec/iwd")) #:log-file "/var/log/iwd.log" #:environment-variables #$environment)) (stop #~(make-kill-destructor))))))) (define %iwd-log-rotation (list (log-rotation (files '("/var/log/iwd.log"))))) (define (iwd-etc-service config) (match-record config <iwd-configuration> (config-file) `(("iwd/main.conf" ,config-file)))) (define iwd-service-type (let ((add-iwd-package (compose list iwd-configuration-iwd))) (service-type (name 'iwd) (extensions (list (service-extension shepherd-root-service-type iwd-shepherd-service) (service-extension dbus-root-service-type add-iwd-package) (service-extension profile-service-type add-iwd-package) (service-extension etc-service-type iwd-etc-service) (service-extension rottlog-service-type (const %iwd-log-rotation)))) (default-value (iwd-configuration)) (description "Run @url{https://iwd.wiki.kernel.org/,Iwd}, a network connection manager."))))
J
J
Jack Faller wrote on 11 Nov 2023 12:31
(address . 59971@debbugs.gnu.org)
CACv+J2+AiTEhw5rh_wuhivivUJpFDL-WObML2dukTRGq6mubnQ@mail.gmail.com
Not sure if this is useful for anyone, but here is a version I have been
using without the RDE dependency.
Attachment: file
(define-module (iwd-service) #:export (iwd-configuration iwd-configuration? iwd-configuration-iwd iwd-configuration-openresolv iwd-configuration-coreutils iwd-configuration-config-file iwd-service-type) #:use-module (gnu) #:use-module (gnu services) #:use-module (gnu system setuid) #:use-module (gnu packages networking) #:use-module (gnu packages dns) #:use-module (gnu services admin) #:use-module (gnu services dbus) #:use-module (gnu services base) #:use-module (gnu services shepherd) #:use-module (gnu services configuration) #:use-module (guix gexp) #:use-module (guix records)) (define-record-type* <iwd-configuration> iwd-configuration make-iwd-configuration iwd-configuration? (iwd iwd-configuration-iwd (default iwd)) (coreutils coreutils-configuration-coreutils (default coreutils)) (openresolv openresolv-configuration-openresolv (default openresolv)) (config-file iwd-configuration-config-file (default (plain-file "iwd-main.conf" (string-join '("[General]" "EnableNetworkConfiguration=true" "[Network]" "NameResolvingService=resolvconf") "\n" 'suffix))))) (define (iwd-shepherd-service config) (match-record config <iwd-configuration> (iwd openresolv coreutils) (let ((environment #~(list (string-append "PATH=" (string-append #$openresolv "/sbin") ":" (string-append #$coreutils "/bin"))))) (list (shepherd-service (documentation "Run Iwd") (provision '(iwd networking)) (requirement '(user-processes dbus-system loopback)) (start #~(make-forkexec-constructor (list (string-append #$iwd "/libexec/iwd")) #:log-file "/var/log/iwd.log" #:environment-variables #$environment)) (stop #~(make-kill-destructor))))))) (define %iwd-log-rotation (list (log-rotation (files '("/var/log/iwd.log"))))) (define (iwd-etc-service config) (match-record config <iwd-configuration> (config-file) `(("iwd/main.conf" ,config-file)))) (define iwd-service-type (let ((add-iwd-package (compose list iwd-configuration-iwd))) (service-type (name 'iwd) (extensions (list (service-extension shepherd-root-service-type iwd-shepherd-service) (service-extension dbus-root-service-type add-iwd-package) (service-extension profile-service-type add-iwd-package) (service-extension etc-service-type iwd-etc-service) (service-extension rottlog-service-type (const %iwd-log-rotation)))) (default-value (iwd-configuration)) (description "Run @url{https://iwd.wiki.kernel.org/,Iwd}, a network connection manager."))))
?