[Unit]
Description=bbot worker bootstrap
After=multi-user.target
Conflicts=getty@tty1.service

[Service]
Type=idle
# Old versions of systemd have no 'infinity'.
TimeoutStartSec=6000min
RemainAfterExit=true
User=build
Group=build
# Old versions of systemd have no '~'.
WorkingDirectory=/home/build

# Uncomment this if there is an X server running (e.g., Xvfb).
#
#Environment=DISPLAY=:99

# Note: may want to add --keep-system-path to ExecStart below if the
# installation location is already in the PATH environment variable.
#
Environment=CXX=g++
Environment=INSTALL=/usr/local
Environment=BUILD=/tmp
Environment=ENVIRONMENTS=/home/build/environments

# Note: bootstrap script options must come before build.sh options/arguments.
#
ExecStart=/usr/local/bin/bbot-bootstrap-linux.sh \
--install ${INSTALL} \
--build ${BUILD} \
--environments ${ENVIRONMENTS} \
--private \
--sudo sudo \
${CXX}

StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit
TTYPath=/dev/tty1
TTYReset=yes
TTYVHangup=yes

[Install]
WantedBy=multi-user.target
