This file is indexed.

/usr/lib/icinga2/safe-reload is in icinga2-common 2.8.1-0ubuntu2.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
# load system specific defines
SYSCONFIGFILE=$1
if [ ! -f "$SYSCONFIGFILE" ]; then
	echo "Error: You need to supply the path to the Icinga2 sysconfig file as a parameter."
	exit 1
fi

. $SYSCONFIGFILE

printf "Validating config files: "

OUTPUTFILE=`mktemp`

if type selinuxenabled >/dev/null 2>&1; then
	if selinuxenabled; then
		chcon -t icinga2_tmp_t $OUTPUTFILE >/dev/null 2>&1
	fi
fi

if ! $DAEMON daemon --validate --color > $OUTPUTFILE; then
	echo "Failed"

	cat $OUTPUTFILE
	rm -f $OUTPUTFILE
	exit 1
fi

echo "Done"
rm -f $OUTPUTFILE

printf "Reloading Icinga 2: "

if [ ! -e $ICINGA2_PID_FILE ]; then
	exit 7
fi

pid=`cat $ICINGA2_PID_FILE`
if ! kill -HUP $pid >/dev/null 2>&1; then
	echo "Error: Icinga not running"
	exit 7
fi

echo "Done"
exit 0