unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* how to print values inside shepherd service gexp
@ 2023-03-24 14:55 Vladilen Kozin
  2023-03-27  8:52 ` Attila Lendvai
  0 siblings, 1 reply; 2+ messages in thread
From: Vladilen Kozin @ 2023-03-24 14:55 UTC (permalink / raw)
  To: guix-devel

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

Hello. I probably have all phases screwed up in my head now.

(shepherd-service
  (start
#~(make-forkexec-constructor
                   some-command
                   #:directory (pk #$twgter-directory)
                   #:log-file (pk #$twgter-log-file))
))

If we instantiate this process in our OS declaration under services and
then run that OS inside a container and `herd start this-service`, where
would the above (pk ..) values show up? They aren't in /var/log/messages
and they aren't in whatever #:log-file we specified. I imagine this gexp
turns into a Guile script somewhere inside the store and Shepherd runs it
when we start the service.

More generally, how to I print stuff inside gexps that are part of services.

Thank you

-- 
Best regards
Vlad Kozin

[-- Attachment #2: Type: text/html, Size: 1833 bytes --]

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

* Re: how to print values inside shepherd service gexp
  2023-03-24 14:55 how to print values inside shepherd service gexp Vladilen Kozin
@ 2023-03-27  8:52 ` Attila Lendvai
  0 siblings, 0 replies; 2+ messages in thread
From: Attila Lendvai @ 2023-03-27  8:52 UTC (permalink / raw)
  To: Vladilen Kozin; +Cc: guix-devel

> (shepherd-service
> (start
> #~(make-forkexec-constructor
> some-command
> #:directory (pk #$twgter-directory)
> #:log-file (pk #$twgter-log-file))
> ))
> 
> If we instantiate this process in our OS declaration under services
> and then run that OS inside a container and `herd start
> this-service`, where would the above (pk ..) values show up? They
> aren't in /var/log/messages and they aren't in whatever #:log-file we
> specified. I imagine this gexp turns into a Guile script somewhere
> inside the store and Shepherd runs it when we start the service.


my understanding is that they will run when shepherd starts the
service, and it should land in /var/log/messages.

but in my experience shepherd's handling of logs and stdout should
receive some more care.

e.g. errors from the start GEXP are not logged, and if an error
happens before your pk's, then you won't see any sign of them.

i have a commit that i'm testing locally that addresses that:

https://github.com/attila-lendvai-patches/shepherd/commits/attila

HTH,

-- 
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“What you do speaks so loud I cannot hear what you say.”
	— Ralph Waldo Emerson (1803–1882)



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

end of thread, other threads:[~2023-03-27  8:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 14:55 how to print values inside shepherd service gexp Vladilen Kozin
2023-03-27  8:52 ` Attila Lendvai

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