Open kerel-fs opened 8 years ago
I propose to add a command-line argument allowing ogn-rf and ogn-decode to run non-interactive, perhaps even as a proper daemon (--daemon/-d: Runs process in the background).
Detect whether stdin is a terminal or a pipe and only try to read from stdin if it's a terminal. see also: SO: Detect if stdin is a terminal or pipe in C/C++/Qt?
Also affects version 0.2.6.
This works for me. I use tty20 for ogn-rf and tty21 for ogn-decode.
[Service]
Type=simple
WorkingDirectory=/home/pi/rtlsdr-ogn
ExecStart=/home/pi/rtlsdr-ogn/ogn-rf /home/pi/rtlsdr-ogn/ogn.conf
KillMode=process
StandardInput=tty-force
TTYVHangup=yes
TTYPath=/dev/tty20
TTYReset=yes
Restart=always
RestartSec=10
KillSignal=SIGKILL
Perhaps late in the game, from docker I can run it with:
setsid sh -c 'exec ./ogn-rf Station.conf <> /dev/tty20'
Interesting. I am experiencing the same things with s6 overlay so will try what @rvt mentioned to see if that works.
ogn-rf
andogn-decode
crashes with SEGV or exits when stdin is redirected from /dev/null. This redirection is done by default by systemd for simple services.Steps to repoduce
Download and install rtlsdr-ogn-0.2.5.ARM, then execute it with
Alternatively, there is an ansible role to reproduces the issue with systemd involved: ogn-node
Initial log (systemd involved): http://paste.debian.net/hidden/b0f487a3/ Minimal failing scenario: