Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use user service #223

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/integration/config/garm.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target
WantedBy=default.target
7 changes: 4 additions & 3 deletions test/integration/scripts/setup-garm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ sudo cp $CONFIG_DIR_PROV/* ${GARM_CONFIG_DIR}/test-provider

sudo mv $BINARIES_DIR/* /usr/local/bin/
mkdir -p $HOME/.local/share/systemd/user/
cat $CONFIG_DIR/garm.service| envsubst | tee $HOME/.local/share/systemd/user/${GARM_SERVICE_NAME}.service > /dev/null
cat $CONFIG_DIR/garm.service| envsubst | sudo tee /lib/systemd/system/${GARM_SERVICE_NAME}@.service > /dev/null
sudo chown -R $RUN_USER:$RUN_USER ${GARM_CONFIG_DIR}

systemctl --user daemon-reload
systemctl --user restart ${GARM_SERVICE_NAME}
sudo systemctl daemon-reload
sudo systemctl enable ${GARM_SERVICE_NAME}@${RUN_USER}
sudo systemctl restart ${GARM_SERVICE_NAME}@${RUN_USER}
wait_open_port 127.0.0.1 ${GARM_PORT}

echo "GARM is up and running"
Expand Down
6 changes: 4 additions & 2 deletions test/integration/scripts/taredown_garm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ if [ -z $GARM_SERVICE_NAME ]; then
fi

if [ -f "$HOME/.local/share/systemd/user/${GARM_SERVICE_NAME}.service" ];then
systemctl --user stop $GARM_SERVICE_NAME.service
rm $HOME/.local/share/systemd/user/${GARM_SERVICE_NAME}.service
sudo systemctl stop $GARM_SERVICE_NAME@${RUN_USER}
sudo systemctl disable $GARM_SERVICE_NAME@${RUN_USER}
sudo rm /lib/systemd/system/${GARM_SERVICE_NAME}@.service
sudo systemctl daemon-reload
fi

if [ -d "$GARM_CONFIG_DIR" ] && [ -f "$GARM_CONFIG_DIR/config.toml" ] && [ -f "$GARM_CONFIG_DIR/garm-provider-lxd.toml" ];then
Expand Down
Loading