* [PATCH] dtprobed: don't chown systemd service files to root during install
@ 2024-11-11 10:46 Nick Alcock
2024-11-11 15:59 ` Nick Alcock
0 siblings, 1 reply; 2+ messages in thread
From: Nick Alcock @ 2024-11-11 10:46 UTC (permalink / raw)
To: dtrace, dtrace-devel
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dtprobed: don't chown systemd service files to root during install
2024-11-11 10:46 [PATCH] dtprobed: don't chown systemd service files to root during install Nick Alcock
@ 2024-11-11 15:59 ` Nick Alcock
0 siblings, 0 replies; 2+ messages in thread
From: Nick Alcock @ 2024-11-11 15:59 UTC (permalink / raw)
To: Nick Alcock; +Cc: dtrace, dtrace-devel
On 11 Nov 2024, Nick Alcock said:
> 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.
Patch withdrawn: Kris's patch is better.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-11 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-11 10:46 [PATCH] dtprobed: don't chown systemd service files to root during install Nick Alcock
2024-11-11 15:59 ` Nick Alcock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox