×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Re:how to automatically restart kstar after a crash

  • Posts: 23
  • Thank you received: 2
Hi,

I experience some kstars crash one night every too.
I would like to restart it automatically when it crashes.
For this I have a process that tests the kstar process and that is able to relaunch it when it deseapears.
I would like to know if there is a proper commend line to relauch kstars and activate the scheduler in order to restart from where it was before the crash.

Thanks for your help!!
5 years 2 weeks ago #36379

Please Log in or Create an account to join the conversation.

  • Posts: 1309
  • Thank you received: 226
I don't know if one. It's a good idea. I think it would be a great feature to add. I know when KStars crashes the indi drivers are usually still running. It would be great if an auxiliary watchdog driver could respond to a crash by opening kstars back up and link ekos back to the still running drivers.
The following user(s) said Thank You: Ron Kramer
5 years 2 weeks ago #36488

Please Log in or Create an account to join the conversation.

  • Posts: 1029
  • Thank you received: 301
Having a driver doing this is probably not feasible. I know Jasem ultimately wants the scheduler to be an independent process, but what we could do right now is to store the state of the scheduler and continue right where we stopped. Restarting kstars should be left to a script at the user side ( while true ; do kstars ; done). But of course it would be better if kstars did not crash at all.

-Eric
The following user(s) said Thank You: Derek, Craig
5 years 1 week ago #36573

Please Log in or Create an account to join the conversation.

  • Posts: 328
  • Thank you received: 53
Yes when I restart - it says the server is running KILL before restarting? (I said no and it crashed) I now say yes. So why not just have it accept "Y" as default ? else hit "N" in 6 seconds?
AP Mach1 / CP4 APCC & PEMpro.
EXP SCI - ED152cf APO - Celestron 11" RASA - Stellarvue 80mm
Baader F2 HS NB filters, Lodestar X2 guide camera / OAG - ZWO 290mm mini
ZWO ASI1600MM Pro / ASI174M (solar) / ASI094MC
NEXDome, CLoudwatcher, AVX mount/ASIair and Stellarmate

5 years 1 week ago #36581

Please Log in or Create an account to join the conversation.

  • Posts: 23
  • Thank you received: 2
I finally wrote 2 script to sove this issue:
The fisrt scrip is lauchin kstar and them enter in a loop test to see if kstar is still alive. If it is not I send an email and I restart kastar using the second script.
The second script is based on xdotool that allows to automate mouse click relative to windows: with this one I relauche Ekos, reload the scheduled file (with is always named the same) and restart the scheduler.
Here are the 2 scripts:
1) First script
#!/bin/bash
kstars&
sleep 30
while true; do
ps h -C kstars>/dev/null
status=$?
if test $status -eq 1
then
echo "kstars just crashed" | mail -s "kstars" This email address is being protected from spambots. You need JavaScript enabled to view it.
~/xdoscriptall
fi
sleep 120;done
2) Second script
#!/bin/bash
kstars&
sleep 30
Kstars=`xwininfo -name "KStars" -int|grep "Window id"|cut -c22-30`
Astuce=`xwininfo -name "Astuce du jour — KStars" -int|grep "Window id"|cut -c22-30`
xdotool windowactivate $Astuce mousemove --window $Astuce 518 300 click 1 sleep 2
xdotool windowactivate $Kstars mousemove --window $Kstars 919 45 click 1 sleep 10
Ekos=`xwininfo -name "Ekos — KStars" -int|grep "Window id"|cut -c22-30`
xdotool windowactivate $Ekos mousemove --window $Ekos 1055 109 click 1 sleep 20
xdotool windowactivate $Ekos sleep 10 mousemove --window $Ekos 116 34 click 1 sleep 10
xdotool windowactivate $Ekos mousemove --window $Ekos 1476 105 click 1 sleep 10 type "/media/Astro/tst.esl"
Open=`xwininfo -name "Open Ekos Scheduler List" -int|grep "Window id"|cut -c22-30`
xdotool windowactivate $Open mousemove --window $Open 775 600 click 1 sleep 5
xdotool windowactivate $Ekos mousemove --window $Ekos 650 615 click 1 sleep 5
The following user(s) said Thank You: Eric, Bill Hogoboom
4 years 11 months ago #37173

Please Log in or Create an account to join the conversation.

  • Posts: 23
  • Thank you received: 1
This is very cool. I had no idea that xdotool existed. It's going to be useful in a lot a places.
AT8RC Astrograph on CGX mount
ASI-071 C camera or
Pentax K3ii DSLR
60mm Orion guide scope w/QHY5II camera
Feather Touch 2" focuser w/ Focus Lynx auto focus
PPB Power Center, GPS, Temp/Humidity Sensor
7 port powered USB hub to HP Laptop over 30' powered USB cable
KStars / EKOS
4 years 11 months ago #37211

Please Log in or Create an account to join the conversation.

Time to create page: 0.620 seconds