Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 558006
Collapse All | Expand All

(-)a/00-restart_services-default.conf (+43 lines)
Line 0 Link Here
1
#
2
# restart_services configuration file
3
#
4
5
# Here you can classify your services
6
# (use extended regex without '^' and '$')
7
# 
8
# You can copy this file to a new destination within /etc/restart_services/
9
# just make sure to keep the start of each used line the same to include
10
# all previous definitions as well e.g.: SV_ALWAYS="((${SV_ALWAYS})|...
11
12
# Define services that can always be restarted
13
# Will run: rc-service $SV -- --ifstarted restart
14
#SV_ALWAYS="((${SV_ALWAYS})|acpid|apcupsd|atd|autofs|(bareos|bacula)-fd|cf-.*|cronie|haveged|irqbalance|lldpd|monit|named|ntpd|nullmailer|opendnssec|salt-minion|smartd|snmpd|sshd|zabbix-agentd|vmware-tools|sqlgrey)"
15
16
# Define services that can always be restarted, but excluding dependencies
17
# Will run: rc-service $SV -- --ifstarted --nodeps restart
18
#SV_ALWAYS_WITH_NODEPS="((${SV_ALWAYS_WITH_NODEPS})|udev|ulogd|rpc.*|rsyslog)"
19
20
# Define services that must not be restarted without
21
# the '--critical' option.
22
# Here you should put services where a restart would
23
# interrupt a service being offered to your users
24
# Will run: rc-service $SV -- --ifstarted restart
25
#SV_CRITICAL="((${SV_CRITICAL})|apache2|clamd|(bareos|bacula)-(sd|dir)|exim|.*ftpd|lighttpd|minidlna|mysql|nginx|openvpn|pacemaker|postfix|postgresql-.*|quasselcore|salt-master|samba|unbound)"
26
27
# Define services that must not be restarted without
28
# the '--critical' option and that require "--nodeps"
29
# Here you should put services where a restart would
30
# interrupt a service being offered to your users
31
# Will run: rc-service $SV -- --ifstarted --nodeps restart
32
#SV_CRITICAL_WITH_NODEPS="((${SV_CRITICAL_WITH_NODEPS})|())"
33
34
# Define services than only need to be reloaded
35
# instead of restarted
36
# Will run: rc-service $SV -- --ifstarted reload
37
#SV_ALWAYS_RELOAD_ONLY="((${SV_ALWAYS_RELOAD_ONLY})|libvirtd)"
38
39
# Define services that should be ignored
40
#SV_IGNORE="((${SV_IGNORE})|ntp-client)"
41
42
# Define processes started via inittab that should be killed
43
#INITTAB_KILLALL="((${INITTAB_KILLALL})|/sbin/agetty)"
(-)a/restart_services (-8 / +10 lines)
Lines 19-25 Link Here
19
19
20
trap skip_service INT
20
trap skip_service INT
21
trap clean_exit EXIT
21
trap clean_exit EXIT
22
CNF="/etc/restart_services.conf"
22
CNFD="/etc/restart_services"
23
23
24
function skip_service() {
24
function skip_service() {
25
	if [[ $FORCE_SV ]]; then
25
	if [[ $FORCE_SV ]]; then
Lines 172-178 Link Here
172
172
173
			    -c, --critical	also restart 'critical' services
173
			    -c, --critical	also restart 'critical' services
174
			    			defined in SV_CRITICAL or SV_CRITICAL_WITH_NODEPS
174
			    			defined in SV_CRITICAL or SV_CRITICAL_WITH_NODEPS
175
			    			in $CNF
175
			    			in $CNFD/*.conf
176
			    -i, --interactive	ask before restarting any service
176
			    -i, --interactive	ask before restarting any service
177
			    -u, --force-unknown	enable restarting of unknown/unclassified services
177
			    -u, --force-unknown	enable restarting of unknown/unclassified services
178
			    -d, --debug		enable debug messages
178
			    -d, --debug		enable debug messages
Lines 225-237 Link Here
225
fi
225
fi
226
226
227
# load config
227
# load config
228
if [[ -f $CNF ]]; then
228
if [[ -d $CNFD ]]; then
229
	if ! . $CNF; then
229
	for CNF in "$CNFD/"*".conf"; do
230
		echo "$(red ERROR): config file could not be parsed ($CNF)" >&2
230
		if ! . $CNF; then
231
		exit 1
231
			echo "$(red ERROR): config file could not be parsed ($CNF)" >&2
232
	fi
232
			exit 1
233
		fi
234
	done
233
else
235
else
234
	echo "$(red ERROR): config file not found ($CNF)" >&2
236
	echo "$(red ERROR): config directory not found ($CNFD)" >&2
235
	exit 1
237
	exit 1
236
fi
238
fi
237
239
(-)a/restart_services.conf (-39 lines)
Lines 1-39 Link Here
1
#
2
# restart_services configuration file
3
#
4
5
# Here you can classify your services
6
# (use extended regex without '^' and '$')
7
8
# Define services that can always be restarted
9
# Will run: rc-service $SV -- --ifstarted restart
10
#SV_ALWAYS='(acpid|apcupsd|atd|autofs|(bareos|bacula)-fd|cf-.*|cronie|haveged|irqbalance|lldpd|monit|named|ntpd|nullmailer|opendnssec|salt-minion|smartd|snmpd|sshd|zabbix-agentd)'
11
12
# Define services that can always be restarted, but excluding dependencies
13
# Will run: rc-service $SV -- --ifstarted --nodeps restart
14
#SV_ALWAYS_WITH_NODEPS='(udev|ulogd|rpc.*|rsyslog)'
15
16
# Define services that must not be restarted without
17
# the '--critical' option.
18
# Here you should put services where a restart would
19
# interrupt a service being offered to your users
20
# Will run: rc-service $SV -- --ifstarted restart
21
#SV_CRITICAL='(apache2|clamd|(bareos|bacula)-(sd|dir)|exim|.*ftpd|lighttpd|minidlna|mysql|nginx|openvpn|pacemaker|postfix|postgresql-.*|quasselcore|salt-master|samba|unbound)'
22
23
# Define services that must not be restarted without
24
# the '--critical' option and that require "--nodeps"
25
# Here you should put services where a restart would
26
# interrupt a service being offered to your users
27
# Will run: rc-service $SV -- --ifstarted --nodeps restart
28
#SV_CRITICAL_WITH_NODEPS='()'
29
30
# Define services than only need to be reloaded
31
# instead of restarted
32
# Will run: rc-service $SV -- --ifstarted reload
33
#SV_ALWAYS_RELOAD_ONLY='(libvirtd)'
34
35
# Define services that should be ignored
36
#SV_IGNORE='(ntp-client)'
37
38
# Define processes started via inittab that should be killed
39
#INITTAB_KILLALL='(/sbin/agetty)'

Return to bug 558006