The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Test whether Moode startup has completed from systemd service file
#1
Hi

The mpd_oled package for Moode installs a systemd service that should start mpd_oled after the Moode startup has completed. This is done with the following (example) service file


Code:
[Unit]
Description=MPD OLED Display

[Service]
ExecStartPre=/usr/bin/mpd_oled_launch_test
ExecStart=/usr/bin/mpd_oled  -o 6 -b 10 -g 1 -f 30 -c alsa,plughw:Loopback,1
TimeoutSec=3min

[Install]
WantedBy=multi-user.target

and the helper script mpd_oled_launch_test:



Code:
#!/bin/bash

sysname="unknown"

moodeutl_path="/usr/local/bin/moodeutl"
volumio_path="/volumio"
raudio_path="/srv/http/command/rune_shutdown"

if test -f "$moodeutl_path" ; then
  sysname="moode"
  # wait for worker to start to ensure start flag is set to 0
  until ps -C worker.php > /dev/null; do
     sleep 2
  done
  sleep 1     # extra time allow to set flag
  until test $(moodeutl -q "select value from cfg_system where param='wrkready'") = "1"; do
     sleep 4
  done

elif test -f "$volumio_path" ; then
  sysname="volumio"
  until ps -C mpd > /dev/null; do
     sleep 10
  done
elif test -f "$raudio_path" ; then
  sysname="raudio"
  until ps -C mpd > /dev/null; do
     sleep 10
  done
fi

With Moode 8.3.2, when mpd_oled is installed the Moode startup never completes, and wrkready is never set to 1, and mpd_oled_launch_test never makes it past the check for this. Eventually the mpd_oled service times out and wrkready is still set to 0.

moodeutil -l says

Code:
pi@moode832:~ $ moodeutl -l
20230503 120814 worker: --
20230503 120814 worker: -- Start moOde 8 series
20230503 120814 worker: --
20230503 120814 worker: Successfully daemonized
20230503 120814 worker: Waiting for Linux startup...
20230503 121133 worker: ERROR: Linux startup failed to complete after waiting 180 seconds

Maybe this relates to the following recent Moode commit

   https://github.com/moode-player/moode/co...a9119e7efc

Is there a way to work around this? How I can test the Moode startup has completed from a systemd service file?

Adrian.
Reply


Messages In This Thread
Test whether Moode startup has completed from systemd service file - by adrii - 05-03-2023, 11:03 AM

Forum Jump: