richardphibel / rpms / systemd

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