unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67649: shepherd: (shepherd support) is visible for start GEXP
@ 2023-12-05 20:10 Attila Lendvai
  2024-03-21 14:56 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Attila Lendvai @ 2023-12-05 20:10 UTC (permalink / raw)
  To: 67649

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

the facts:
----------

start GEXP's of services are loaded into unnamed modules. the definitions from (shepherd support) are visible in these unnamed modules. see the attached rerpoducer.

it can be run with:

$(guix system --no-graphic vm reproducer.scm)

and in the VM (must use fold, because it's a dumb terminal):

cat /var/log/messages | fold -150

and observe that (shepherd support) is listed.


questions:
----------

is this indended? i.e. part of the shepherd API?

if not, then this is probably a bug. looking at the public definitions in (shepherd support), it's not obvious that those are meant to be available for the users of shepherd. either way, this should probably be documented with at least a comment at the top of the file.

if this is intended, then where is this module imported? i looked all around, and i can't seem to find what mechanism imports this support module into the unnamed module that are used for the GEXPs.


my ultimate issue:
------------------

my service code has conflicting definitions with (shepherd support), and i need to know the intent in the shepherd API to decide on the proper fix.

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“Tact is a skill that can turn brutal honesty into just honesty. It's a skill that develops with practice, and one that's harder to use when emotions are running high. But you can't go towards someone with a verbal fist and expect a hug in return. When method matches intention, outcomes are much more peaceful.”
	— Doe Zantamata

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: reproducer.scm --]
[-- Type: text/x-scheme; name=reproducer.scm, Size: 1528 bytes --]

;; Run with something like this:
;; $(guix system --no-graphic vm reproducer.scm)

(define-module (reproducer)
  #:use-module (gnu system)
  #:use-module (gnu system shadow)
  #:use-module (gnu system nss)
  #:use-module (gnu system vm)
  #:use-module (gnu tests)
  #:use-module (gnu services)
  #:use-module (gnu services base)
  #:use-module (gnu services dbus)
  #:use-module (gnu services shepherd)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages certs)
  #:use-module (gnu packages package-management)
  #:use-module (gnu packages linux)
  #:use-module (guix gexp)
  #:use-module (guix git)
  #:use-module (guix git-download)
  #:use-module (guix store)
  #:use-module (guix modules)
  #:use-module (guix packages)
  #:use-module (srfi srfi-1)
  #:use-module (ice-9 match))

(operating-system
  (inherit %simple-os)
  (services
   (cons*
    (simple-service
     'reproducer
     shepherd-root-service-type
     (list
      (shepherd-service
       (requirement '(file-systems))
       (provision '(reproducer))
       (documentation "")
       (start
        #~(begin
            (lambda _
              (format #t "*** reproducer gexp speaking, \
current module: ~A, \
module-uses: ~A, \
ringbuffer: ~A~%"
                      (current-module)
                      (module-uses (current-module))
                      (and=> (module-variable (current-module) 'ring-buffer) variable-ref))
              0))))))
    %base-services)))

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

end of thread, other threads:[~2024-03-31 14:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-05 20:10 bug#67649: shepherd: (shepherd support) is visible for start GEXP Attila Lendvai
2024-03-21 14:56 ` Ludovic Courtès
2024-03-31 14:20   ` Ludovic Courtès

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).