OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Script to setup a GCE instance to run the webtry server. | 3 # Script to setup a GCE instance to run the webtry server. |
4 # For full instructions see the README file. | 4 # For full instructions see the README file. |
5 sudo apt-get install schroot debootstrap monit squid3 | 5 sudo apt-get install schroot debootstrap monit squid3 |
6 sudo apt-get install g++ libfreetype6 libfreetype6-dev libpng12-0 libpng12-dev l ibglu1-mesa-dev mesa-common-dev freeglut3-dev libgif-dev libfontconfig libfontco nfig-dev | 6 |
7 # although aufs is being replaced by overlayfs, it's not clear | |
8 # to me if overlayfs is completely supported by schroot yet. | |
9 sudo apt-get install aufs-tools | |
7 | 10 |
8 echo "Adding the webtry user account" | 11 echo "Adding the webtry user account" |
9 sudo adduser webtry | 12 sudo adduser webtry |
10 | 13 |
11 sudo cp continue_install /home/webtry/continue_install | 14 sudo mkdir /home/webtry/cache |
12 sudo chmod 766 /home/webtry/continue_install | 15 sudo mkdir /home/webtry/cache/src |
13 sudo chown webtry:webtry /home/webtry/continue_install | 16 sudo mkdir /home/webtry/inout |
14 sudo su webtry -c /home/webtry/continue_install | 17 sudo chmod 777 /home/webtry/inout |
18 sudo chmod 777 /home/webtry/cache | |
19 sudo chmod 777 /home/webtry/cache/src | |
15 | 20 |
16 sudo mkdir -p /srv/chroot/webtry | 21 sudo cp ../sys/webtry_schroot /etc/schroot/chroot.d/webtry |
17 sudo cp /home/webtry/skia/experimental/webtry/sys/webtry_schroot /etc/schroot/ch root.d/webtry | |
18 | 22 |
19 sudo mkdir /srv/chroot/webtry/etc | 23 CHROOT_JAIL=/srv/chroot/webtry_gyp |
20 sudo mkdir /srv/chroot/webtry/bin | 24 # Build the chroot environment |
21 sudo cp /bin/sh /srv/chroot/webtry/bin/sh | 25 if [ ! -d ${CHROOT_JAIL} ]; then |
26 » sudo mkdir -p ${CHROOT_JAIL} | |
22 | 27 |
23 # Copy all the dependent libraries into the schroot. | 28 » sudo debootstrap --variant=minbase wheezy ${CHROOT_JAIL} |
24 sudo cp --parents `ldd /home/webtry/skia/out/Debug/webtry | cut -d " " -f 3` /sr v/chroot/webtry | 29 » sudo cp setup_jail.sh ${CHROOT_JAIL}/bin |
25 sudo cp --parents `ldd /bin/sh | cut -d " " -f 3` /srv/chroot/webtry | 30 » sudo chmod 755 ${CHROOT_JAIL}/bin/setup_jail.sh |
31 » sudo chroot ${CHROOT_JAIL} /bin/setup_jail.sh | |
32 » sudo echo "none /dev/shm tmpfs rw,nosuid,nodev,noexec 0 0" >> ${CHROOT_J AIL}/etc/fstab | |
33 fi | |
26 | 34 |
27 sudo cp /home/webtry/skia/experimental/webtry/sys/webtry_init /etc/init.d/webtry | 35 # the continue_install script will fetch the latest versions of |
28 sudo cp /home/webtry/skia/experimental/webtry/sys/webtry_monit /etc/monit/conf.d /webtry | 36 # skia and depot_tools. we split up the installation process into |
jcgregorio
2014/10/01 16:39:50
We
humper
2014/10/01 17:02:44
Done.
LOL that you guys missed the gigantic comme
| |
29 sudo cp /home/webtry/skia/experimental/webtry/sys/webtry_squid /etc/squid3/squid .conf | 37 # two pieces like this so that the continue_install script can |
38 # be run independently of this one to fetch and build the latest skia. | |
39 | |
40 ./continue_install.sh | |
41 | |
42 sudo cp ../sys/webtry_init /etc/init.d/webtry | |
43 sudo cp ../sys/webtry_monit /etc/monit/conf.d/webtry | |
44 sudo cp ../sys/webtry_squid /etc/squid3/squid.conf | |
30 sudo chmod 744 /etc/init.d/webtry | 45 sudo chmod 744 /etc/init.d/webtry |
31 | 46 |
32 # Confirm that monit is happy. | 47 # Confirm that monit is happy. |
33 sudo monit -t | 48 |
34 sudo monit reload | 49 # COMMENTED OUT TEMOPORARILY FOR TESTING !! DON'T LET GREG LAND THIS FILE THIS W AY!!! |
50 # COMMENTED OUT TEMOPORARILY FOR TESTING !! DON'T LET GREG LAND THIS FILE THIS W AY!!! | |
51 # COMMENTED OUT TEMOPORARILY FOR TESTING !! DON'T LET GREG LAND THIS FILE THIS W AY!!! | |
52 # COMMENTED OUT TEMOPORARILY FOR TESTING !! DON'T LET GREG LAND THIS FILE THIS W AY!!! | |
53 # COMMENTED OUT TEMOPORARILY FOR TESTING !! DON'T LET GREG LAND THIS FILE THIS W AY!!! | |
54 | |
55 # sudo monit -t | |
56 # sudo monit reload | |
OLD | NEW |