×

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

Bi-monthly release with minor bug fixes and improvements

System shutdown check box in the scheduler

  • Posts: 1
  • Thank you received: 0
Good evening, I want to know if someone need a "system shutdown after work" check box in the scheduler ? Is it hard work to do in Ekos development ?

Regards

Hugues MAILLET
5 years 10 months ago #26057

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

  • Posts: 1029
  • Thank you received: 301
You may achieve this feature with the "shutdown script" editbox. The intent of this box is to allow execution of arbitrary commands when the scheduler stops.

-Eric
The following user(s) said Thank You: Jasem Mutlaq, Sébastien, gehelem, Jim
5 years 10 months ago #26173

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

  • Posts: 456
  • Thank you received: 76
Yes, as Eric says, shutdown script is the way to go.
Have a look at the last line of my shutdown script here github.com/dokeeffe/bh-observatory/blob/...schedulerShutdown.sh
The following user(s) said Thank You: gehelem
5 years 10 months ago #26228

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

  • Posts: 167
  • Thank you received: 54
Hi
Just to understand : where does this script runs ?
I mean in case of a remote server, is it able to shutdown the remote machine ?
(Hugues and I and other are trying to shutdown cleanely our RPi/Tinkerboard/... at the end of session, without ssh)
Gilles.
5 years 10 months ago #26233

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

  • Posts: 456
  • Thank you received: 76
Ahh yes I understand now. That script runs on the machine thats running kstars & EKOS. For me this is the same PC thats running the INDI server.
Without ssh then I'm not sure how you could shutdown the remote server. Maybe a cron job or something to check if any indi clients connected, and if not then shutdown?
5 years 10 months ago #26236

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

You could also use INDI Watchdog driver with custom script on the remote host.
5 years 10 months ago #26237

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

  • Posts: 167
  • Thank you received: 54
Thank you Jasem, good idea
I will try that
5 years 10 months ago #26238

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

  • Posts: 1029
  • Thank you received: 301
On my side I could not have the watchdog driver properly protect the remote installation, but I didn't involve much effort in that yet. I'd be glad if you could share information about your own configuration.

-Eric
5 years 10 months ago #26241

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

  • Posts: 421
  • Thank you received: 102
Just curios, but why no ssh? If you have an ssh server running on the Pi, then you can specify the command to run on the command line to the ssh client. Something like this would be in your shutdown script:

ssh -l pi raspberrypi sudo shutdown -h now

Of course, there would be two prerequisites to get this to work. Configure sudo to allow shutdown to run without prompting for password, and use public/private key authentication for ssh, so ssh doesn't prompt for a password.

If you're on Windows, the Putty package has a command line client called plink that can be used in place of the ssh command above. The arguments are a little different, though.
5 years 9 months ago #26277

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

  • Posts: 1029
  • Thank you received: 301
Indeed ssh is a viable solution. Idea was that both the shutdown script on Ekos side and the Watchdog script on INDI Remote side were fit for the job.

I'd suggest against sudo though, prefer adding your ssh user to a group that is authorized to shutdown the remote computer.

-Eric
5 years 9 months ago #26279

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

  • Posts: 167
  • Thank you received: 54
Well, of course...
This question is also to take care of end user, some of them don't like our geek command line, as they say :)
5 years 9 months ago #26280

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

  • Posts: 1029
  • Thank you received: 301
Ah yes, agreed. But in that case, I assume the setup would be different, and include an all-in-one remote server that itself provides this capability out-of-the box, and documentation to use it.

Should we default the scheduler to use example startup and shutdown scripts, with commented out features showing how to implement things in various situations?

-Eric
5 years 9 months ago #26281

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

Time to create page: 0.609 seconds