mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Linux (https://www.mersenneforum.org/forumdisplay.php?f=39)
-   -   Run CADO automatically on boot. (https://www.mersenneforum.org/showthread.php?t=24496)

lukerichards 2019-06-07 15:06

Run CADO automatically on boot.
 
Any suggestions?

Following on from my thread on autostarting pre-emptible VM instances in Google Cloud, the next job is getting Cado to run successfully on boot and on this I don't know where to start.

EdH 2019-06-07 16:02

I use script files on my linux machines, that are invoked via Startup. I suppose Windows could do the same with .bat files.

chris2be8 2019-06-07 16:24

What OS do they run?

If Linux you could set up an @reboot entry in your ID's crontab to run a script whenever the system is booted up.

Or the script that boots up the instance could wait until it's up (eg ping it every few seconds until it's up), then ssh onto it to start cado.

Chris

paulunderwood 2019-06-07 16:38

Just to echo what others are saying: Run [C]crontab -e[/C] and enter on a line [Code]@reboot cd /path/to/cado; ./cado whatever &[/Code]. Save the file. To see what you have in your cron table use [C]crontab -l[/C]. HTH.

EdH 2019-06-07 17:20

I haven't used crontab in a long while for anything. (I should probably refamiliarize myself.) I've been using the GUI Startup method. Is there an advantage to using crontab instead?

paulunderwood 2019-06-07 17:39

[QUOTE=EdH;518812]I haven't used crontab in a long while for anything. (I should probably refamiliarize myself.) I've been using the GUI Startup method. Is there an advantage to using crontab instead?[/QUOTE]

Unless you have automatic desktop login, it would not start until you login to the desktop. "cron" will start it on boot regardless. This is useful for server machines (running headless).

EdH 2019-06-08 02:55

[QUOTE=paulunderwood;518813]Unless you have automatic desktop login, it would not start until you login to the desktop. "cron" will start it on boot regardless. This is useful for server machines (running headless).[/QUOTE]
Ah, yes. I had forgotten the login necessity. Although I am running headless, the machines do engage an auto-login* and I access them both via ssh/vnc and ssh direct.

*My Debian machines no longer allow me to login to a GUI environment at all since the last upgrade. I am now limited in some of the things I can do with them. For a specific, I can no longer run Primo on them.

Thanks for the info.

paulunderwood 2019-06-08 03:21

[QUOTE=EdH;518836]Ah, yes. I had forgotten the login necessity. Although I am running headless, the machines do engage an auto-login* and I access them both via ssh/vnc and ssh direct.

*My Debian machines no longer allow me to login to a GUI environment at all since the last upgrade. I am now limited in some of the things I can do with them. For a specific, I can no longer run Primo on them.

Thanks for the info.[/QUOTE]

Is X broken on the Debian machines? I don't suppose [C]ssh -X xxx.xxx.xxx.xxx[/C] allows you to run X applications? If you have the time try [C]apt-get install --reinstall gnome[/C] or whatever desktop environment you were using.

If you need to purge the configuration files instead try [C]apt-get purge gnome && sudo apt-get install gnome[/C].

EdH 2019-06-08 15:54

[QUOTE=paulunderwood;518837]Is X broken on the Debian machines? I don't suppose [C]ssh -X xxx.xxx.xxx.xxx[/C] allows you to run X applications? If you have the time try [C]apt-get install --reinstall gnome[/C] or whatever desktop environment you were using.

If you need to purge the configuration files instead try [C]apt-get purge gnome && sudo apt-get install gnome[/C].[/QUOTE]
(I'm afraid I've diverted this thread - sorry.)


Thank you for the help. I did try the reinstall - more later. I tried changing to lightdm on one of the machines a while back and that made it worse. On the other, I can still get a VNC connection (via ssh), but what appears to be happening, is that the user is logged in and immediately taken to a locked background. There is something acting like a stuck key that disallows any unlock attempt. Any actual keystroke is quickly removed and the message "Authentication error" is continuously displayed. This happened identically on both machines when I upgraded them to jessie.

paulunderwood 2019-06-08 17:56

[QUOTE=EdH;518870](I'm afraid I've diverted this thread - sorry.)


Thank you for the help. I did try the reinstall - more later. I tried changing to lightdm on one of the machines a while back and that made it worse. On the other, I can still get a VNC connection (via ssh), but what appears to be happening, is that the user is logged in and immediately taken to a locked background. There is something acting like a stuck key that disallows any unlock attempt. Any actual keystroke is quickly removed and the message "Authentication error" is continuously displayed. This happened identically on both machines when I upgraded them to jessie.[/QUOTE]

Have you tried creating a new user on the problematic Debian boxes? Can you log in with this new account? It might be that there is some "." file in the users' home directories preventing old users logging in. I have had problems with .Xauthority files in the past.

lukerichards 2019-06-10 07:01

And we have liftoff!

Non-pre-emptible micro instance costing $4 a month with a script which pings an eight-core pre-emptible instance every 5 minutes and, if receives no reply, assumes it is down and restarts it.

Pre-emptible instance then boots and runs CADO from crontab.

VBCurtis 2019-06-10 15:33

Excellent! :tu:
More production, less cash, and we all learned something.


All times are UTC. The time now is 08:17.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.