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

Debbugs page

Jeremiah wrote 2 years ago
(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
Hilton Chain wrote 2 years ago
(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:
Jeremiah wrote 2 years ago
(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
Nikita Domnitskii wrote 2 years ago
Re: bug#59971: iwd is packaged but there is no iwd shepherd service
(address . Jeremiah@pdp10.guru)(name . Hilton Chain)(address . hako@ultrarare.space)(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
Jeremiah wrote 2 years ago
(name . Nikita Domnitskii)(address . nikita@domnitskii.me)(address . hako@ultrarare.space)(address . 59971@debbugs.gnu.org)
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
Jack Faller wrote 1 years ago
(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."))))
Jack Faller wrote 1 years ago
(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."))))
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 59971@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 59971
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help