6a5afea40a
1.Use opendev.org instead of git.openstack.org. 2.Use review.opendev.org instead of review.openstack.org. Change-Id: I8e9da8fbb04bdec42a0b2f012f6a38b8ee413b27
43 lines
1.8 KiB
Plaintext
43 lines
1.8 KiB
Plaintext
description "Trove Guest"
|
|
author "Auto-Gen"
|
|
|
|
start on (filesystem and net-device-up IFACE!=lo)
|
|
stop on runlevel [016]
|
|
chdir /var/run
|
|
pre-start script
|
|
mkdir -p /var/run/trove
|
|
chown GUEST_USERNAME:root /var/run/trove/
|
|
|
|
mkdir -p /var/lock/trove
|
|
chown GUEST_USERNAME:root /var/lock/trove/
|
|
|
|
mkdir -p GUEST_LOGDIR
|
|
chown GUEST_USERNAME:root GUEST_LOGDIR
|
|
|
|
# Copy the trove source from the user's development environment
|
|
if [ ! -d /home/GUEST_USERNAME/trove ]; then
|
|
sudo -u GUEST_USERNAME rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' -avz --exclude='.*' HOST_SCP_USERNAME@CONTROLLER_IP:PATH_TROVE/ /home/GUEST_USERNAME/trove
|
|
fi
|
|
|
|
# Ensure conf dir exists and is readable
|
|
mkdir -p /etc/trove/conf.d
|
|
chmod -R +r /etc/trove
|
|
end script
|
|
|
|
script
|
|
# For backwards compatibility until https://review.opendev.org/#/c/100381 merges
|
|
TROVE_CONFIG="--config-dir=/etc/trove/conf.d"
|
|
if [ ! -f /etc/trove/conf.d/guest_info ] && [ ! -f /etc/trove/conf.d/trove-guestagent.conf ]; then
|
|
|
|
chmod +r /etc/guest_info
|
|
sudo -u GUEST_USERNAME rsync -e 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' -avz --exclude='.*' HOST_SCP_USERNAME@CONTROLLER_IP:/etc/trove/trove-guestagent.conf ~GUEST_USERNAME/
|
|
mv ~GUEST_USERNAME/trove-guestagent.conf /etc/trove/trove-guestagent.conf
|
|
TROVE_CONFIG="--config-file=/etc/guest_info --config-file=/etc/trove/trove-guestagent.conf"
|
|
|
|
fi
|
|
|
|
# Requests: CA directories not supported in older Pythons, a custom bundle file is needed
|
|
cat /usr/local/share/ca-certificates/*.crt > /usr/local/share/ca-certificates/custom.bundle
|
|
exec su -c "REQUESTS_CA_BUNDLE=/usr/local/share/ca-certificates/custom.bundle /home/GUEST_USERNAME/trove/contrib/trove-guestagent $TROVE_CONFIG" GUEST_USERNAME
|
|
end script
|