mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-25 11:44:44 +00:00
use config tool for host settings
Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
parent
1d1626e449
commit
cff0230cbb
@ -3,20 +3,14 @@
|
|||||||
description="Configuring settings from database."
|
description="Configuring settings from database."
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
need 9pinit
|
|
||||||
before hostname sysctl
|
before hostname sysctl
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
cat /proc/cmdline | grep -q 'com.docker.database' || exit 0
|
ebegin "Configuring host settings from database"
|
||||||
|
|
||||||
ebegin "Configuring settings from database"
|
mobyconfig exists etc/hostname && echo $(mobyconfig get etc/hostname) > /etc/hostname
|
||||||
|
mobyconfig exists etc/sysctl.conf && echo $(mobyconfig get etc/sysctl.conf) > /etc/sysctl.conf
|
||||||
DATABASE="$(cat /proc/cmdline | sed -e 's/.*com.docker.database="//' -e 's/".*//')"
|
|
||||||
HOSTFILE="/Database/branch/master/ro/${DATABASE}/etc/hostname"
|
|
||||||
[ -s ${HOSTFILE} ] && cp ${HOSTFILE} /etc/hostname
|
|
||||||
SYSCTL="/Database/branch/master/ro/${DATABASE}/etc/sysctl.conf"
|
|
||||||
[ -s ${SYSCTL} ] && cp ${SYSCTL} /etc/sysctl.conf
|
|
||||||
|
|
||||||
eend 0
|
eend 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user