×

INDI Library v1.7.9 Released (23 Jun 2019)

INDI Library v1.7.9 is mostly a maintenance release to fix a few bugs in several drivers.

Re:how to automatically restart kstar after a crash

  • Posts: 16
  • Thank you received: 2

how to automatically restart kstar after a crash was created by deruazpepin

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!!
3 months 2 weeks ago #36379

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

  • Posts: 531
  • Karma: 1
  • Thank you received: 94

Replied by Ihoujin on topic how to automatically restart kstar after a crash

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.
INDI/KStars on Raspberry Pi 3B+
Lubuntu 16.04
Skywatcher HEQ5 Pro Mount
Canon 600D Camera
Orion SSAG @280mm Guide Scope
PHD2
Adafruit Motor Hat shield
Adafruit GPS Module
Generic Bluetooth Joystick.
Startech 7 port powered USB Hub.
The following user(s) said Thank You: Ron Kramer
3 months 1 week ago #36488

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

  • Posts: 704
  • Karma: 13
  • Thank you received: 216

Replied by TallFurryMan on topic Re:how to automatically restart kstar after a crash

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
HEQ5-Pro - Atik 314E - Orion ED80T - DMK21 on Orion 50mm
DIY 3D-printed Moonlite and FWheel RGB/LPR
KStars and indiserver on two Atom 1.6GHz 1GB RAM Linux, VPN remote access
The following user(s) said Thank You: dokeeffe, pug916
3 months 1 week ago #36573

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

  • Posts: 326
  • Thank you received: 50

Replied by Ron Kramer on topic Re:how to automatically restart kstar after a crash

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

3 months 1 week ago #36581

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

  • Posts: 16
  • Thank you received: 2

Replied by deruazpepin on topic Re:how to automatically restart kstar after a crash

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: TallFurryMan, Viejo
2 months 3 weeks ago #37173

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

  • Posts: 20
  • Thank you received: 1

Replied by Viejo on topic Re:how to automatically restart kstar after a crash

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
2 months 3 weeks ago #37211

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

Time to create page: 0.497 seconds