From: Nick Alcock <nick.alcock@oracle.com>
To: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: [PATCH] dtprobed: don't chown systemd service files to root during install
Date: Mon, 11 Nov 2024 10:46:46 +0000 [thread overview]
Message-ID: <20241111104646.435193-1-nick.alcock@oracle.com> (raw)
I put this in while thinking vaguely that "systemd requires these
to be root-owned, we're not using install(1) so we should fix that".
If redirecting, the ownership will be the ownership of the running
process unless the file already exists (and the thing to do there is
to rm -f it first, not to chown it afterwards): and if we're not
root, chowning isn't going to work anyway (and will abort the
install).
So take the chown out and replace it with an rm -f in the right place.
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
---
dtprobed/Build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dtprobed/Build b/dtprobed/Build
index c43b62778381..a242afab94fc 100644
--- a/dtprobed/Build
+++ b/dtprobed/Build
@@ -41,8 +41,8 @@ install-dtprobed-autostart::
ifneq ($(WITH_SYSTEMD),)
mkdir -p $(INSTSYSTEMDUNITDIR) $(INSTSYSTEMDPRESETDIR)
$(call describe-install-target,$(INSTSYSTEMDUNITDIR),dtprobed.service)
+ rm -f $(INSTSYSTEMDUNITDIR)/dtprobed.service
sed 's,@SBINDIR@,$(SBINDIR),' < $(dtprobed_DIR)dtprobed.service.in > $(INSTSYSTEMDUNITDIR)/dtprobed.service
- chown root:root $(INSTSYSTEMDUNITDIR)/dtprobed.service
chmod 0644 $(INSTSYSTEMDUNITDIR)/dtprobed.service
$(call describe-install-target,$(INSTSYSTEMDUNITDIR),dtrace-usdt.target)
install -m 644 $(dtprobed_DIR)dtrace-usdt.target $(INSTSYSTEMDUNITDIR)
base-commit: ba6e6542c44f22b3707949e859b13209bebefae2
--
2.46.0.278.g36e3a12567
next reply other threads:[~2024-11-11 10:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-11 10:46 Nick Alcock [this message]
2024-11-11 15:59 ` [PATCH] dtprobed: don't chown systemd service files to root during install Nick Alcock
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=20241111104646.435193-1-nick.alcock@oracle.com \
--to=nick.alcock@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
/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