You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doltab currently doesnt have a systemd/unit file in order to consistently run the server in case of a reboot. i've created a sample service.sh which would allow for this file to be created and start the doltlab containers via systemd.
#!/bin/bash
set -e
# script should run as root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# get current dir and append start-doltlab.sh to it
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPT="$DIR/start-doltlab.sh"
# create service file with script as ExecStart
unit="[Unit]
Description=%i DoltLab server
PartOf=docker.service
After=docker.service
[Service]
Type=oneshot
User=root
RemainAfterExit=true
WorkingDirectory=$DIR
ExecStart=$SCRIPT
ExecStop=/usr/local/bin/docker-compose down
[Install]
WantedBy=multi-user.target"
# test if unit is the same as the one present
if [ "$unit" = "$(cat /etc/systemd/system/doltlab.service)" ]; then
echo "Service already exists at /etc/systemd/system/doltlab.service"
exit 0
else
echo "Creating service at /etc/systemd/system/doltlab.service"
echo "$unit" > /etc/systemd/system/doltlab.service
fi
# reload deamon
systemctl daemon-reload
# enable service
systemctl enable doltlab.service
# start service
systemctl start doltlab.service
The text was updated successfully, but these errors were encountered:
doltab currently doesnt have a systemd/unit file in order to consistently run the server in case of a reboot. i've created a sample
service.sh
which would allow for this file to be created and start the doltlab containers via systemd.The text was updated successfully, but these errors were encountered: