ryantimwilson / rpms / systemd

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