From 17623d4f52431cb590584297bf88ffe93c212fa5 Mon Sep 17 00:00:00 2001 From: Peter Steenbergen Date: Wed, 15 Apr 2020 10:00:27 +0200 Subject: [PATCH] MycroftOS: Let all services know they are starting to psplash. --- .../package/firstboot-service/firstboot.service | 1 + .../package/hostname-service/hostname.service | 1 + .../package/mycroft-service/mycroft-audio.service | 2 ++ .../package/mycroft-service/mycroft-enclosure.service | 2 ++ .../package/mycroft-service/mycroft-messagebus.service | 2 ++ .../package/mycroft-service/mycroft-skills.service | 2 ++ .../package/mycroft-service/mycroft-voice.service | 2 ++ buildroot-external/package/mycroft-service/mycroft.service | 7 ++----- .../package/prepare_system-service/prepare_system.service | 1 + .../package/respeaker/seeed-voicecard.service | 1 + buildroot-external/package/snapcast/snapclient.service | 1 + buildroot-external/package/snapcast/snapserver.service | 1 + buildroot-external/package/spotifyd/spotifyd.service | 1 + 13 files changed, 19 insertions(+), 5 deletions(-) diff --git a/buildroot-external/package/firstboot-service/firstboot.service b/buildroot-external/package/firstboot-service/firstboot.service index 6a18a865..3fa80cec 100644 --- a/buildroot-external/package/firstboot-service/firstboot.service +++ b/buildroot-external/package/firstboot-service/firstboot.service @@ -10,6 +10,7 @@ ConditionPathExists=/etc/firstboot [Service] Type=oneshot RemainAfterExit=yes +ExecStartPre=/bin/psplash-write "MSG Preparing for first boot" ExecStart=/usr/sbin/firstboot [Install] diff --git a/buildroot-external/package/hostname-service/hostname.service b/buildroot-external/package/hostname-service/hostname.service index 4b372b93..97fd2f82 100644 --- a/buildroot-external/package/hostname-service/hostname.service +++ b/buildroot-external/package/hostname-service/hostname.service @@ -5,6 +5,7 @@ Before=avahi-daemon.service [Service] Type=oneshot +ExecStartPre=/bin/psplash-write "MSG Setting up hostname" ExecStart=/bin/sh -c "hostnamectl set-hostname MycroftOS-`sed 's/://g' /sys/class/net/eth0/address | tail -c 7`" [Install] diff --git a/buildroot-external/package/mycroft-service/mycroft-audio.service b/buildroot-external/package/mycroft-service/mycroft-audio.service index aadac63b..53572f3c 100644 --- a/buildroot-external/package/mycroft-service/mycroft-audio.service +++ b/buildroot-external/package/mycroft-service/mycroft-audio.service @@ -6,6 +6,8 @@ After=mycroft.service [Service] User=mycroft WorkingDirectory=/home/mycroft +ExecStartPre=/bin/psplash-write "MSG Starting Mycroft A.I. audio service" +ExecStartPre=/bin/sleep 2 ExecStart=mycroft-audio StandardOutput=file:/var/log/mycroft/audio.log StandardError=file:/var/log/mycroft/audio.error.log diff --git a/buildroot-external/package/mycroft-service/mycroft-enclosure.service b/buildroot-external/package/mycroft-service/mycroft-enclosure.service index 8acac55a..8afe4816 100644 --- a/buildroot-external/package/mycroft-service/mycroft-enclosure.service +++ b/buildroot-external/package/mycroft-service/mycroft-enclosure.service @@ -7,6 +7,8 @@ After=mycroft-messagebus.service [Service] User=mycroft WorkingDirectory=/home/mycroft +ExecStartPre=/bin/psplash-write "MSG Starting Mycroft A.I. enclosure service" +ExecStartPre=/bin/sleep 2 ExecStart=mycroft-enclosure-client StandardOutput=file:/var/log/mycroft/enclosure.log StandardError=file:/var/log/mycroft/enclosure.error.log diff --git a/buildroot-external/package/mycroft-service/mycroft-messagebus.service b/buildroot-external/package/mycroft-service/mycroft-messagebus.service index 520f7303..5a2879bf 100644 --- a/buildroot-external/package/mycroft-service/mycroft-messagebus.service +++ b/buildroot-external/package/mycroft-service/mycroft-messagebus.service @@ -6,6 +6,8 @@ After=mycroft.service [Service] User=mycroft WorkingDirectory=/home/mycroft +ExecStartPre=/bin/psplash-write "MSG Starting Mycroft A.I. messagebus service" +ExecStartPre=/bin/sleep 2 ExecStart=mycroft-messagebus StandardOutput=file:/var/log/mycroft/bus.log StandardError=file:/var/log/mycroft/bus.error.log diff --git a/buildroot-external/package/mycroft-service/mycroft-skills.service b/buildroot-external/package/mycroft-service/mycroft-skills.service index b0c4c80d..ac2bcdb0 100644 --- a/buildroot-external/package/mycroft-service/mycroft-skills.service +++ b/buildroot-external/package/mycroft-service/mycroft-skills.service @@ -6,6 +6,8 @@ After=mycroft.service [Service] User=mycroft WorkingDirectory=/home/mycroft +ExecStartPre=/bin/psplash-write "MSG Starting Mycroft A.I. skills service" +ExecStartPre=/bin/sleep 2 ExecStart=mycroft-skills StandardOutput=file:/var/log/mycroft/skills.log StandardError=file:/var/log/mycroft/skills.error.log diff --git a/buildroot-external/package/mycroft-service/mycroft-voice.service b/buildroot-external/package/mycroft-service/mycroft-voice.service index d412fa84..c00240de 100644 --- a/buildroot-external/package/mycroft-service/mycroft-voice.service +++ b/buildroot-external/package/mycroft-service/mycroft-voice.service @@ -6,6 +6,8 @@ After=mycroft.service [Service] User=mycroft WorkingDirectory=/home/mycroft +ExecStartPre=/bin/psplash-write "MSG Starting Mycroft A.I. voice service" +ExecStartPre=/bin/sleep 2 ExecStart=mycroft-speech-client StandardOutput=file:/var/log/mycroft/voice.log StandardError=file:/var/log/mycroft/voice.error.log diff --git a/buildroot-external/package/mycroft-service/mycroft.service b/buildroot-external/package/mycroft-service/mycroft.service index edc1928b..fd967d9b 100644 --- a/buildroot-external/package/mycroft-service/mycroft.service +++ b/buildroot-external/package/mycroft-service/mycroft.service @@ -1,17 +1,14 @@ [Unit] Description=Mycroft A.I. Software stack. After=pulseaudio.service -After=network-online.target [Service] User=mycroft WorkingDirectory=/home/mycroft Type=oneshot -ExecStartPre=fbv -f -d 1 /opt/mycroft/splash/logo.png > /dev/null 2>&1 -ExecStartPre=/bin/bash -c 'fbv -f -d 1 /opt/mycroft/splash/waiting.png > /dev/null 2>&1;\ - while ! ping -q -c 1 -W 1 1.1.1.1 >/dev/null 2>&1; do sleep 1; done' +ExecStartPre=/bin/psplash-write "MSG Starting Mycroft A.I. software stack" +ExecStartPre=/bin/sleep 2 ExecStart=/bin/true -ExecStartPost=fbv -f -d 1 /opt/mycroft/splash/logo.png > /dev/null 2>&1 RemainAfterExit=yes [Install] diff --git a/buildroot-external/package/prepare_system-service/prepare_system.service b/buildroot-external/package/prepare_system-service/prepare_system.service index c0302548..6d86264a 100644 --- a/buildroot-external/package/prepare_system-service/prepare_system.service +++ b/buildroot-external/package/prepare_system-service/prepare_system.service @@ -8,6 +8,7 @@ Before=sysinit.target shutdown.target [Service] Type=oneshot RemainAfterExit=yes +ExecStartPre=/bin/psplash-write "MSG Preparing system" ExecStart=/usr/sbin/prepare_system [Install] diff --git a/buildroot-external/package/respeaker/seeed-voicecard.service b/buildroot-external/package/respeaker/seeed-voicecard.service index 298fac66..a68ecc8e 100644 --- a/buildroot-external/package/respeaker/seeed-voicecard.service +++ b/buildroot-external/package/respeaker/seeed-voicecard.service @@ -5,6 +5,7 @@ After=alsa-restore.service [Service] Type=oneshot RemainAfterExit=yes +ExecStartPre=/bin/psplash-write "MSG Preparing respeaker configuration" ExecStart=/usr/bin/seeed-voicecard User=root diff --git a/buildroot-external/package/snapcast/snapclient.service b/buildroot-external/package/snapcast/snapclient.service index 1a37d834..8dd52ca7 100644 --- a/buildroot-external/package/snapcast/snapclient.service +++ b/buildroot-external/package/snapcast/snapclient.service @@ -6,6 +6,7 @@ After=network.target time-sync.target sound.target avahi-daemon.service [Service] EnvironmentFile=-/etc/snapcast/snapclient +ExecStartPre=/bin/psplash-write "MSG Starting Snapcast client" ExecStart=/usr/bin/snapclient $SNAPCLIENT_OPTS # very noisy on stdout StandardOutput=null diff --git a/buildroot-external/package/snapcast/snapserver.service b/buildroot-external/package/snapcast/snapserver.service index a0cce47f..40401867 100644 --- a/buildroot-external/package/snapcast/snapserver.service +++ b/buildroot-external/package/snapcast/snapserver.service @@ -6,6 +6,7 @@ After=network.target time-sync.target avahi-daemon.service [Service] EnvironmentFile=-/etc/snapcast/snapserver +ExecStartPre=/bin/psplash-write "MSG Starting Snapcast server" ExecStart=/usr/bin/snapserver $SNAPSERVER_OPTS Restart=on-failure diff --git a/buildroot-external/package/spotifyd/spotifyd.service b/buildroot-external/package/spotifyd/spotifyd.service index 699a295a..adefe5b0 100644 --- a/buildroot-external/package/spotifyd/spotifyd.service +++ b/buildroot-external/package/spotifyd/spotifyd.service @@ -9,6 +9,7 @@ After=pulseaudio.service [Service] Type=simple +ExecStartPre=/bin/psplash-write "MSG Starting Spotify connect" ExecStart=/usr/bin/spotifyd --no-daemon Restart=always RestartSec=5