実現したいこと
tomcat の再起動をしたいのですが、catalina.out: Permission denied となり再起動ができません。
catalina.out の所有者はroot で、tomcat.service 内でのUser がtomcat だからでしょうか?
前提
ユーザー:root で下記コマンドを入力しました
発生している問題・エラーメッセージ
エラーメッセージ
Job for tomcat.service failed because the control process exited with error code. See "systemctl status tomcat.service" and "journalctl -xe" for details.
/var/log の中のmessage を見てみると
【message】
Jun 29 12:54:44 d3k9wdcc73 systemd: Starting Apache Tomcat 8.0.53...
Jun 29 12:54:44 d3k9wdcc73 startup.sh: touch: cannot touch ‘/usr/local/java/apache-tomcat-8.0.53/logs/catalina.out’: Permission denied
Jun 29 12:54:44 d3k9wdcc73 startup.sh: /usr/local/java/apache-tomcat-8.0.53/bin/catalina.sh: line 457: /usr/local/java/apache-tomcat-8.0.53/logs/catalina.out: Permission denied
Jun 29 12:54:44 d3k9wdcc73 systemd: tomcat.service: main process exited, code=exited, status=1/FAILURE
Jun 29 12:54:44 d3k9wdcc73 systemd: Failed to start Apache Tomcat 8.0.53.
Jun 29 12:54:44 d3k9wdcc73 systemd: Unit tomcat.service entered failed state.
Jun 29 12:54:44 d3k9wdcc73 systemd: tomcat.service failed.
該当のソースコード
【tomcat.service】
[Unit]
Description=Apache Tomcat 8.0.53
After=network.target
[Service]
User=tomcat
Group=tomcat
Type=oneshot
Environment=JAVA_HOME=/usr/local/java/
Environment=CATALINA_PID=/usr/local/java/apache-tomcat-8.0.53/temp/tomcat.pid
Environment=CATALINA_HOME=/usr/local/java/apache-tomcat-8.0.53
Environment=CATALINA_BASE=/usr/local/java/apache-tomcat-8.0.53
Environment='CATALINA_OPTS=-server -Xms4000M -Xmx8000M -XX:MaxPermSize=2000M'
ExecStart=/usr/local/java/apache-tomcat-8.0.53/bin/startup.sh
ExecStop=/usr/local/java/apache-tomcat-8.0.53/bin/shutdown.sh
#ExecReStart=/usr/local/java/apache-tomcat-8.0.53/bin/shutdown.sh;/usr/local/java/apache-tomcat-8.0.53/bin/startup.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
0 コメント