blob: 93afed690c64726c055c7bb70ab9cffec4127d0c (
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
32
33
34
35
36
37
38
39
|
#!/bin/sh
### BEGIN INIT INFO
# Provides: vyatta-config-reboot-params
# Required-Start: $local_fs
# Required-Stop:
# X-Start-Before: module-init-tools
# Default-Start: S
# Default-Stop:
# Short-Description: Change system config parameters based on Vyatta configuration
# Description: Provide a way for changing system settings that can only
# be changed on reboot from Vyatta configuration.
### END INIT INFO
# This script runs very early in the boot process so that parameters
# requiring a reboot get set to the same value as in the config file.
#
# To show how the underlying value can be different than the parameter
# in config file, let's take the case of 'firewall conntrack-hash-size'
# which requires a reboot after it is changed to a different value: user
# sets conntrack-hash-size but doesn't save config; then on reboot
# conntrack module loads with a different value of conntrack-hash-size
# than parameter in config file. When config file loads at a later
# stage, underlying value for conntrack-hash-size gets set to parameter
# in config file but for that to take affect another reboot is required.
: ${vyatta_env:=/etc/default/vyatta}
source $vyatta_env
case "$1" in
start) ;;
stop|restart|force-reload|status) exit 0 ;;
*) echo "Usage: $0 {start|stop|restart|force-reload}" >&2; exit 1 ;;
esac
declare -x BOOTFILE=$vyatta_sysconfdir/config/config.boot
# Execute all subordinate scripts in
# /opt/vyatta/bin/sudo-users/check-params-on-reboot.d
run-parts -a $BOOTFILE /opt/vyatta/bin/sudo-users/check-params-on-reboot.d
|