[DTrace-devel] [PATCH] dtprobed: make sure the daemon is started in the first place

Eugene Loh eugene.loh at oracle.com
Sat Mar 9 01:08:29 UTC 2024


(Usual apology for funny formatting.  I do not seem to have gotten this 
patch in my inbox.)

I don't really understand this stuff, but
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>

I assume this is what was in that rpm you gave me to test.  It seemed to 
do the job just fine.  Thanks.

Incidentally, why does the comment in the code specify OL9?  I seemed to 
have the problem "everywhere."

8< 8< 8< 8<

The work done earlier only suffices to restart the daemon automatically on
upgrade.  There appears to be no attempt to start newly-installed daemons at
a distro level, only to enable them (via presets).  Most daemons already in
the distro don't bother, apparently relying on the post-installation reboot
to start them.

We'd rather do the job right, so explicitly do a start in %posttrans (which
it looks like will usually be late enough that the thing will already have
been enabled even if presets don't do the job -- we have no way of running
later other than hooking into at jobs or something, at any rate.)

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
---
  dtrace.spec | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/dtrace.spec b/dtrace.spec
index e7aad9b3b5c8c..73e6b004c9100 100644
--- a/dtrace.spec
+++ b/dtrace.spec
@@ -239,6 +239,12 @@ fi
  %udev_rules_update
  %systemd_postun_with_restart dtprobed.service

+%posttrans
+# Make sure the daemon really is started (OL9 doesn't start the
+# daemon properly on fresh installations -- all presets do is enable
+# it, not start it, and postun_with_restart only restarts on *upgrade*.)
+systemctl start dtprobed || :
+
  %files
  %defattr(-,root,root,-)
  %{_libdir}/dtrace

base-commit: f7f7b65172c07df8c90b68b5dea5b8aa10ff937c




More information about the DTrace-devel mailing list