Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup trunk-recorder and radio-scanner on RPI boot #946

Open
jeffbarclay opened this issue Apr 10, 2024 · 6 comments
Open

Startup trunk-recorder and radio-scanner on RPI boot #946

jeffbarclay opened this issue Apr 10, 2024 · 6 comments

Comments

@jeffbarclay
Copy link

trying to setup a @reboot script to start trunk-recorder in one tty session and also start radio-scanner in another tty session since both need to run simultaneously. here is the script I have but seems both try to run in the initial tty window and the rdio-scanner will only run after the trunk-recorder is killed.

 #!/bin/bash

date >> date.txt

setsid sh -c 'exec commmand <> /dev/tty2 >&0 2>&1'
/home/pi/trunk-build/trunk-recorder --config /home/pi/trunk-build/config.json

#openvt -c 2

setsid sh -c 'exec commmand <> /dev/tty3 >&0 2>&1'
/home/pi/trunk-build/rdio-scanner/rdio-scanner
 
@hsoj
Copy link

hsoj commented Apr 10, 2024

While I have not dug into the pipe transitions here, just based on the process order of operations, you might need to background the processes if the desire isn't to hold them open from this script.

@jeffbarclay
Copy link
Author

The problem is both scripts need to run at the same time. This configuration only fires the trunk-recorder and not the Rdio-scanner until after the trunk-recorder is killed

@jeffbarclay
Copy link
Author

tmux appears to be a way around this but I'm not sure how to script that?

@hsoj
Copy link

hsoj commented Apr 10, 2024

If you're asking about a headless system on an RPI, I'm assuming it's running systemd.

Have you set these up to not run behind systemd? How have you set these up to run initially?

Edit: Without digging into the system structure it self, you could probably slap a & at the end of the command calls in that script to accomplish what you're after; however, do note this might present additional issues depending on how the system is setup.

Example:

 #!/bin/bash

date >> date.txt

setsid sh -c 'exec commmand <> /dev/tty2 >&0 2>&1'
/home/pi/trunk-build/trunk-recorder --config /home/pi/trunk-build/config.json &

#openvt -c 2

setsid sh -c 'exec commmand <> /dev/tty3 >&0 2>&1'
/home/pi/trunk-build/rdio-scanner/rdio-scanner &

@jeffbarclay
Copy link
Author

jeffbarclay commented Apr 11, 2024 via email

@Dewey3
Copy link

Dewey3 commented Apr 11, 2024

If it helps, just set Rdio-Scanner as a service. That way, Rdio-Scanner will always start on reboot and your can set up a @reboot crontab to start TrunkRecorder on every reboot. My @reboot crontab for my headless RPis point to a script containing the following text:

#!/bin/sh

sleep 1m

cd /home/truser/trunk-build
/home/truser/trunk-build/trunk-recorder --config={configuration file name}.json

-or-
You can just start your tmux session and manually start TrunkRecorder then "detach" since Rdio-Scanner will already be running as a service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants