diff --git a/buildroot-external/rootfs-overlay/home/mycroft/.config/systemd/user/mycroft.service.wants/mycroft-gui.service b/buildroot-external/rootfs-overlay/home/mycroft/.config/systemd/user/default.target.wants/mycroft-gui.service similarity index 100% rename from buildroot-external/rootfs-overlay/home/mycroft/.config/systemd/user/mycroft.service.wants/mycroft-gui.service rename to buildroot-external/rootfs-overlay/home/mycroft/.config/systemd/user/default.target.wants/mycroft-gui.service diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/mycroft-admin-phal.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/mycroft-admin-phal.service index 66d201c1..2fb67569 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/system/mycroft-admin-phal.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/system/mycroft-admin-phal.service @@ -2,13 +2,13 @@ Description=Admin PHAL [Service] -Type=notify +#Type=notify ExecStart=/usr/libexec/mycroft-systemd-admin-phal -TimeoutStartSec=1m -TimeoutStopSec=1m +#TimeoutStartSec=1m +#TimeoutStopSec=1m Restart=on-failure -StartLimitInterval=5min -StartLimitBurst=4 +#StartLimitInterval=5min +#StartLimitBurst=4 #StartLimitAction=reboot-force #WatchdogSec=30s diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/kdeconnectd.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/kdeconnectd.service index 2fe81f28..039c892a 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/kdeconnectd.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/kdeconnectd.service @@ -1,9 +1,14 @@ [Unit] Description=Connect your OVOS-Device to your smartphone or tablet +Wants=sound.target +After=sound.target +Wants=network-online.target +After=network-online.target +After=pulseaudio.service [Service] ExecStart=/usr/lib/libexec/kdeconnectd -platform offscreen BusName=org.kde.kdeconnect [Install] -WantedBy=multi-user.target +WantedBy=default.target diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-audio.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-audio.service index c9b1a7fd..4ed990d5 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-audio.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-audio.service @@ -3,6 +3,7 @@ Description=Mycroft Audio PartOf=mycroft.service After=mycroft.service After=mycroft-messagebus.service +After=pulseaudio.service [Service] Type=notify diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-enclosure-gui.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-enclosure-gui.service index 9e687118..4b27f889 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-enclosure-gui.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-enclosure-gui.service @@ -3,6 +3,7 @@ Description=Mycroft Enclosure PartOf=mycroft.service After=mycroft.service After=mycroft-messagebus.service +After=pulseaudio.service [Service] Type=notify diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-gui.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-gui.service index e6e353dc..00c10ecd 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-gui.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-gui.service @@ -19,4 +19,4 @@ StandardOutput=null Restart=on-failure [Install] -WantedBy=mycroft.service +WantedBy=default.target diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-phal.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-phal.service index 910bd949..6c80c8c4 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-phal.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-phal.service @@ -3,6 +3,7 @@ Description=Mycroft PHAL PartOf=mycroft.service After=mycroft.service After=mycroft-messagebus.service +After=pulseaudio.service [Service] Type=notify diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-skills.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-skills.service index ef2fe809..5bca329a 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-skills.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-skills.service @@ -3,6 +3,7 @@ Description=Mycroft Skills PartOf=mycroft.service After=mycroft.service After=mycroft-messagebus.service +After=pulseaudio.service [Service] Type=notify diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-voice.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-voice.service index 2f652d5f..473beb36 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-voice.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/mycroft-voice.service @@ -3,6 +3,7 @@ Description=Mycroft Voice PartOf=mycroft.service After=mycroft.service After=mycroft-messagebus.service +After=pulseaudio.service [Service] Type=notify @@ -19,4 +20,3 @@ StartLimitBurst=4 [Install] WantedBy=mycroft.service - diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/pulseaudio.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/pulseaudio.service new file mode 100644 index 00000000..8a6cf4eb --- /dev/null +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/pulseaudio.service @@ -0,0 +1,35 @@ +[Unit] +Description=Sound Service + +# We require pulseaudio.socket to be active before starting the daemon, because +# while it is possible to use the service without the socket, it is not clear +# why it would be desirable. +# +# A user installing pulseaudio and doing `systemctl --user start pulseaudio` +# will not get the socket started, which might be confusing and problematic if +# the server is to be restarted later on, as the client autospawn feature +# might kick in. Also, a start of the socket unit will fail, adding to the +# confusion. +# +# After=pulseaudio.socket is not needed, as it is already implicit in the +# socket-service relationship, see systemd.socket(5). +Requires=pulseaudio.socket +ConditionUser=!root + +[Service] +ExecStart=/usr/bin/pulseaudio --daemonize=no --log-target=journal +LockPersonality=yes +MemoryDenyWriteExecute=yes +NoNewPrivileges=yes +RestartSec=5 +Restart=on-failure +RestrictNamespaces=yes +SystemCallArchitectures=native +SystemCallFilter=@system-service +# Note that notify will only work if --daemonize=no +Type=notify +UMask=0077 + +[Install] +Also=pulseaudio.socket +WantedBy=default.target diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/shairport-sync.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/shairport-sync.service index 00e8f914..34410f3f 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/shairport-sync.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/shairport-sync.service @@ -12,4 +12,4 @@ Restart=always RestartSec=5 [Install] -WantedBy=multi-user.target +WantedBy=default.target diff --git a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/spotifyd.service b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/spotifyd.service index a425f5e7..75b8b684 100644 --- a/buildroot-external/rootfs-overlay/usr/lib/systemd/user/spotifyd.service +++ b/buildroot-external/rootfs-overlay/usr/lib/systemd/user/spotifyd.service @@ -13,4 +13,4 @@ Restart=always RestartSec=5 [Install] -WantedBy=multi-user.target +WantedBy=default.target