2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

systemctl で Tomcat を制御できない…

Posted at

これまで仕事関係で CentOS を使う機会が多かったのですが、今後は、自宅で Respberry Pi を扱う時間を増やそうと考えています。
Debian系のディストリビューションは、Debian の古いバージョンを十年以上前に触って以降、ほとんど使っていませんでした。
(時々、Ubuntu は触りましたが、GUI での利用が大半…)

サーバー環境を構築している中、Debian系でも systemctl が使えるんだ…(ディストリビューション間の違いがなくなりつつあるのかな?)なんて思ったりもしていますが、歴史的な経緯 を眺めると、一筋縄でも行かないようで…。

ディストリビューションの間の違いが埋められたら良いな(楽!)…という思いもあり、
systemctl を積極的に使っていこうと思いました。


さて本題ですが、

$ sudo systemctl stop tomcat
Failed to stop tomcat.service: Unit tomcat.service not loaded.

$ sudo systemctl enable tomcat.service
Failed to enable unit: Unit file tomcat.service does not exist.

Failed 連発です。
適当にやるとだめですね…。
tomcat.service は自分で作る?(aptでインストールされたのだから、用意されていると思うが…)などと思いながら、
インストール先を調べてみたら、ありました。
「tomcat.service」ではなく「tomcat9.service」でした。

$ dpkg -L tomcat9
/.
/etc
/etc/cron.daily
/etc/cron.daily/tomcat9
/etc/logrotate.d
/etc/rsyslog.d
/etc/rsyslog.d/tomcat9.conf
/etc/tomcat9
/etc/tomcat9/Catalina
/etc/tomcat9/policy.d
/etc/tomcat9/policy.d/01system.policy
/etc/tomcat9/policy.d/02debian.policy
/etc/tomcat9/policy.d/03catalina.policy
/etc/tomcat9/policy.d/04webapps.policy
/etc/tomcat9/policy.d/50local.policy
/lib
/lib/systemd
/lib/systemd/system
/lib/systemd/system/tomcat9.service
/usr
/usr/lib
/usr/lib/sysusers.d
/usr/lib/sysusers.d/tomcat9.conf
/usr/lib/tmpfiles.d
/usr/lib/tmpfiles.d/tomcat9.conf
/usr/libexec
/usr/libexec/tomcat9
/usr/libexec/tomcat9/tomcat-start.sh
/usr/libexec/tomcat9/tomcat-update-policy.sh
/usr/share
/usr/share/doc
/usr/share/doc/tomcat9
/usr/share/doc/tomcat9/changelog.Debian.gz
/usr/share/doc/tomcat9/copyright
/usr/share/tomcat9
/usr/share/tomcat9/default.template
/usr/share/tomcat9/etc
/usr/share/tomcat9/etc/catalina.properties
/usr/share/tomcat9/etc/context.xml
/usr/share/tomcat9/etc/jaspic-providers.xml
/usr/share/tomcat9/etc/logging.properties
/usr/share/tomcat9/etc/server.xml
/usr/share/tomcat9/etc/tomcat-users.xml
/usr/share/tomcat9/etc/web.xml
/usr/share/tomcat9/logrotate.template
/usr/share/tomcat9-root
/usr/share/tomcat9-root/default_root
/usr/share/tomcat9-root/default_root/META-INF
/usr/share/tomcat9-root/default_root/META-INF/context.xml
/usr/share/tomcat9-root/default_root/index.html
/var
/var/cache
/var/cache/tomcat9
/var/lib
/var/lib/tomcat9
/var/lib/tomcat9/lib
/var/lib/tomcat9/webapps
/var/log
/var/log/tomcat9
/usr/share/doc/tomcat9/README.Debian
/var/lib/tomcat9/conf
/var/lib/tomcat9/logs
/var/lib/tomcat9/work

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?