[nos-bbs] how to launch JNOS from cron or python

Sky sky at aa6ax.us
Tue Oct 19 21:37:32 EDT 2021


Precisely! Thank you.

I've never used 'screen' before, and had to install it, and I am finding is hard to decipher the command-line switches/args.

I launch with this command within the systemd script...

screen -S jnos -Dm /jnos/startnos

...which works fine and launches my JNOS as a service. It runs fine and does everything it's supposed to. That was goal #1.

However, I don't know the switches to connect to the process via screens later on. I will continue reading the dox, but if you know this just right off the top of your head, it might save some time here. Do not go spend a lot of time yourself -- I should be able to read if I absolutely have to.

—Sky



> On Oct 18, 2021, at 2:59 PM, debiani386 via nos-bbs <nos-bbs at lists.tapr.org> wrote:
> 
> My solution was to create a systemd script which launches JNOS in screen (as the JNOS system is remote and I am not the only one who monitors the JNOS console remotely).
> 
> This is what I have, you can change it as needed:
> 
> [Unit]
> Description=Jnos
> After=network.target
> 
> [Service]
> Type=simple
> User=root
> WorkingDirectory=/home/jnos/jnos
> ExecStart=/usr/bin/screen -S JNOS -Dm /home/jnos/jnos/jnos
> ExecStop=/usr/bin/kill jnos
> 
> [Install]
> WantedBy=multi-user.target
> 
> HTH and 73, de KG7UJH
> Christopher Kelley
> 
> Sent with ProtonMail <https://protonmail.com/> Secure Email.
> 
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Monday, October 18th, 2021 at 2:54 PM, Andrew Pepper <anpepper at gmail.com> wrote:
>> I followed the raspberry pi3 how-to on this site. To automatically start jnos on say tty7 and if the machine is restarted everything fires back up.
>> Those instructions should work for any debian based systems.
>> http://server1.nuge.com/~drg/jnos.html <http://server1.nuge.com/~drg/jnos.html>
>> 
>> Andrew, K1YMI
>> 
>> On Mon, Oct 18, 2021, 17:30 Sky via nos-bbs <nos-bbs at lists.tapr.org <mailto:nos-bbs at lists.tapr.org>> wrote:
>> Gosh, I should know this stuff, but I got deep into it and so far no solution, so let me ask if others have soled this problem already.
>> 
>> I want to automatically launch JNOS after a power failure.
>> 
>> At the moment I do this by going to the computer and bringing up Terminal and then launching JNOS in that session and I just leave it open. Works great until the power fails. If I am away or out of town, JNOS won't run again until I notice the failure and fire up the display and keyboard. (I do have an automated cron that notices the failure and emails me, but it can be several hours before I notice, and as I said, I may be out of town.)
>> 
>> So from crontab preferably I would like to launch JNOS and let it run indefinitely. But also I'd like to do it from Python because that's what I'm using as my base for writing additional JNOS support.
>> 
>> I know how to detect whether it is running already and all of that and then try to launch it if not already running, what I can't get is how to launch JNOS without Terminal. Meaning there is no 'environment' for it to run in. If I do that, it launches but immediately just exits. Nothing in syslog that I can find to help me know. I presume I have to have cron launch JNOS with some kind of environment specified, but so far I can't figure that out.
>> 
>> 
>> If someone has already solved this, I would prefer to know your solution, not necessarily to debug mine.
>> 
>> I'm not going to put the code here because you will be tempted to try to debug it. Just suffice it to say it does launch the process, gets a PID in return, but that process will exit without actually completing the JNOS launch. And I presume this is because JNOS needs an 'environment' to run in and cannot run by itself.
>> 
>> —Sky
>> 
>> 
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> "Sky" (Jim Schuyler)
>> —Amateur Radio AA6AX
>> Online at aa6ax.us <https://aa6ax.us/> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> nos-bbs mailing list
>> nos-bbs at lists.tapr.org <mailto:nos-bbs at lists.tapr.org>
>> http://lists.tapr.org/mailman/listinfo/nos-bbs_lists.tapr.org <http://lists.tapr.org/mailman/listinfo/nos-bbs_lists.tapr.org>
> 
> _______________________________________________
> nos-bbs mailing list
> nos-bbs at lists.tapr.org
> http://lists.tapr.org/mailman/listinfo/nos-bbs_lists.tapr.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.tapr.org/pipermail/nos-bbs_lists.tapr.org/attachments/20211019/c1a3c59c/attachment.html>


More information about the nos-bbs mailing list