GNU bug report logs -
#73467
[PATCH] Wireguard: Add autostart? field.
Previous Next
Full log
View this message in rfc822 format
Apoorv Singh <apoorvs569 <at> gmail.com> writes:
> The following patch adds a record field autostart? which can be used by the user
> to configure weather the wireguard service should start automatically.
I generally agree that there should be a way to disable autostart and
I've solved it in a more generic way:
--8<---------------cut here---------------start------------->8---
(define (no-autostart input-service)
"Augment shepherd extension of INPUT-SERVICE to disable auto-start."
(define (transform-extension ex)
(match ex
(($ (@@ (gnu services) <service-extension>)
(and ($ (@@ (gnu services) <service-type>) 'shepherd-root _) kind)
compute)
(service-extension
kind
(lambda (config)
(let ((orig (car (compute config))))
(list (shepherd-service (inherit orig) (auto-start? #f)))))))
(_ ex)))
(match input-service
(($ (@@ (gnu services) <service>)
(and ($ (@@ (gnu services) <service-type>) _ extensions _) kind)
value)
(service
(service-type
(inherit kind)
(extensions (map transform-extension extensions)))
value))))
--8<---------------cut here---------------end--------------->8---
Anyway, you need to document the new configuration parameter in the manual.
This bug report was last modified 97 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.