![](https://seccdn.libravatar.org/avatar/9435667f7160374bc34a8600b686aecd.jpg?s=120&d=mm&r=g)
On Thu, Nov 21, 2024 at 12:54 PM Dan Čermák <dcermak@suse.com> wrote:
Hi Alexey,
Alexey Svistunov <svalx@svalx.net> writes:
20.11.2024 17:34, Axel Braun пишет:
Hello Alexey,
Am Mittwoch, 20. November 2024, 10:13:28 Mitteleuropäische Normalzeit schrieb Alexey Svistunov:
Did you add the command already to the %post section?
HTH Axel
OBS and chroot build environments does not provide systemd, the build ends with an error: /var/tmp/rpm-tmp.m5llyB: line 7: sysetmctl: command not found warning: %post(timekpr-next-0.5.7-0.noarch) scriptlet failed, exit status 127
The usual approach would be:
--8<---------------cut here---------------start------------->8--- if [ -x /usr/bin/systemctl ]; then /usr/bin/systemctl restart foo || : fi --8<---------------cut here---------------end--------------->8---
or use one of the `%service_*` macros if appropriate[1]
%service_add_post if [ -x /usr/lib/systemd/systemd-update-helper ]; then \ /usr/lib/systemd/systemd-update-helper install-system-units %{?*} || : \ fi \ and systemd-update-helper just unconditionally calls systemctl. I still try to understand at which point the %post is invoked during *build*.