[satlab] Move satlab drone naming to upstart conf

BUG=b:214092523

Change-Id: I7954aec7bb45723fc6233817d59f634409b49ede
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/satlab/+/3381497
Reviewed-by: Prasad Vuppalapu <prasadv@chromium.org>
Commit-Queue: Anh Le <anhdle@chromium.org>
Tested-by: Anh Le <anhdle@chromium.org>
diff --git a/os-dependent/chromeos/upstart-scripts/satlab-compose-up.conf b/os-dependent/chromeos/upstart-scripts/satlab-compose-up.conf
index 11e573d..7929a08 100644
--- a/os-dependent/chromeos/upstart-scripts/satlab-compose-up.conf
+++ b/os-dependent/chromeos/upstart-scripts/satlab-compose-up.conf
@@ -70,6 +70,14 @@
     sleep 1
   done
 
+  # Allow other users to use docker socket.
+  chmod 666 /var/run/docker.sock
+
+  DRONE_HOSTNAME="satlab"
+  MACADDR=$(echo "$(vpd -g serial_number)" | awk '{print tolower($0)}')
+  DRONE_HOSTNAME="${DRONE_HOSTNAME}-${MACADDR}"
+  echo "Drone Name: ${DRONE_HOSTNAME}"
+
   docker run --rm --name compose \
     --label=com.centurylinklabs.watchtower.lifecycle.pre-update="docker-compose down" \
     --label=com.centurylinklabs.watchtower.stop-signal=KILL \
@@ -77,6 +85,7 @@
     -v docker_config:/root/.docker \
     -v satlab_keys:/home/satlab/keys \
     -v cache_server:/home/satlab/cache_server \
+    -e DRONE_HOSTNAME=${DRONE_HOSTNAME}
     -e LABEL=${LABEL} \
     -e SSH_PORT=${SSH_PORT} \
     --add-host dockerhost:172.17.0.1 \