dcavalca / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
d0811f
#  -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
167d2b
#  SPDX-License-Identifier: LGPL-2.1-or-later
d0811f
#
d0811f
#  This file is part of systemd.
d0811f
#
d0811f
#  Copyright 2018 Neal Gompa
d0811f
d0811f
# The contents of this are an example to be copied into systemd.spec.
d0811f
#
167d2b
# Minimum rpm version supported: 4.14.0
d0811f
d0811f
%transfiletriggerin -P 900900 -- /usr/lib/systemd/system /etc/systemd/system
d0811f
# This script will run after any package is initially installed or
d0811f
# upgraded. We care about the case where a package is initially
d0811f
# installed, because other cases are covered by the *un scriptlets,
d0811f
# so sometimes we will reload needlessly.
167d2b
if test -d "/run/systemd/system"; then
167d2b
  %{_bindir}/systemctl daemon-reload || :
167d2b
  %{_bindir}/systemctl reload-or-restart --marked || :
d0811f
fi
d0811f
167d2b
%transfiletriggerpostun -P 1000100 -- /usr/lib/systemd/system /etc/systemd/system
d0811f
# On removal, we need to run daemon-reload after any units have been
167d2b
# removed.
d0811f
# On upgrade, we need to run daemon-reload after any new unit files
d0811f
# have been installed, but before %postun scripts in packages get
167d2b
# executed.
d0811f
if test -d "/run/systemd/system"; then
167d2b
  %{_bindir}/systemctl daemon-reload || :
d0811f
fi
d0811f
167d2b
%transfiletriggerpostun -P 10000 -- /usr/lib/systemd/system /etc/systemd/system
167d2b
# We restart remaining services that should be restarted here.
167d2b
if test -d "/run/systemd/system"; then
167d2b
  %{_bindir}/systemctl reload-or-restart --marked || :
d0811f
fi
d0811f
167d2b
%transfiletriggerin -P 1000700 -- /usr/lib/sysusers.d
d0811f
# This script will process files installed in /usr/lib/sysusers.d to create
d0811f
# specified users automatically. The priority is set such that it
d0811f
# will run before the tmpfiles file trigger.
167d2b
if test -d "/run/systemd/system"; then
d0811f
  %{_bindir}/systemd-sysusers || :
d0811f
fi
d0811f
167d2b
%transfiletriggerin -P 1000700 udev -- /usr/lib/udev/hwdb.d
d0811f
# This script will automatically invoke hwdb update if files have been
d0811f
# installed or updated in /usr/lib/udev/hwdb.d.
167d2b
if test -d "/run/systemd/system"; then
d0811f
  %{_bindir}/systemd-hwdb update || :
d0811f
fi
d0811f
167d2b
%transfiletriggerin -P 1000700 -- /usr/lib/systemd/catalog
d0811f
# This script will automatically invoke journal catalog update if files
d0811f
# have been installed or updated in /usr/lib/systemd/catalog.
167d2b
if test -d "/run/systemd/system"; then
d0811f
  %{_bindir}/journalctl --update-catalog || :
d0811f
fi
d0811f
167d2b
%transfiletriggerin -P 1000700 -- /usr/lib/binfmt.d
167d2b
# This script will automatically apply binfmt rules if files have been
167d2b
# installed or updated in /usr/lib/binfmt.d.
167d2b
if test -d "/run/systemd/system"; then
167d2b
  # systemd-binfmt might fail if binfmt_misc kernel module is not loaded
167d2b
  # during install
167d2b
  /usr/lib/systemd/systemd-binfmt || :
167d2b
fi
167d2b
167d2b
%transfiletriggerin -P 1000600 -- /usr/lib/tmpfiles.d
167d2b
# This script will process files installed in /usr/lib/tmpfiles.d to create
167d2b
# tmpfiles automatically. The priority is set such that it will run
167d2b
# after the sysusers file trigger, but before any other triggers.
167d2b
if test -d "/run/systemd/system"; then
167d2b
  %{_bindir}/systemd-tmpfiles --create || :
167d2b
fi
167d2b
167d2b
%transfiletriggerin -P 1000600 udev -- /usr/lib/udev/rules.d
d0811f
# This script will automatically update udev with new rules if files
d0811f
# have been installed or updated in /usr/lib/udev/rules.d.
d0811f
if test -e /run/udev/control; then
d0811f
  %{_bindir}/udevadm control --reload || :
d0811f
fi
d0811f
167d2b
%transfiletriggerin -P 1000500 -- /usr/lib/sysctl.d
d0811f
# This script will automatically apply sysctl rules if files have been
d0811f
# installed or updated in /usr/lib/sysctl.d.
167d2b
if test -d "/run/systemd/system"; then
d0811f
  /usr/lib/systemd/systemd-sysctl || :
d0811f
fi