aboutsummaryrefslogtreecommitdiffstats
path: root/reread-services
blob: 635c9ff6d732dd9049780e59ec42325e3c2a0ad5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
#---------------------------------------------------------------
# Project         : Mageia Linux
# Module          : rpm-helper
# File            : reread-services
# Version         : $Id$
# Authors         : Colin Guthrie
# Created On      : Thu Nov  3 10:00:00 2011
# Purpose         : helper script for rpm scriptlets to ensure
#                   a service is reread by the init system
#---------------------------------------------------------------

if [ $# -lt 1 ]; then
    echo "usage: $0 <pkg name>" 1>&2
    exit 1
fi

# What init system are we currently using?
if [ -d /run/systemd/system/ ]; then
    init=systemd
else
    init=sysvinit
fi

pkg=$1				# name of the package

if [ x$init = xsystemd ]; then
    /bin/systemctl daemon-reload || :
fi

# reread-services ends here