diff --git a/stage2/06-dride-base/00-run.sh b/stage2/06-dride-base/00-run.sh index 888c0f0..b246da3 100755 --- a/stage2/06-dride-base/00-run.sh +++ b/stage2/06-dride-base/00-run.sh @@ -12,9 +12,7 @@ install -m 644 files/systemctl/ble.service ${ROOTFS_DIR}/lib/systemd/system/ble. install -m 644 files/systemctl/record.service ${ROOTFS_DIR}/lib/systemd/system/record.service install -m 644 files/systemctl/ws.service ${ROOTFS_DIR}/lib/systemd/system/ws.service install -m 644 files/systemctl/live.service ${ROOTFS_DIR}/lib/systemd/system/live.service - -# update rc.local with the welome LED -install -m 644 files/rc.local ${ROOTFS_DIR}/etc/rc.local +install -m 644 files/systemctl/led.service ${ROOTFS_DIR}/lib/systemd/system/led.service on_chroot << EOF @@ -123,6 +121,7 @@ sudo systemctl enable ws sudo update-rc.d dride-core defaults sudo systemctl enable record sudo systemctl enable ble +sudo systemctl enable led if [ ${OS_TYPE} == "dride-plus" ]; then ## GPS https://www.raspberrypi.org/forums/viewtopic.php?p=947968#p947968 diff --git a/stage2/06-dride-base/files/rc.local b/stage2/06-dride-base/files/rc.local deleted file mode 100644 index 6d5f43d..0000000 --- a/stage2/06-dride-base/files/rc.local +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -e -# -# rc.local -# -# This script is executed at the end of each multiuser runlevel. -# Make sure that the script will "exit 0" on success or any other -# value on error. -# -# In order to enable or disable this script just change the execution -# bits. -# -# By default this script does nothing. - -# Print the IP address -/home/core/modules/led/bin/main welcome - -_IP=$(hostname -I) || true -if [ "$_IP" ]; then - printf "My IP address is %s\n" "$_IP" -fi - -exit 0 \ No newline at end of file diff --git a/stage2/06-dride-base/files/systemctl/ble.service b/stage2/06-dride-base/files/systemctl/ble.service index c8a680c..1e4ad34 100644 --- a/stage2/06-dride-base/files/systemctl/ble.service +++ b/stage2/06-dride-base/files/systemctl/ble.service @@ -9,6 +9,7 @@ Type=simple User=root ExecStart=/usr/bin/node /home/core/daemons/bluetooth/main.js Restart=on-failure +RestartSec=1 [Install] WantedBy=multi-user.target diff --git a/stage2/06-dride-base/files/systemctl/led.service b/stage2/06-dride-base/files/systemctl/led.service new file mode 100644 index 0000000..10dad31 --- /dev/null +++ b/stage2/06-dride-base/files/systemctl/led.service @@ -0,0 +1,18 @@ +[Unit] +Description=Control the LED of your Dride +Documentation=https://dride.io/documentation +After=network.target + +[Service] +Type=simple +User=pi +ExecStart=/home/core/modules/led/bin/main welcome +Restart=on-failure +RestartSec=1 + +[Install] +WantedBy=multi-user.target + + + + diff --git a/stage2/06-dride-base/files/systemctl/live.service b/stage2/06-dride-base/files/systemctl/live.service index d09e63b..db756af 100644 --- a/stage2/06-dride-base/files/systemctl/live.service +++ b/stage2/06-dride-base/files/systemctl/live.service @@ -8,6 +8,7 @@ Type=simple User=pi ExecStart=/opt/vc/bin/raspivid -t 0 -w 640 -h 480 -fps 25 -l -o tcp://0.0.0.0:3333 Restart=on-failure +RestartSec=1 [Install] WantedBy=multi-user.target diff --git a/stage2/06-dride-base/files/systemctl/record.service b/stage2/06-dride-base/files/systemctl/record.service index edaa265..c3f11ec 100644 --- a/stage2/06-dride-base/files/systemctl/record.service +++ b/stage2/06-dride-base/files/systemctl/record.service @@ -9,6 +9,7 @@ Type=simple User=pi ExecStart=/usr/bin/node /home/core/modules/video/index.js Restart=on-failure +RestartSec=1 [Install] WantedBy=multi-user.target diff --git a/stage2/06-dride-base/files/systemctl/ws.service b/stage2/06-dride-base/files/systemctl/ws.service index 5c8f1e1..3f91a50 100644 --- a/stage2/06-dride-base/files/systemctl/ws.service +++ b/stage2/06-dride-base/files/systemctl/ws.service @@ -8,6 +8,7 @@ Type=simple User=pi ExecStart=/usr/bin/node /home/core/dride-ws/server/app.js Restart=on-failure +RestartSec=1 [Install] WantedBy=multi-user.target