
表題の通りで、
jarを指定ディレクトリに配置後
serviceを新規に作成、startさせましたが
こういうエラーが出ました。引数が間違ってるみたいですが、知見が浅く
何が間違ってるかわかりません。
tomcat9.service↓
Description = tomcat9 Type = simple ExecStart = /home/centos/app/test.jar RemainAfterExit = yes User = centos Group = centos Restart = always WantedBy = multi-user.target ~
エラーメッセージ
Failed to restart tomcat9.service: Unit is not loaded properly: Invalid argument. See system logs and 'systemctl status tomcat9.service' for details.
よろしくお願いいたします。
補足
ファイルの権限は777で確認しました。
shawさんのアドバイスの元追記しました。[Service]とかのキーワードもいるみたいですね。
変更後tomcat9.service
[Unit] Description = test [Service] ExecStart = /home/centos/app/test.jar Restart = always Type = simple User = centos Group = centos SuccessExitStatus = 143 [Install] WantedBy = multi-user.target
sudo systemctl daemon-reload
sudo systemctl restart tomcat9→エラーメッセージでなくなりました
でもステータスはアクティブじゃない。。。泣き
sudo systemctl status tomcat9
● tomcat9.service - test Loaded: loaded (/usr/lib/systemd/system/tomcat9.service; disabled; vendor preset: disabled) Active: failed (Result: start-limit) since Sun 2019-06-16 15:07:52 UTC; 26min ago Process: 2114 ExecStart=/home/centos/app/test.jar (code=exited, status=203/EXEC) Main PID: 2114 (code=exited, status=203/EXEC)
build.gradle(特に変更してない)
plugins { id 'org.springframework.boot' version '2.1.5.RELEASE' id 'java' } apply plugin: 'io.spring.dependency-management' group = 'com.example' version = '0.0.1-SNAPSHOT' sourceCompatibility = '11' configurations { developmentOnly runtimeClasspath { extendsFrom developmentOnly } } repositories { mavenCentral() } dependencies { implementation 'org.springframework.boot:spring-boot-starter-data-rest' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-web' developmentOnly 'org.springframework.boot:spring-boot-devtools' testImplementation 'org.springframework.boot:spring-boot-starter-test' }
ローカルでのspringboot起動...〇
java -jar test.jar...〇(ただしブラウザからポート8080で応答帰ってこなかった)
apache起動確認...〇
ポート8080解放確認...〇
apacheとtomcatの連携...未(必要なのかわかってない)
もしかしたら前提条件たりてないのでしょうか。。
Linuxむっずいよお。

