problem with auto start jatos on server
Hi
I maneged to start jatos manually on AWS
but when I try creating the script for auto start jatos it fails
this is the script:
[unit]
Description=JATOS
After=network-online.target
# If you use JATOS with an MySQL database use
#After=network-online.target mysql.service
[Service]
PIDFile=/jatos_linux_java/RUNNING_PID
User=admin
ExecStart=/jatos_linux_java/loader.sh start
ExecStop=/bin/kill $MAINPID
ExecStopPost=/bin/rm -f /jatos_linux_java/RUNNING_PID
ExecRestart=/bin/kill $MAINPID
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
thank you for your help
Dror

Comments
Hi Dror,
Try without the line
ExecRestart=/bin/kill $MAINPID- apparently it's not supported by systemd anymore and also not necessary. And if this doesn't help we'd need more information: What did you try so far? What is the error msg? What is your system?Best,
Kristian
hi
Im running ubuntu 18.4 on aws
I managed to install jstos and run it manually
first I got error 203 user - I changed the user to ubuntu (is it ok?)
then I started the auto-start and checked the status and I got this error massege:
-----------------------------------------------------------------
● jatos.service - JATOS
Loaded: loaded (/etc/systemd/system/jatos.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2020-06-07 21:53:42 UTC; 4s ago
Process: 7214 ExecStopPost=/bin/rm -f /jatos/RUNNING_PID (code=exited, status=0/SUCCESS)
Process: 7213 ExecStart=/jatos/loader.sh start (code=exited, status=203/EXEC)
Main PID: 7213 (code=exited, status=203/EXEC)
Jun 07 21:53:42 ip-172-31-17-88 systemd[7213]: jatos.service: Failed at step EXEC spawning /jatos/loader.sh: No such file or directory
Jun 07 21:53:42 ip-172-31-17-88 systemd[1]: jatos.service: Main process exited, code=exited, status=203/EXEC
Jun 07 21:53:42 ip-172-31-17-88 systemd[1]: jatos.service: Failed with result 'exit-code'.
ubuntu@ip-172-31-17-88:~$
----------------------------------------------------------------
I understand that the problem is with the ExecStart line but I cant figure what is the problem
this is my script:
_________________________________
[Unit]
Description=JATOS
After=network-online.target
# If you use JATOS with an MySQL database use
#After=network-online.target mysql.service
[Service]
PIDFile=/jatos/RUNNING_PID
User=ubuntu
ExecStart=/jatos/loader.sh start
ExecStop=/bin/kill $MAINPID
ExecStopPost=/bin/rm -f /jatos/RUNNING_PID
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
_______________________________________
thank you
Dror
Hi!
This line of your logging seems to explain your problem:
Jun 07 21:53:42 ip-172-31-17-88 systemd[7213]: jatos.service: Failed at step EXEC spawning /jatos/loader.sh: No such file or directory
Somehow the path to the loader.sh seems to be wrong. Is your JATOS installed in /jatos/?
Best,
Kristian
hi
thanks
dror
Hi dror,
Looks like you installed JATOS in a folder 'jatos' within your user's home folder. Since your user is called 'ubuntu' I guess the path to your JATOS folder is '/home/ubuntu/jatos'. But you can check that by typing 'pwd' while being in your 'jatos' folder.
Best,
Kristian
worked like a charm
I also had to change the user to root and give rw permission to loader.log
thank you very much
kristian