forked from boot2docker/boot2docker
/
bootscript.sh
executable file
·74 lines (56 loc) · 1.86 KB
/
bootscript.sh
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
# Configure sysctl
/etc/rc.d/sysctl
# Load TCE extensions
/etc/rc.d/tce-loader
# Automount a hard drive
/etc/rc.d/automount
# Mount cgroups hierarchy
/etc/rc.d/cgroupfs-mount
# see https://github.com/tianon/cgroupfs-mount
mkdir -p /var/lib/boot2docker/log
#import settings from profile (or unset them)
export NTP_SERVER=pool.ntp.org
test -f "/var/lib/boot2docker/profile" && . "/var/lib/boot2docker/profile"
# set the hostname
/etc/rc.d/hostname
# sync the clock (in the background, it takes 40s to timeout)
/etc/rc.d/ntpclient > /var/log/ntpclient.log 2>&1 &
# TODO: move this (and the docker user creation&pwd out to its own over-rideable?))
if grep -q '^docker:' /etc/passwd; then
# if we have the docker user, let's create the docker group
/bin/addgroup -S docker
# ... and add our docker user to it!
/bin/addgroup docker docker
#preload data from boot2docker-cli
if [ -e "/var/lib/boot2docker/userdata.tar" ]; then
tar xf /var/lib/boot2docker/userdata.tar -C /home/docker/ > /var/log/userdata.log 2>&1
chown -R docker:staff /home/docker
fi
fi
# Automount Shared Folders (VirtualBox, etc.)
/etc/rc.d/automount-shares
# Configure SSHD
/etc/rc.d/sshd
# Launch ACPId
/etc/rc.d/acpid
echo "-------------------"
date
#maybe the links will be up by now - trouble is, on some setups, they may never happen, so we can't just wait until they are
sleep 5
date
ip a
echo "-------------------"
# Launch Docker
/etc/rc.d/docker
# Allow local bootsync.sh customisation
if [ -e /var/lib/boot2docker/bootsync.sh ]; then
/var/lib/boot2docker/bootsync.sh
fi
# Allow local HD customisation
if [ -e /var/lib/boot2docker/bootlocal.sh ]; then
/var/lib/boot2docker/bootlocal.sh > /var/log/bootlocal.log 2>&1 &
fi
# Execute automated_script
# disabled - this script was written assuming bash, which we no longer have.
#/etc/rc.d/automated_script.sh