unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#38304] [PATCH]: Make more services one-shot
@ 2019-11-20 19:45 Efraim Flashner
  2019-11-20 19:54 ` Efraim Flashner
  0 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2019-11-20 19:45 UTC (permalink / raw)
  To: 38304


[-- Attachment #1.1: Type: text/plain, Size: 321 bytes --]

After changing the sysctl service to use one-shot I found 3 more that
look like they'd be good choices.


-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #1.2: 0001-services-host-name-Make-service-one-shot.patch --]
[-- Type: text/plain, Size: 957 bytes --]

From 64126d7a861a415bf4faafb30687928742db4f2b Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Wed, 20 Nov 2019 21:36:56 +0200
Subject: [PATCH 1/3] services: host-name: Make service one-shot.

* gnu/services/base.scm (host-name-service-type): Remove 'respawn?'
keyword from shepherd-service-type, add 'one-shot?'.
---
 gnu/services/base.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index b1eff89ecc..7cd42bb30a 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -705,7 +705,7 @@ to add @var{device} to the kernel's entropy pool.  The service will fail if
       (provision '(host-name))
       (start #~(lambda _
                  (sethostname #$name)))
-      (respawn? #f)))))
+      (one-shot? #t)))))
 
 (define (host-name-service name)
   "Return a service that sets the host name to @var{name}."
-- 
2.24.0


[-- Attachment #1.3: 0002-services-console-keymap-service-type-Make-service-on.patch --]
[-- Type: text/plain, Size: 995 bytes --]

From 6c13de1914503afb3533a0fe032b4db767011874 Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Wed, 20 Nov 2019 21:38:18 +0200
Subject: [PATCH 2/3] services: console-keymap-service-type: Make service
 one-shot.

* gnu/services/base.scm (console-keymap-service-type): Remove 'respawn?'
keyword from shepherd-service-type, add 'one-shot?'.
---
 gnu/services/base.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 7cd42bb30a..022bb501ba 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -746,7 +746,7 @@ to add @var{device} to the kernel's entropy pool.  The service will fail if
       (start #~(lambda _
                  (zero? (system* #$(file-append kbd "/bin/loadkeys")
                                  #$@files))))
-      (respawn? #f)))))
+      (one-shot? #t)))))
 
 (define-deprecated (console-keymap-service #:rest files)
   #f
-- 
2.24.0


[-- Attachment #1.4: 0003-services-console-font-shepherd-services-Make-service.patch --]
[-- Type: text/plain, Size: 1054 bytes --]

From 153d02caa1333788df435ca4ffbf915c50d9cb01 Mon Sep 17 00:00:00 2001
From: Efraim Flashner <efraim@flashner.co.il>
Date: Wed, 20 Nov 2019 21:40:50 +0200
Subject: [PATCH 3/3] services: console-font-shepherd-services: Make service
 one-shot.

* gnu/services/base.scm (console-font-shepherd-services): Remove 'stop'
and 'respawn?' keywords from shepherd-service-type, add 'one-shot?'.
---
 gnu/services/base.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 022bb501ba..cef2d4cb2b 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -797,8 +797,7 @@ to add @var{device} to the kernel's entropy pool.  The service will fail if
                                         "-C" #$device #$font))
                           ((0 71) #t)
                           (else #f))))
-             (stop #~(const #t))
-             (respawn? #f)))))
+             (one-shot? #t)))))
        tty+font))
 
 (define console-font-service-type
-- 
2.24.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [bug#38304] [PATCH]: Make more services one-shot
  2019-11-20 19:45 [bug#38304] [PATCH]: Make more services one-shot Efraim Flashner
@ 2019-11-20 19:54 ` Efraim Flashner
  2019-12-08 21:28   ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2019-11-20 19:54 UTC (permalink / raw)
  To: 38304

[-- Attachment #1: Type: text/plain, Size: 3718 bytes --]

On Wed, Nov 20, 2019 at 09:45:44PM +0200, Efraim Flashner wrote:
> After changing the sysctl service to use one-shot I found 3 more that
> look like they'd be good choices.
> 

Actually, it looks like agetty and mingetty both rely on the host-name
service, so that one doesn't look like a good choice after all.

> From 64126d7a861a415bf4faafb30687928742db4f2b Mon Sep 17 00:00:00 2001
> From: Efraim Flashner <efraim@flashner.co.il>
> Date: Wed, 20 Nov 2019 21:36:56 +0200
> Subject: [PATCH 1/3] services: host-name: Make service one-shot.
> 
> * gnu/services/base.scm (host-name-service-type): Remove 'respawn?'
> keyword from shepherd-service-type, add 'one-shot?'.
> ---
>  gnu/services/base.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gnu/services/base.scm b/gnu/services/base.scm
> index b1eff89ecc..7cd42bb30a 100644
> --- a/gnu/services/base.scm
> +++ b/gnu/services/base.scm
> @@ -705,7 +705,7 @@ to add @var{device} to the kernel's entropy pool.  The service will fail if
>        (provision '(host-name))
>        (start #~(lambda _
>                   (sethostname #$name)))
> -      (respawn? #f)))))
> +      (one-shot? #t)))))
>  
>  (define (host-name-service name)
>    "Return a service that sets the host name to @var{name}."
> -- 
> 2.24.0
> 

> From 6c13de1914503afb3533a0fe032b4db767011874 Mon Sep 17 00:00:00 2001
> From: Efraim Flashner <efraim@flashner.co.il>
> Date: Wed, 20 Nov 2019 21:38:18 +0200
> Subject: [PATCH 2/3] services: console-keymap-service-type: Make service
>  one-shot.
> 
> * gnu/services/base.scm (console-keymap-service-type): Remove 'respawn?'
> keyword from shepherd-service-type, add 'one-shot?'.
> ---
>  gnu/services/base.scm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gnu/services/base.scm b/gnu/services/base.scm
> index 7cd42bb30a..022bb501ba 100644
> --- a/gnu/services/base.scm
> +++ b/gnu/services/base.scm
> @@ -746,7 +746,7 @@ to add @var{device} to the kernel's entropy pool.  The service will fail if
>        (start #~(lambda _
>                   (zero? (system* #$(file-append kbd "/bin/loadkeys")
>                                   #$@files))))
> -      (respawn? #f)))))
> +      (one-shot? #t)))))
>  
>  (define-deprecated (console-keymap-service #:rest files)
>    #f
> -- 
> 2.24.0
> 

> From 153d02caa1333788df435ca4ffbf915c50d9cb01 Mon Sep 17 00:00:00 2001
> From: Efraim Flashner <efraim@flashner.co.il>
> Date: Wed, 20 Nov 2019 21:40:50 +0200
> Subject: [PATCH 3/3] services: console-font-shepherd-services: Make service
>  one-shot.
> 
> * gnu/services/base.scm (console-font-shepherd-services): Remove 'stop'
> and 'respawn?' keywords from shepherd-service-type, add 'one-shot?'.
> ---
>  gnu/services/base.scm | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/gnu/services/base.scm b/gnu/services/base.scm
> index 022bb501ba..cef2d4cb2b 100644
> --- a/gnu/services/base.scm
> +++ b/gnu/services/base.scm
> @@ -797,8 +797,7 @@ to add @var{device} to the kernel's entropy pool.  The service will fail if
>                                          "-C" #$device #$font))
>                            ((0 71) #t)
>                            (else #f))))
> -             (stop #~(const #t))
> -             (respawn? #f)))))
> +             (one-shot? #t)))))
>         tty+font))
>  
>  (define console-font-service-type
> -- 
> 2.24.0
> 




-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#38304] [PATCH]: Make more services one-shot
  2019-11-20 19:54 ` Efraim Flashner
@ 2019-12-08 21:28   ` Ludovic Courtès
  2019-12-13 20:50     ` Efraim Flashner
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2019-12-08 21:28 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 38304

Hello!

Efraim Flashner <efraim@flashner.co.il> skribis:

> On Wed, Nov 20, 2019 at 09:45:44PM +0200, Efraim Flashner wrote:
>> After changing the sysctl service to use one-shot I found 3 more that
>> look like they'd be good choices.
>> 
>
> Actually, it looks like agetty and mingetty both rely on the host-name
> service, so that one doesn't look like a good choice after all.

Is it a problem, though?  I think they should still get started, even if
‘host-name’ is one-shot, no?

Conceptually, ‘console-keymap’ and ‘console-font’ do not look like
one-shot to me though: it’s not implemented, but their ‘stop’ method
could very much restore the previous keymap/font.

WDYT?

Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#38304] [PATCH]: Make more services one-shot
  2019-12-08 21:28   ` Ludovic Courtès
@ 2019-12-13 20:50     ` Efraim Flashner
  2019-12-29  8:06       ` Efraim Flashner
  0 siblings, 1 reply; 5+ messages in thread
From: Efraim Flashner @ 2019-12-13 20:50 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 38304

[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]

On Sun, Dec 08, 2019 at 10:28:42PM +0100, Ludovic Courtès wrote:
> Hello!
> 
> Efraim Flashner <efraim@flashner.co.il> skribis:
> 
> > On Wed, Nov 20, 2019 at 09:45:44PM +0200, Efraim Flashner wrote:
> >> After changing the sysctl service to use one-shot I found 3 more that
> >> look like they'd be good choices.
> >> 
> >
> > Actually, it looks like agetty and mingetty both rely on the host-name
> > service, so that one doesn't look like a good choice after all.
> 
> Is it a problem, though?  I think they should still get started, even if
> ‘host-name’ is one-shot, no?

I'll try to test this in the next week or so.

> 
> Conceptually, ‘console-keymap’ and ‘console-font’ do not look like
> one-shot to me though: it’s not implemented, but their ‘stop’ method
> could very much restore the previous keymap/font.
> 

I feel like since these commands don't have an 'undo' command from the
terminal or from various DEs (that I know of) that making them one-shot
would make more sense.

Also we wouldn't want the keymap or font to change during shutdown when
services get stopped.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [bug#38304] [PATCH]: Make more services one-shot
  2019-12-13 20:50     ` Efraim Flashner
@ 2019-12-29  8:06       ` Efraim Flashner
  0 siblings, 0 replies; 5+ messages in thread
From: Efraim Flashner @ 2019-12-29  8:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 38304

[-- Attachment #1: Type: text/plain, Size: 1922 bytes --]

On Fri, Dec 13, 2019 at 10:50:11PM +0200, Efraim Flashner wrote:
> On Sun, Dec 08, 2019 at 10:28:42PM +0100, Ludovic Courtès wrote:
> > Hello!
> > 
> > Efraim Flashner <efraim@flashner.co.il> skribis:
> > 
> > > On Wed, Nov 20, 2019 at 09:45:44PM +0200, Efraim Flashner wrote:
> > >> After changing the sysctl service to use one-shot I found 3 more that
> > >> look like they'd be good choices.
> > >> 
> > >
> > > Actually, it looks like agetty and mingetty both rely on the host-name
> > > service, so that one doesn't look like a good choice after all.
> > 
> > Is it a problem, though?  I think they should still get started, even if
> > ‘host-name’ is one-shot, no?
> 
> I'll try to test this in the next week or so.

I tested this a bit with some other services I'm working on. When
service A is one-shot and service B depends on it, when service B starts
it also 'runs' service A. So it looks like it won't be a problem
after all.

> 
> > 
> > Conceptually, ‘console-keymap’ and ‘console-font’ do not look like
> > one-shot to me though: it’s not implemented, but their ‘stop’ method
> > could very much restore the previous keymap/font.
> > 
> 
> I feel like since these commands don't have an 'undo' command from the
> terminal or from various DEs (that I know of) that making them one-shot
> would make more sense.
> 
> Also we wouldn't want the keymap or font to change during shutdown when
> services get stopped.
> 
> -- 
> Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
> GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
> Confidentiality cannot be guaranteed on emails sent or received unencrypted



-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-29  8:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-20 19:45 [bug#38304] [PATCH]: Make more services one-shot Efraim Flashner
2019-11-20 19:54 ` Efraim Flashner
2019-12-08 21:28   ` Ludovic Courtès
2019-12-13 20:50     ` Efraim Flashner
2019-12-29  8:06       ` Efraim Flashner

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).