Welcome to Radarspotting. Please login or sign up.

April 18, 2024, 10:37:28 PM

Login with username, password and session length

New Members

New Members

You should get an activation email when you join.  If not, please use the Contact option.

ModeSDeco2 / ModeSMixer2 on Linux (Lubuntu 14.10)?

Started by larsras, May 09, 2015, 04:20:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

larsras

Hi

I have been using the to programs now for some time on my Win7 PC, and they just works great :-)
So it's time to make a dedicated PC, and i have an Dell XPS M1210 running Ubuntu 14.10 which i would like to use with the RTLSDR dongle and those 2 apps, and then do the viewing from my win7 PC over the LAN.

So how is the experience on Linux and is Ubuntu 14.10 usable?

br Lars

sergsero

#1
In Unix system auto running and management of program can to make in different ways. More than three years I am using the package Supervisor. Project homepage is ther: http://supervisord.org/index.html.    

Supervisor is a client/server system that allows its users to monitor and control a number of processes on Unix-like operating systems.
Supervisor is configured through a simple "ini-style" configuration file that is easy to learn. It provides many per-process options that make your life easier like restarting failed processes and automatic log rotation.
Supervisor provides you with one place to start, stop, and monitor your processes.

Consider the case where we have two programs, for example, modesdeco2 and fr24feed (which also still alive and uses for send data to flightradar24.com). Your set of programs may be another.

We want to run their at system startup, monitor their work and automatically restart them on a crash.

1. Check that you use the current versions, which correspond to the type of operating system (and/or processor for ARM) and its bitness. In all the examples used Ubuntu 14.04.

2. You can place programs in any directory of computer. I'll recommend /opt. In the old days, "/opt" was used by Unix vendors like AT&T, Sun, DEC and 3rd-party vendors to hold "Option" packages. Today it's usually describes as for optional add-on software, package source, or anything that isn't part of the base system.

3.  All actions out of home directories are performed as root (sudo ...). In /opt create two subdirectories with corresponding names and put programs in them, for example, as follows:
/opt$ ls -l
drwxr-xr-x 2 root root  4096 apr   5 10:31 fr24feed
drwxr-xr-x 2 root root  4096 apr  12 15:19 modesdeco2

/opt/modesdeco2$ ls –l
-rwxr-xr-x 1 root root 1791464 dec  15 12:25 modesdeco2


4. Next, install the package supervisor from standard Ubuntu repository to your computer.
sudo apt-get undate
sudo apt-get install supervisor

Agree with installation of additional dependencies packages.

5. After installation in /etc will be created the directory supervisor. The Supervisor configuration file is conventionally named supervisord.conf.  In Ubuntu package uses /etc/supervisor/supervisord.conf.
supervisord.conf is a Windows-INI-style (Python ConfigParser) file. It has sections (each denoted by a [header]) and key / value pairs within the sections. The sections and their values are described below.
   
Look inside this directory supervisor:
sergsero@ac168:~$ ls -l /etc/supervisor/
drwxr-xr-x 2 root root 4096 oct  19  2014 conf.d
-rw-r--r-- 1 root root 1243 may   17 08:46 supervisord.conf


6. In the subdirectory conf.d/ create required number of *.conf files by the number of running programs, in this case - two, for example:
-rw-r--r-- 1 root root 212 aug 25 2013 fr24feed.conf
-rw-r--r-- 1 root root 225 apr 24 11:42 modesdeco2.conf


6. Each *.conf file contains a set of lines, the first two differ only by the names of specific programs and their directories:
sergsero@ac168:~$ cat /etc/supervisor/conf.d/fr24feed.conf

[program:fr24feed]
directory=/opt/fr24feed
command=/opt/fr24feed/fr24feed --fr24key=xxxxxxxxxx --bs-ip=127.0.0.1 --bs-port=30003
user=nobody
umask=022
autostart=True
autorestart=True
redirect_stderr=True

sergsero@ac168:~$ cat /etc/supervisor/conf.d/modesdeco2.conf
[program:modesdeco2]
directory=/opt/modesdeco2
command=/opt/modesdeco2/modesdeco2 --gain 49.6 --freq-correction 65 --beast 10003 --msg 30003 --location 59.281:113.39
user=nobody
umask=022
autostart=True
autorestart=True
redirect_stderr=True


7. We can do remote monitoring of our programs. The supervisord.conf file can contains a section named [inet_http_server] under which configuration parameters for an HTTP server that listens on a TCP (internet) socket should be inserted. If the configuration file has no [inet_http_server] section, an inet HTTP server will not be started.



Add to your supervisord.conf file a section named [inet_http_server].

Example,
[inet_http_server]
port = 127.0.0.1:9001
username = user
password = 12345

A TCP host:port value or (e.g. 127.0.0.1:9001) on which supervisor will listen for HTTP/XML-RPC requests. To listen on all interfaces in the machine, use :9001 or *:9001.
Don't forget to change the default login password.

8. That's all. In console run command:
sudo supervisorctl update
sudo supervisorctl status
fr24feed                        RUNNING    pid 1115, uptime 41 days, 23:25:25
modesdeco2                      RUNNING    pid 1119, uptime 41 days, 23:25:25


Reboot your system. Check status of programs:
sudo supervisorctl status

The list of commands:
sudo supervisorctl help

Best regards,
sergsero