On a small server, I would like to launch a selenium webdriver and a python script which will use the selenium webdriver consecutively at boot, without waiting the end of the other (of course).
I therefore added the following lines to my /etc/anacrontab
:
@daily 1 webdriver java -jar ~/selenium-server-standalone-3.4.0.jar &
@daily 2 wifi_manager ~/script.py &
By doing this, the two processes are however terminated:
Jun 24 01:09:51 david anacron[441]: Job `webdriver' started
Jun 24 01:09:51 david anacron[441]: Job `webdriver' terminated
Jun 24 01:10:51 david anacron[441]: Job `wifi_manager' started
Jun 24 01:10:51 david anacron[441]: Job `wifi_manager' terminated
How should I start them, in order to have them running permanently?
EDIT: I now have:
@daily 1 wifi_manager bash -c '$dir/start_driver.sh & (sleep 30 && $dir/dis-enable_wifi.py) &'
But I still get:
Jun 24 14:02:56 david anacron[444]: Job wifi_manager' started
Jun 24 14:02:56 david anacron[444]: Job
wifi_manager' terminated
The start_driver.sh
consists in:
cd $dir # needed in order to have log saved there...
nohup java -jar selenium-server-standalone-3.4.0.jar &
Basically, I have to start the selenium webdriver, wait until it is ready and then run the python script for the whole day.
If I run the command I put in the anacrontab from terminal it just works fine.
Consider starting a shell and running those scripts in background, something like