crontab -e
@reboot nohup /var/www/project/data/www/project/jdk-14.0.1/bin/java -jar /var/www/project/data/www/project/result.jar > nohup.out &
startup.sh: command not found
Thanks. What is rights of this home/user folder ?I store the file inside home
Not sure but if you are logged in as root then should be no issue with access rights.Thanks. What is rights of this home/user folder ?
I re-installed the server, installed FTP, created a user, connected by FTP, but files are not saved into /home/user...
#!/bin/bash
cd /home/b4j/app1
nohup /usr/bin/java -jar app1.jar > app1.out &
cd /home/b4j/app2
nohup /usr/bin/java -jar app2.jar > app2.out &
cd /home/b4j/app3
nohup /usr/bin/java -jar app3.jar > app3.out &
Just for ref: strange, but i still cannot use Bash script, always error "command not found"using a script
by the way, if you are not using crontab but to manuallly run, then I think the command is :startup.sh: command not found
$ sh startup.sh
$ ./startup.sh
Yes, it works, but again strange that 2 instances of Java (excepting auto-java process), after run the .sh script:$ sh startup.sh
I don't know how you write handler(webserver). that 2 instances are child processes forked by result.jar(pid is 25886, ppid is 1) you can see pid and ppid, usually, that's because there are clients connected to the webserver.Yes, it works, but again strange that 2 instances of Java (excepting auto-java process), after run the .sh script:
View attachment 133553
If to kill any of these processes - all are killed.
Yes, as long as you're ok of not using systemd commands to control (start / stop / restart / etc) the individual instances.but using a script, I can run multiple instances
[Unit]
Description=sc4 Service
After=network.target
[Service]
Type=simple
WorkingDirectory=/home/vlad/web/scat.team
ExecStart=/home/vlad/web/scat.team/jdk-14.0.1/bin/java -jar /home/vlad/web/scat.team/result.jar
SuccessExitStatus=143
Restart=on-abort
[Install]
WantedBy=multi-user.target
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?