I need to run a 24 by 7 batch program. On power failures I already configured Ubuntu Server 14.04 to power up as soon as energy is back, auto login and start the program.
The process is based on GPU power and get better results with overclock. I was able to do it configuring xorg.conf and executing xinit. When I do that, the screen go white and the command line disapear. I used a remote SSH client to execute "overclock.sh" and start the program and it worked.
My question is that as I won't be able to use the remote client every time, how can I execute others scripts after executing xinit?
CRTL+ALT+F1 return to command line, but how use that on startup script?
I would like to execute on startup: - xinit; - overclock.sh; - start_program.sh;
Update 08/27/2017: Right now, I'm understanding more what is happening:
I'm in the console environment tty1.
When run "xinit" it open a rough screen on tty7.
By pressing CRTL+ALT+F1 I go back to terminal tty1 but is stucked on the "xinit" command. That is why, the .bash-login script don't execute any other command after.
By pressing CTRL+C it stops the tty7 environment and the overclocked don't work.
Now the most strange part: If I press CTRL+Z, I return the control, the overclock works, but when I run the program, only GPU0 start to work.
Also tried "setsid xinit &> /dev/null" and again, everything seens perfect, but only GPU0 work.
7 Another approach: in the rough screen, tty7, I click with the mouse on the upper command line, type overclock.sh and it works. All 8 gpus work nicely. This seems to be more closely to be the answer.
How can I make a batch file to execute commands soon as the tty7 go up?
Update 08/28/2017:
I solved. The magic was study the xterm called from xinit. It receive the parameter -e "command". Put the script as command.
xinit
in a script, so I don't see why you should not be able to put it in yourcrontab
. I suggest you write a startup script that starts the scripts in your preferred order and add that to yourcrontab
. – dessert Aug 24 '17 at 07:39cron
knows when it's just restarted and doesn't execute the@reboot
commands then. – dessert Aug 26 '17 at 20:37