airtime-media-monitor, airtime-liquidsoap, airtime-playout what user shall run each?
  • Here is my next stop with porting/adapting Airtime 5.2 for CentOS/RHEL:
    under which user following daemons should run: airtime-media-monitor, airtime-liquidsoap, and airtime-playout?
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • 6 Comments sorted by
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Alex, by default on Debian/Ubuntu, Liquidsoap runs as the 'pypo' user, but the other processes run as root. I don't recall the reasons for this, but I wonder if the media monitor really needs write access across the whole file system in order to delete items from watched folders.

    If you can find a way to use a less privileged user account for all services, please feed back your findings to the Airtime team so that the default setup can benefit.

    Cheers!

    Daniel
  • Thanks Daniel,

    I will try to play with it and will update with what I get.

    BTW, as far as I am not quite familiar with main functionality of airtime-media-monitor, could you please just bullet-point those? So I can consider it in my "puzzle-play"
    So far I see that zendphp.log has root:root credentials with 644 mode. So we would need to change it when created if so.
    Post edited by Alex Gainulin at 2014-04-22 11:39:43
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • BTW, I just stuck with following error in the /var/log/airtime/media-monitor/media-monitor.log
    when I run /etc/init.d/airtime-media-monitor start:

    ...
    2014-04-22 11:28:12,302 DEBUG - [Thread-1] [api_client.py : __call__()] : LINE 134 - http://192.168.1.77:8088/api/list-all-watched-dirs/format/json/api_key/7NPTXYDZWJ7OK4TK3IKT
    2014-04-22 11:28:12,388 DEBUG - [Thread-1] [api_client.py : __call__()] : LINE 134 - http://192.168.1.77:8088/api/list-all-files/format/json/api_key/7NPTXYDZWJ7OK4TK3IKT/dir_id/1/all/0
    2014-04-22 11:28:12,471 INFO - [Thread-1] [bootstrap.py : flush_watch()] : LINE 63 - Flushed watch directory (/srv/airtime/stor/imported).                 (added, modified, deleted) = (0, 0, 0)
    2014-04-22 11:28:12,473 DEBUG - [Thread-1] [api_client.py : __call__()] : LINE 134 - http://192.168.1.77:8088/api/register-component/format/json/api_key/7NPTXYDZWJ7OK4TK3IKT/component/media-monitor

    it is stuck with this step... what it is doing there? I open that URL in browser and it shown in empty screen just with "[]"
    no errors in Apache, nothing...

    Updates: I guess I am wrong with my statement (sorry for the confusion) - in original init.d the start media-monitor was used an argument "--background" which interprets as the fork to allow process stays ran.... but my implementation in RHEL do not has it... will play around.
    Could someone confirm that below processes are correct and represented the media-monitor status as up and running?:
    # ps aux | grep -i media
    root     28444  0.0  0.1   5196  1400 pts/5    S+   11:28   0:00 /bin/bash /etc/init.d/airtime-media-monitor start
    root     28449  0.0  0.1   5496  1272 pts/5    S+   11:28   0:00 runuser -s /bin/bash root -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/lib/airtime/media-monitor/airtime-media-monitor
    root     28450  0.0  0.1   5060  1088 pts/5    S+   11:28   0:00 bash -c ulimit -S -c 0 >/dev/null 2>&1 ; /usr/lib/airtime/media-monitor/airtime-media-monitor
    root     28451  0.0  1.0  71260 10500 pts/5    Sl+  11:28   0:02 python /usr/lib/airtime/media-monitor/media_monitor.py

    Post edited by Alex Gainulin at 2014-04-22 21:01:34
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • I was able to fix media-monitor init.d script for CentOS.
    Could someone please confirm that only process stating it's ran:
    root     31482     1 30 11:02 pts/5    00:00:01 python /usr/lib/airtime/media-monitor/media_monitor.py

    Also, airtime-check-system: how it checks MEDIA_MONITOR_PROCESS_ID?
    I see in the airtime-check-system.php it uses: isset() and reading array $data->services->media_monitor->process_id. In my case it shows FAILED, however it is running... I need to either check why it failed or rewrite to look at /proc/$PID
    Any idea what php file to check?
     
    Post edited by Alex Gainulin at 2014-04-23 23:42:50
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • Ok I think I got the answer. It uses service OS level command, so b/c of airtime-media-monitor service is actually has different name related to PID, it will not get designed case. 
    For my env I will implement the way: read /proc/$pid directory and pass status into airtime-check-system.php.
    I see that media-monitor actually working/managing the media - which is really great success :)
    Just play-engine still on my way to adapt ... fingers-crossed.
    Post edited by Alex Gainulin at 2014-04-25 11:56:57
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +
  • To Daniel (or someone who knows)

    what is the priority order to run:
     airtime-media-monitor - 
     airtime-liquidsoap - 
     airtime-playout -

    My understanding airtime-liquidsoap should be ran before airtime-playout. Is that is correct? 
    www.actionsch.com - Bringing talents in life!
    + Action Radio School +