From: Remco van 't Veer <remco@remworks.net>
To: help-guix@gnu.org
Subject: luks home causes syncthing service to start too early?
Date: Mon, 17 Jul 2023 10:54:16 +0200 [thread overview]
Message-ID: <87351mc407.fsf@remworks.net> (raw)
Hi,
In my current setup syncthing fails to start on boot. Here's /var/log/messages:
Jul 17 09:51:52 localhost vmunix: [ 1.605917] shepherd[1]: Starting service syncthing-me...
Jul 17 09:51:52 localhost vmunix: [ 1.606790] shepherd[1]: Service syncthing-me has been started.
Jul 17 09:51:52 localhost vmunix: [ 1.611919] shepherd[1]: Service syncthing-me started.
Jul 17 09:51:52 localhost vmunix: [ 1.613080] shepherd[1]: Service syncthing-me running with value 356.
Jul 17 09:51:52 localhost vmunix: [ 1.654826] shepherd[1]:
Jul 17 09:51:52 localhost vmunix: [ 1.654903] [
Jul 17 09:51:52 localhost vmunix: [ 1.654963] syncthing
Jul 17 09:51:52 localhost vmunix: [ 1.655011] ]
Jul 17 09:51:52 localhost vmunix: [ 1.655069] WARNING: Failure on home directory: mkdir /home/me: permission denied
Jul 17 09:51:52 localhost vmunix: [ 1.655741] shepherd[1]: Service syncthing-me (PID 356) exited with 1.
Jul 17 09:51:52 localhost vmunix: [ 1.655973] shepherd[1]: Service syncthing-me has been disabled.
It's pretty obvious why this fails because the mounting of the home
happens later:
Jul 17 09:51:52 localhost vmunix: [ 4.207897] shepherd[1]: Starting service device-mapping-home...
Jul 17 09:51:52 localhost vmunix: [ 12.502555] shepherd[1]: Service device-mapping-home has been started.
Jul 17 09:51:52 localhost vmunix: [ 12.503557] shepherd[1]: Service device-mapping-home started.
Jul 17 09:51:52 localhost vmunix: [ 12.514975] shepherd[1]: Service device-mapping-home running with value #t.
Jul 17 09:51:52 localhost vmunix: [ 12.538402] shepherd[1]: Starting service file-system-/home...
Jul 17 09:51:52 localhost vmunix: [ 12.573507] shepherd[1]: Service file-system-/home has been started.
Jul 17 09:51:52 localhost vmunix: [ 12.573775] shepherd[1]: Service file-system-/home started.
Jul 17 09:51:52 localhost vmunix: [ 12.573935] shepherd[1]: Service file-system-/home running with value #t.
Jul 17 09:51:52 localhost vmunix: [ 12.696235] shepherd[1]: Starting service user-homes...
Jul 17 09:51:52 localhost vmunix: [ 12.698117] shepherd[1]: Service user-homes has been started.
Jul 17 09:51:52 localhost vmunix: [ 12.698406] shepherd[1]: Service user-homes started.
Jul 17 09:51:52 localhost vmunix: [ 12.698756] shepherd[1]: Service user-homes running with value #t.
I have my home directory on a separate encrypted partition as follows:
(mapped-devices
(list (mapped-device
(source (uuid ...))
(target "home")
(type luks-device-mapping))))
(file-systems (cons* (file-system
(mount-point "/boot/eff") ..)
(file-system
(mount-point "/")
(device (uuid ...))
(type "ext4"))
(file-system
(mount-point "/home")
(device "/dev/mapper/home")
(type "ext4")
(dependencies mapped-devices))
%base-file-systems))
And syncthing wedged into a big list of services:
(define my-base-desktop-services
(cons* ...
(service syncthing-service-type
(syncthing-configuration (user "me"))
...
(modify-services
(remove (lambda (service)
(eq? (service-kind service) gdm-service-type))
%desktop-services)
...
Looking at the syncthing-shepherd-service definition[1]:
(define syncthing-shepherd-service
(match-lambda
(($ <syncthing-configuration> syncthing arguments logflags user group home)
(list
(shepherd-service
(provision (list (string->symbol (string-append "syncthing-" user))))
(documentation "Run syncthing.")
(requirement '(loopback))
(start #~(make-forkexec-constructor ...
this shepherd-service only requires "loopback". How do make it require
"user-homes" too without copy-pasting it and defining my own syncthing
service?
Also why doesn't it at least require "file-systems" already (which is
available just before "user-homes")? It seems obvious to me that
syncthing should not start before all file systems are up and running.
The workaround is to add (needed-for-boot? #t) to the (file-system ..)
definition for my homes partition but then I have to type LUKS password
twice which was a nice so about this setup..
Cheers,
Remco
[1] https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/syncthing.scm#n60
reply other threads:[~2023-07-17 8:55 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=87351mc407.fsf@remworks.net \
--to=remco@remworks.net \
--cc=help-guix@gnu.org \
/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).