* bug#29707: "guix system search" doesn't show how to start/stop service
@ 2017-12-14 10:30 Clément Lassieur
2018-04-30 12:53 ` Ludovic Courtès
0 siblings, 1 reply; 6+ messages in thread
From: Clément Lassieur @ 2017-12-14 10:30 UTC (permalink / raw)
To: 29707
The "guix system search" command doesn't show how we are supposed to
start/stop the searched service.
For example, I think it would be useful to know that "herd stop
xmpp-daemon" stops the XMPP server and "herd stop xorg-server" stops the
Xorg server.
Neither "guix system search xorg" nor "guix system search slim" says
anything about "xorg-server".
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#29707: "guix system search" doesn't show how to start/stop service
2017-12-14 10:30 bug#29707: "guix system search" doesn't show how to start/stop service Clément Lassieur
@ 2018-04-30 12:53 ` Ludovic Courtès
2018-04-30 23:38 ` Clément Lassieur
0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2018-04-30 12:53 UTC (permalink / raw)
To: Clément Lassieur; +Cc: 29707-done
Hi Clément,
Clément Lassieur <clement@lassieur.org> skribis:
> The "guix system search" command doesn't show how we are supposed to
> start/stop the searched service.
>
> For example, I think it would be useful to know that "herd stop
> xmpp-daemon" stops the XMPP server and "herd stop xorg-server" stops the
> Xorg server.
>
> Neither "guix system search xorg" nor "guix system search slim" says
> anything about "xorg-server".
Commit 6ac8b7359a1ac80e558f41dd37004ffa727dd3c6 does roughly what you
suggested:
--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix system search slim
name: slim
location: gnu/services/xorg.scm:510:2
extends: shepherd-root pam profile
shepherdnames: xorg-server
relevance: 3
--8<---------------cut here---------------end--------------->8---
Note that there are limitations: here ‘shepherdnames’ is just the list
of names of the _default_ Shepherd services for that service type. But
due to the way service extensions work, actual Shepherd service names
can very well depend on the configuration of the service. For example,
‘console-font-service-type’ generates a Shepherd service whose name
depends on its configuration: ‘console-font-tty1’, etc.
Besides, ‘guix system search xmpp’ currently returns nothing, but it
will return something as soon as you’ve added a ‘description’ to
‘prosody-service-type’. If you add a ‘default-value’, you’ll get
‘shepherdnames’ as well. Hint hint. ;-)
Cheers,
Ludo’.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#29707: "guix system search" doesn't show how to start/stop service
2018-04-30 12:53 ` Ludovic Courtès
@ 2018-04-30 23:38 ` Clément Lassieur
2018-04-30 23:39 ` bug#29707: [PATCH] guix system: search: Display all provision names as 'shepherdnames' Clément Lassieur
0 siblings, 1 reply; 6+ messages in thread
From: Clément Lassieur @ 2018-04-30 23:38 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 29707-done
Hi Ludovic,
Ludovic Courtès <ludo@gnu.org> writes:
> Commit 6ac8b7359a1ac80e558f41dd37004ffa727dd3c6 does roughly what you
> suggested:
>
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guix system search slim
> name: slim
> location: gnu/services/xorg.scm:510:2
> extends: shepherd-root pam profile
> shepherdnames: xorg-server
> relevance: 3
> --8<---------------cut here---------------end--------------->8---
>
> Note that there are limitations: here ‘shepherdnames’ is just the list
> of names of the _default_ Shepherd services for that service type. But
> due to the way service extensions work, actual Shepherd service names
> can very well depend on the configuration of the service. For example,
> ‘console-font-service-type’ generates a Shepherd service whose name
> depends on its configuration: ‘console-font-tty1’, etc.
Great! Thank you! But I don't understand why the first provision is
the only one that is displayed. If it's not on purpose, here is a patch
fixing it.
> Besides, ‘guix system search xmpp’ currently returns nothing, but it
> will return something as soon as you’ve added a ‘description’ to
> ‘prosody-service-type’. If you add a ‘default-value’, you’ll get
> ‘shepherdnames’ as well. Hint hint. ;-)
Haha, okay I did it :-)
Clément
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#29707: [PATCH] guix system: search: Display all provision names as 'shepherdnames'.
2018-04-30 23:38 ` Clément Lassieur
@ 2018-04-30 23:39 ` Clément Lassieur
2018-05-01 19:56 ` Ludovic Courtès
0 siblings, 1 reply; 6+ messages in thread
From: Clément Lassieur @ 2018-04-30 23:39 UTC (permalink / raw)
To: 29707-done
* guix/scripts/system/search.scm (service-type-shepherd-names): Append
provision lists together instead of returning a list of provision cars.
---
guix/scripts/system/search.scm | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/guix/scripts/system/search.scm b/guix/scripts/system/search.scm
index 7229c60a0..955cdd1e9 100644
--- a/guix/scripts/system/search.scm
+++ b/guix/scripts/system/search.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -59,10 +60,8 @@ provided TYPE has a default value."
(define (service-type-shepherd-names type)
"Return the default names of Shepherd services created for TYPE."
- (match (map shepherd-service-provision
- (service-type-default-shepherd-services type))
- (((names . _) ...)
- names)))
+ (append-map shepherd-service-provision
+ (service-type-default-shepherd-services type)))
(define* (service-type->recutils type port
#:optional (width (%text-width))
--
2.17.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-05-01 21:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-14 10:30 bug#29707: "guix system search" doesn't show how to start/stop service Clément Lassieur
2018-04-30 12:53 ` Ludovic Courtès
2018-04-30 23:38 ` Clément Lassieur
2018-04-30 23:39 ` bug#29707: [PATCH] guix system: search: Display all provision names as 'shepherdnames' Clément Lassieur
2018-05-01 19:56 ` Ludovic Courtès
2018-05-01 21:35 ` Clément Lassieur
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).