linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: linux-nfs@vger.kernel.org
Cc: libtirpc-devel@lists.sourceforge.net,
	Steve Dickson <SteveD@redhat.com>,
	Josue Ortega <josue@debian.org>, NeilBrown <neilb@suse.de>,
	Thomas Blume <Thomas.Blume@suse.com>,
	Yann Leprince <yann.leprince@ylep.fr>,
	Steve Langasek <steve.langasek@canonical.com>
Subject: Re: [RFC][PATCH rpcbind 4/4] systemd/rpcbind.service.in: Want/After systemd-tmpfiles-setup
Date: Fri, 23 Aug 2024 03:01:43 +0200	[thread overview]
Message-ID: <20240823010143.GA1206597@pevik> (raw)
In-Reply-To: <20240823002322.1203466-5-pvorel@suse.cz>

Hi Steve,

> Add Want/After systemd-tmpfiles-setup.service. This is taken from Fedora
> rpcbind-0.2.4-5.fc25 patch [1] which tried to handle bug #1401561 [2]
> where /var/run/rpcbind.lock cannot be created due missing /var/run/
> directory. But the suggestion to add RequiresMountFor=... was
> implemented in ee569be ("Fix boot dependency in systemd service file").

> But even with RequiresMountsFor=/run/rpcbind in rpcbind.service and
> /run/rpcbind.lock there is error on openSUSE Tumbleweed with rpcbind
> 1.2.6:

> rpcbind.service: Failed at step NAMESPACE spawning /usr/sbin/rpcbind: Read-only file system

> Adding systemd-tmpfiles-setup.service fixes it.

> NOTE: Debian uses for this purpose remote-fs-pre.target (also works, but
> systemd-tmpfiles-setup.service looks to me more specific).
> openSUSE uses only After=sysinit.target as a result of #1117217 [3]
> (also works).

Reading RH #1117217 once more I wonder if old Fedora patch [4], which places
rpcbind.lock into /var/run/rpcbind/ would be a better solution:

configure.ac
-  --with-statedir=ARG     use ARG as state dir [default=/var/run/rpcbind]
+  --with-statedir=ARG     use ARG as state dir [default=/run/rpcbind]
...
-  with_statedir=/var/run/rpcbind
+  with_statedir=/run/rpcbind

src/rpcbind.c
-#define RPCBINDDLOCK "/var/run/rpcbind.lock"
+#define RPCBINDDLOCK RPCBIND_STATEDIR "/rpcbind.lock"

But I suppose other out-of-tree patch [5] is not a dependency for it, right?

Debian [6] and openSUSE [7] use more simpler version to move to /run. Maybe time
to upstream Fedora patch and distros will adopt it?

Kind regards,
Petr

> [1] https://src.fedoraproject.org/rpms/rpcbind/blob/rawhide/f/rpcbind-0.2.4-systemd-service.patch
> [2] https://bugzilla.redhat.com/show_bug.cgi?id=1401561
> [3] https://bugzilla.suse.com/show_bug.cgi?id=1117217

[4] https://src.fedoraproject.org/rpms/rpcbind/blob/f41/f/rpcbind-0.2.4-runstatdir.patch
[5] https://src.fedoraproject.org/rpms/rpcbind/blob/rawhide/f/rpcbind-0.2.4-systemd-rundir.patch
[6] https://salsa.debian.org/debian/rpcbind/-/blob/master/debian/patches/run-migration?ref_type=heads
[7] https://build.opensuse.org/projects/openSUSE:Factory/packages/rpcbind/files/0001-change-lockingdir-to-run.patch?expand=1

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  systemd/rpcbind.service.in | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

> diff --git a/systemd/rpcbind.service.in b/systemd/rpcbind.service.in
> index 272e55a..771b944 100644
> --- a/systemd/rpcbind.service.in
> +++ b/systemd/rpcbind.service.in
> @@ -7,7 +7,8 @@ RequiresMountsFor=@statedir@
>  # Make sure we use the IP addresses listed for
>  # rpcbind.socket, no matter how this unit is started.
>  Requires=rpcbind.socket
> -Wants=rpcbind.target
> +Wants=rpcbind.target systemd-tmpfiles-setup.service
> +After=systemd-tmpfiles-setup.service

>  [Service]
>  ProtectSystem=full

  reply	other threads:[~2024-08-23  1:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-23  0:23 [PATCH rpcbind 0/4] Update systemd/rpcbind.service.in Petr Vorel
2024-08-23  0:23 ` [PATCH rpcbind 1/4] systemd/rpcbind.service.in: Add few default EnvironmentFile Petr Vorel
2024-08-23  0:23 ` [PATCH rpcbind 2/4] man/rpcbind: Add Files section to manpage Petr Vorel
2024-08-23  0:23 ` [RFC][PATCH rpcbind 3/4] systemd/rpcbind.service.in: Add various hardenings options Petr Vorel
2024-08-23  0:23 ` [RFC][PATCH rpcbind 4/4] systemd/rpcbind.service.in: Want/After systemd-tmpfiles-setup Petr Vorel
2024-08-23  1:01   ` Petr Vorel [this message]
2024-08-30 15:40     ` Steve Dickson
2024-08-30 16:51       ` Petr Vorel
2024-08-31 17:56 ` [PATCH rpcbind 0/4] Update systemd/rpcbind.service.in Steve Dickson

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240823010143.GA1206597@pevik \
    --to=pvorel@suse.cz \
    --cc=SteveD@redhat.com \
    --cc=Thomas.Blume@suse.com \
    --cc=josue@debian.org \
    --cc=libtirpc-devel@lists.sourceforge.net \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=steve.langasek@canonical.com \
    --cc=yann.leprince@ylep.fr \
    /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 NNTP newsgroup(s).