From dc6ab967a7fe09e2c7a0b54b002b169be3faa60f Mon Sep 17 00:00:00 2001 From: itskalvik Date: Tue, 29 Oct 2024 15:24:27 -0500 Subject: [PATCH 1/3] Start blueos on boot with systemctl service instead of rc.local --- install/install.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/install/install.sh b/install/install.sh index 1ecd6c9e72..015993a626 100755 --- a/install/install.sh +++ b/install/install.sh @@ -226,8 +226,23 @@ docker create \ -e BLUEOS_CONFIG_PATH=$HOME/.config/blueos \ $BLUEOS_BOOTSTRAP -# add docker entry to rc.local -sed -i "\%^exit 0%idocker start blueos-bootstrap" /etc/rc.local || echo "Failed to add docker start on rc.local, BlueOS will not start on boot!" +# Ensure docker can run without sudo +groupadd docker +usermod -aG docker pi + +# Create service to start blueos-bootstrap container on boot +echo "[Unit] +Description=Start BlueOS on boot + +[Service] +Type=oneshot +ExecStart=/usr/bin/docker start blueos-bootstrap + +[Install] +WantedBy=multi-user.target" >> /etc/systemd/system/blueos.service + +systemctl start start-blueos +systemctl enable start-blueos # Configure network settings ## This should be after everything, otherwise network problems can happen From db43f7d9531bcce740ba2f4168e69c31b0b36cfd Mon Sep 17 00:00:00 2001 From: itskalvik Date: Tue, 29 Oct 2024 15:31:17 -0500 Subject: [PATCH 2/3] Switch to curl to configure systemd service for blueos --- install/configs/blueos.service | 9 +++++++++ install/install.sh | 11 +---------- 2 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 install/configs/blueos.service diff --git a/install/configs/blueos.service b/install/configs/blueos.service new file mode 100644 index 0000000000..7b61f1a4b3 --- /dev/null +++ b/install/configs/blueos.service @@ -0,0 +1,9 @@ +[Unit] +Description=Start BlueOS on boot + +[Service] +Type=oneshot +ExecStart=/usr/bin/docker start blueos-bootstrap + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/install/install.sh b/install/install.sh index 015993a626..eeb2cc566a 100755 --- a/install/install.sh +++ b/install/install.sh @@ -231,16 +231,7 @@ groupadd docker usermod -aG docker pi # Create service to start blueos-bootstrap container on boot -echo "[Unit] -Description=Start BlueOS on boot - -[Service] -Type=oneshot -ExecStart=/usr/bin/docker start blueos-bootstrap - -[Install] -WantedBy=multi-user.target" >> /etc/systemd/system/blueos.service - +curl -fsSL "$ROOT/install/configs/blueos.service" -o /etc/systemd/system/blueos.service systemctl start start-blueos systemctl enable start-blueos From 836bfb77a75f2b2532745de6bbf2235b1489cd4b Mon Sep 17 00:00:00 2001 From: itskalvik Date: Tue, 29 Oct 2024 17:24:22 -0500 Subject: [PATCH 3/3] Fix blueos systemd service --- install/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install/install.sh b/install/install.sh index eeb2cc566a..4d07ba81d0 100755 --- a/install/install.sh +++ b/install/install.sh @@ -227,13 +227,13 @@ docker create \ $BLUEOS_BOOTSTRAP # Ensure docker can run without sudo -groupadd docker -usermod -aG docker pi +groupadd docker || true +usermod -aG docker pi || true # Create service to start blueos-bootstrap container on boot curl -fsSL "$ROOT/install/configs/blueos.service" -o /etc/systemd/system/blueos.service -systemctl start start-blueos -systemctl enable start-blueos +systemctl start blueos +systemctl enable blueos # Configure network settings ## This should be after everything, otherwise network problems can happen