From: phodina via <help-guix@gnu.org>
To: help-guix <help-guix@gnu.org>
Subject: Defining thunderbolt service
Date: Tue, 03 Aug 2021 20:45:52 +0000 [thread overview]
Message-ID: <DYoIIQa5LbkeScBE-OZoGlwCNhUDC2yL3wwk2fEAYeNvk0hsHzuJq-pwCO5cdnzY7xeoHgP5TDsjv4BkrSPxZUTNDNvGZrUZ_JH8ghTxAbM=@protonmail.com> (raw)
Hello,
last month I submitted a patch to add support for thunderbolt devices [1]. The package, however, contains also a daemon that has to run.
So the after creating the package I focused on the services. I read the section of GuixSD documentation [2] as well as the contents of the =gnu/services= directory.
Below you can review the code for the thunderbolt service. The derivation is successful, but the service does not start. I'm kind of stuck on this and don't know how to finish the service at the moment.
In the documentation nor the manual for Shepherd [3] have I found a way to debug it.
I thought to run the Guile REPL and run =(use-modules (thunderbolt))= but then I didn't know what to to next.
For the packages I can run =guix build -L <MY_CHANNEL> <PKG> -K -v3= and I'll get the debug output and also the build directory stays in case of failure.
I'm missing something similar for the services - the derivation as well as runtime. I'm familiar with the systemd, where by running =journalctl -u <SERVICE>= I get the logs.
Is something similar available? Also do I have to build the service by running =guix system reconfigure os.scm=?
I'm able to get basic info from =herd status <SERVICE>=. Though, it's hard to know the reason the service failed to run without logs.
Also I'm not that familiar with DBUS and Polkit. Any suggestions for integrating the configuration files from the package into service definition would be appreciated!
Kind regards
Petr
[1]: https://lists.gnu.org/archive/html/guix-patches/2021-07/msg01299.html
[2]: https://guix.gnu.org/manual/en/html_node/Services.html
[3]: https://www.gnu.org/software/shepherd/manual/shepherd.html
------------------------------------------------------------------------------------------
(
define-module
(
bolt
)
#
:use-module
(
gnu
services
)
#
:use-module
(
gnu
services
base
)
#
:use-module
(
gnu
services
shepherd
)
#
:use-module
(
expanse
packages
thunderbolt
)
#
:use-module
(
guix
gexp
)
#
:use-module
(
guix
modules
)
#
:use-module
(
guix
records
)
#
:use-module
(
ice-9
match
)
#
:export
(
bolt-configuration
bolt-configuration?
bolt-service-type
))
(
define-record-type*
<bolt-configuration>
bolt-configuration
make-bolt-configuration
bolt-configuration?
(
package
bolt-configuration-package
(
default
bolt
)))
(
define
bolt-shepherd-service
(
match-lambda
((
$
<bolt-configuration>
package
)
(
with-imported-modules
(
source-module-closure
'
((
gnu
build
shepherd
)))
(
shepherd-service
(
documentation
"Thunderbolt daemon"
)
(
provision
'
(
thunderbolt
))
(
requirement
'
(
networking
))
(
modules
'
((
gnu
build
shepherd
)))
(
start
#
~
(
make-forkexec-constructor/container
(
list
#
$
(
file-append
package
"/libexec/boltd"
))
))
(
stop
#
~
(
make-kill-destructor
)))))))
(
define
bolt-udev-rule
(
match-lambda
((
$
<bolt-configuration>
package
)
(
file->udev-rule
"90-bolt.rules"
(
file-append
package
"/lib/udev/rules.d/90-bolt.rules"
)))))
(
define
bolt-service-type
(
service-type
(
name
'boltd
)
(
description
"Thunderbolt daemon"
)
(
extensions
(
list
(
service-extension
udev-service-type
(
compose
list
bolt-udev-rule
))
(
service-extension
shepherd-root-service-type
(
compose
list
bolt-shepherd-service
))))
(
default-value
(
bolt-configuration
))))
reply other threads:[~2021-08-03 20:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='DYoIIQa5LbkeScBE-OZoGlwCNhUDC2yL3wwk2fEAYeNvk0hsHzuJq-pwCO5cdnzY7xeoHgP5TDsjv4BkrSPxZUTNDNvGZrUZ_JH8ghTxAbM=@protonmail.com' \
--to=help-guix@gnu.org \
--cc=phodina@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).