comment lancer le jar en demon ?
bonjour j'ai 2 jar à lancé au démarrage du serveur (ou une fois lancé avec la console).
je tente d'utiliser systemct.
voici ce que j'ai tenté comme création de fichier:
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
cat /etc/systemd/system/springboot.service
[Unit]
Description=MyApplication web interface
After=syslog.target
[Service]
SyslogIdentifier=MyBoot
ExecStart=/bin/bash -c "java -jar /root/dao_mongo.jar"
User=root
Type=simple
[Install]
WantedBy=multi-user.target |
Code:
1 2 3 4 5 6 7 8 9
|
systemctl start springboot.service
Failed to start springboot.service: Unit springboot.service has a bad unit file setting.
See system logs and 'systemctl status springboot.service' for details.
~# systemctl status springboot.service
● springboot.service - MyApplication web interface
Loaded: bad-setting (Reason: Unit springboot.service has a bad unit file setting.)
Active: failed (Result: exit-code) since Tue 2019-11-12 12:28:53 CET; 1min 1s ago
Main PID: 13598 (code=exited, status=203/EXEC) |
Code:
1 2 3 4 5 6 7
|
Nov 12 12:28:53 vps75144 systemd[1]: Started MyApplication web interface.
Nov 12 12:28:53 vps75144 systemd[13598]: springboot.service: Failed to execute command: Exec format error
Nov 12 12:28:53 vps75144 systemd[13598]: springboot.service: Failed at step EXEC spawning /root/dao_mongo.jar: Exec format error
Nov 12 12:28:53 vps75144 systemd[1]: springboot.service: Main process exited, code=exited, status=203/EXEC
Nov 12 12:28:53 vps75144 systemd[1]: springboot.service: Failed with result 'exit-code'.
Nov 12 12:29:30 vps75144 systemd[1]: /etc/systemd/system/springboot.service:6: Executable path specifies a directory: /bin/bash/ |
comment faut t'il précéder ?
mon fichier est t'il correcte ?
faut t'il installer des choses ?
je suis sous une debian 10
j'ai lancer le jar tout seul et il fonctionne bien
merci de vos réponse