Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 409232 Details for
Bug 558006
app-admin/restart_services should allow multiple configuration files in a directory
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Feature implementation example
config_directory.patch (text/plain), 5.24 KB, created by
Rudolf Mayerhofer
on 2015-08-17 10:51:46 UTC
(
hide
)
Description:
Feature implementation example
Filename:
MIME Type:
Creator:
Rudolf Mayerhofer
Created:
2015-08-17 10:51:46 UTC
Size:
5.24 KB
patch
obsolete
>diff -ruN a/00-restart_services-default.conf b/00-restart_services-default.conf >--- a/00-restart_services-default.conf 1970-01-01 01:00:00.000000000 +0100 >+++ b/00-restart_services-default.conf 2015-08-17 12:18:42.712321510 +0200 >@@ -0,0 +1,43 @@ >+# >+# restart_services configuration file >+# >+ >+# Here you can classify your services >+# (use extended regex without '^' and '$') >+# >+# You can copy this file to a new destination within /etc/restart_services/ >+# just make sure to keep the start of each used line the same to include >+# all previous definitions as well e.g.: SV_ALWAYS="((${SV_ALWAYS})|... >+ >+# Define services that can always be restarted >+# Will run: rc-service $SV -- --ifstarted restart >+#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)" >+ >+# Define services that can always be restarted, but excluding dependencies >+# Will run: rc-service $SV -- --ifstarted --nodeps restart >+#SV_ALWAYS_WITH_NODEPS="((${SV_ALWAYS_WITH_NODEPS})|udev|ulogd|rpc.*|rsyslog)" >+ >+# Define services that must not be restarted without >+# the '--critical' option. >+# Here you should put services where a restart would >+# interrupt a service being offered to your users >+# Will run: rc-service $SV -- --ifstarted restart >+#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)" >+ >+# Define services that must not be restarted without >+# the '--critical' option and that require "--nodeps" >+# Here you should put services where a restart would >+# interrupt a service being offered to your users >+# Will run: rc-service $SV -- --ifstarted --nodeps restart >+#SV_CRITICAL_WITH_NODEPS="((${SV_CRITICAL_WITH_NODEPS})|())" >+ >+# Define services than only need to be reloaded >+# instead of restarted >+# Will run: rc-service $SV -- --ifstarted reload >+#SV_ALWAYS_RELOAD_ONLY="((${SV_ALWAYS_RELOAD_ONLY})|libvirtd)" >+ >+# Define services that should be ignored >+#SV_IGNORE="((${SV_IGNORE})|ntp-client)" >+ >+# Define processes started via inittab that should be killed >+#INITTAB_KILLALL="((${INITTAB_KILLALL})|/sbin/agetty)" >diff -ruN a/restart_services b/restart_services >--- a/restart_services 2015-08-15 02:15:38.000000000 +0200 >+++ b/restart_services 2015-08-17 12:29:42.842575163 +0200 >@@ -19,7 +19,7 @@ > > trap skip_service INT > trap clean_exit EXIT >-CNF="/etc/restart_services.conf" >+CNFD="/etc/restart_services" > > function skip_service() { > if [[ $FORCE_SV ]]; then >@@ -172,7 +172,7 @@ > > -c, --critical also restart 'critical' services > defined in SV_CRITICAL or SV_CRITICAL_WITH_NODEPS >- in $CNF >+ in $CNFD/*.conf > -i, --interactive ask before restarting any service > -u, --force-unknown enable restarting of unknown/unclassified services > -d, --debug enable debug messages >@@ -225,13 +225,15 @@ > fi > > # load config >-if [[ -f $CNF ]]; then >- if ! . $CNF; then >- echo "$(red ERROR): config file could not be parsed ($CNF)" >&2 >- exit 1 >- fi >+if [[ -d $CNFD ]]; then >+ for CNF in "$CNFD/"*".conf"; do >+ if ! . $CNF; then >+ echo "$(red ERROR): config file could not be parsed ($CNF)" >&2 >+ exit 1 >+ fi >+ done > else >- echo "$(red ERROR): config file not found ($CNF)" >&2 >+ echo "$(red ERROR): config directory not found ($CNFD)" >&2 > exit 1 > fi > >diff -ruN a/restart_services.conf b/restart_services.conf >--- a/restart_services.conf 2015-08-15 02:15:38.000000000 +0200 >+++ b/restart_services.conf 1970-01-01 01:00:00.000000000 +0100 >@@ -1,39 +0,0 @@ >-# >-# restart_services configuration file >-# >- >-# Here you can classify your services >-# (use extended regex without '^' and '$') >- >-# Define services that can always be restarted >-# Will run: rc-service $SV -- --ifstarted restart >-#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)' >- >-# Define services that can always be restarted, but excluding dependencies >-# Will run: rc-service $SV -- --ifstarted --nodeps restart >-#SV_ALWAYS_WITH_NODEPS='(udev|ulogd|rpc.*|rsyslog)' >- >-# Define services that must not be restarted without >-# the '--critical' option. >-# Here you should put services where a restart would >-# interrupt a service being offered to your users >-# Will run: rc-service $SV -- --ifstarted restart >-#SV_CRITICAL='(apache2|clamd|(bareos|bacula)-(sd|dir)|exim|.*ftpd|lighttpd|minidlna|mysql|nginx|openvpn|pacemaker|postfix|postgresql-.*|quasselcore|salt-master|samba|unbound)' >- >-# Define services that must not be restarted without >-# the '--critical' option and that require "--nodeps" >-# Here you should put services where a restart would >-# interrupt a service being offered to your users >-# Will run: rc-service $SV -- --ifstarted --nodeps restart >-#SV_CRITICAL_WITH_NODEPS='()' >- >-# Define services than only need to be reloaded >-# instead of restarted >-# Will run: rc-service $SV -- --ifstarted reload >-#SV_ALWAYS_RELOAD_ONLY='(libvirtd)' >- >-# Define services that should be ignored >-#SV_IGNORE='(ntp-client)' >- >-# Define processes started via inittab that should be killed >-#INITTAB_KILLALL='(/sbin/agetty)'
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 558006
: 409232 |
409234