[nos-bbs] Start script with auto restart loop

Jay Nugent jjn at nuge.com
Thu Mar 5 13:13:33 EST 2020


Greetings,


On Thu, 5 Mar 2020, Jay Nugent wrote:

> Greetings,
>
> On Thu, 5 Mar 2020, K3CHB wrote:
>
>>  I am using JNOS in a screen session over here and would like to add a
>>  restart provision to my startnos script.
>>
>>  Has anyone come up with a good solution for screen instances of jnos?
>
>
>    My STARTNOS Bash script launches the JNOS executable under screen. Then 
> to start everything up I log into the local or remote box and issue the 
> command:   cd /jnos ; ./startnos ; screen -r


    Here is my STARTNOS script:


#!/bin/bash
#
# /jnos/startnos
#
logger "JNOS startnos script started"
cd /jnos
rm -f /jnos/spool/mqueue/*.lck 2> /dev/null
rm -f /jnos/spool/mail/*.lck 2> /dev/null
#
export TZ=EST5EDT
export TERM=linux
#
# Actually start jnos 
logger "JNOS is being started"
exec screen -d -m  ./jnos -d /jnos -f /jnos/nos.cfg 2>&1
#
logger "JNOS has exited"
#
# 
# --- end ---
#


       --- Jay  WB8TKL












>
>   To can detach my session:   Control-A D
>
>   Can then log in from another machine and do a 'screen -r'
>
>
>   I don't yet have a way to shut down or restart JNOS other than to 'exit' 
> from the JNOS> prompt or kill the jnos process.
>
>   I do have some deployments of JNOS at remote sites that use 'systemd' to 
> auto-start JNOS after a crash or a Linux reboot.
>
>
>      --- Jay  WB8TKL
>
>
> _______________________________________________
> nos-bbs mailing list
> nos-bbs at lists.tapr.org
> http://lists.tapr.org/mailman/listinfo/nos-bbs_lists.tapr.org
>

-- 

         () ascii ribbon campaign in
         /\ support of plain text e-mail

  o Averaging at least 3 days of MTBWTF!?!?!?
  o The solution for long term Internet growth is IPv6.
+------------------------------------------------------------------------+
| Jay Nugent   jjn at nuge.com    (734)484-5105    (734)649-0850/Cell       |
|   Nugent Telecommunications  [www.nuge.com]                            |
|   Internet Consulting/Linux SysAdmin/Engineering & Design              |
|   ISP Monitoring [www.ispmonitor.org] ISP Performance Monitoring       |
+------------------------------------------------------------------------+
13:01:01 up 218 days, 21:21, 4 users, load average: 0.49, 0.28, 0.21



More information about the nos-bbs mailing list