Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- CSS #flex
- SSL인증서
- typescript
- Storyboard
- angular
- webpack
- PublicKey
- 가상사설망
- keytool
- Vue
- anaconda
- guide
- Javascript #MDN #Webs #Docs
- Git
- nodejs
- 요구사항정의서 #기획 #UI/UX기획
- TensorFlow
- 해시함수
- javascript #prototype # array # find()
- 웹기획
- CSS #pseudo-classes
- 안좋은습관10가지
- privateKey
- es5 #es6
- 일기
- securitykey
- behaviorsubject
- Ke
- passport.js
- tsotry
Archives
- Today
- Total
민자의 지식창고
tomcat.service is not a native service 본문
tomcat 서비스 올리다가 무슨 문제인지는 모르겠으나, 아래 문제의 봉착을 하여 삽질을 하였습니다.
tomcat.service is not a native service, redirecting to /sbin/chkconfig.
깔끔한 환경에서는 Tomcat 자동 활성화 방안으로 바로 처리가 되나, 이것저것 하다 꼬여서 기존의 서비스가 엉망징창 되었나 봅니다.
//enable도 안먹히지만 disabled도 안먹힘.
[centos@ip-10-203-38-47 init.d]$ sudo systemctl disable tomcat8
tomcat8.service is not a native service, redirecting to /sbin/chkconfig. Executing /sbin/chkconfig tomcat8 off
[centos@ip-10-203-38-47 init.d]$ sudo vi tomcat8
[centos@ip-10-203-38-47 init.d]$ sudo chown -R centos.centos tomcat8
[centos@ip-10-203-38-47 init.d]$ chkconfig --list tomcat8
// runabled이 죄다 off상태 임. 이러면 안되는데
Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'. To see services enabled on particular target use 'systemctl list-dependencies
[target]'. tomcat8 0:off 1:off 2:off 3:off 4:off 5:off 6:off
//이런 개떡같은 상황이 발생 함.. 추가 해보자 된건가?
[centos@ip-10-203-38-47 init.d]$ sudo chkconfig --add tomcat8
// 리스트에 안뜸
[centos@ip-10-203-38-47 init.d]$ systemctl list-unit-files | grep tomcat8
//보니 daemon-reload를 하나?
[centos@ip-10-203-38-47 init.d]$ systemctl status tomcat8 ●
tomcat8.service - SYSV: apache tomcat 8 Loaded: loaded (/etc/rc.d/init.d/tomcat8; bad; vendor preset: disabled) Active: active (exited) since Tue 2020-09-15 23:35:30 UTC; 1h 16min ago Docs: man:systemd-sysv-generator(8) Sep 15 23:35:30 ip-10-203-38-47.ap-northeast-1.compute.internal systemd[1]: Starting SYSV: apache tomcat 8... Sep 15 23:35:30 ip-10-203-38-47.ap-northeast-1.compute.internal tomcat8[1276]: su: user – does not exist Sep 15 23:35:30 ip-10-203-38-47.ap-northeast-1.compute.internal systemd[1]: Started SYSV: apache tomcat 8. Warning: tomcat8.service changed on disk. Run 'systemctl daemon-reload' to reload units.
// enable 시키니 안되네?
[centos@ip-10-203-38-47 init.d]$ sudo systemctl enable tomcat8
tomcat8.service is not a native service, redirecting to /sbin/chkconfig. Executing /sbin/chkconfig tomcat8 on
//list 안뜨네?
[centos@ip-10-203-38-47 init.d]$ systemctl list-unit-files | grep tomcat8
//reload를 다했나 봄
[centos@ip-10-203-38-47 init.d]$ systemctl status tomcat8
● tomcat8.service - SYSV: Tomcat is a Web application server. Loaded: loaded (/etc/rc.d/init.d/tomcat8; bad; vendor preset: disabled) Active: active (exited) since Tue 2020-09-15 23:35:30 UTC; 1h 18min ago Docs: man:systemd-sysv-generator(8) Sep 15 23:35:30 ip-10-203-38-47.ap-northeast-1.compute.internal systemd[1]: Starting SYSV: apache tomcat 8... Sep 15 23:35:30 ip-10-203-38-47.ap-northeast-1.compute.internal tomcat8[1276]: su: user – does not exist Sep 15 23:35:30 ip-10-203-38-47.ap-northeast-1.compute.internal systemd[1]: Started SYSV: apache tomcat 8.
[centos@ip-10-203-38-47 init.d]$ sudo systemctl enable tomcat8.service
tomcat8.service is not a native service, redirecting to /sbin/chkconfig. Executing /sbin/chkconfig tomcat8 on
//runable 환경이 바뀌었네 (demon -reload 후 바뀐건가?
[centos@ip-10-203-38-47 init.d]$ chkconfig --list tomcat8
Note: This output shows SysV services only and does not include native systemd services. SysV configuration data might be overridden by native systemd configuration. If you want to list systemd services use 'systemctl list-unit-files'. To see services enabled on particular target use 'systemctl list-dependencies
[target]'. tomcat8 0:off 1:off 2:on 3:on 4:on 5:on 6:off
//tomcat 서비스 재시작 해보니 잘 돌아감.
[centos@ip-10-203-38-47 init.d]$ sudo service tomcat8 restart
Restarting tomcat-8.5.57 Spay : Using CATALINA_BASE: /usr/local/lib/apache-tomcat-8.5.57 Using CATALINA_HOME: /usr/local/lib/apache-tomcat-8.5.57 Using CATALINA_TMPDIR: /usr/local/lib/apache-tomcat-8.5.57/temp Using JRE_HOME: /usr/local/lib/jdk1.8.0_261 Using CLASSPATH: /usr/local/lib/apache-tomcat-8.5.57/bin/bootstrap.jar:/usr/local/lib/apache-tomcat-8.5.57/bin/tomcat-juli.jar Using CATALINA_BASE: /usr/local/lib/apache-tomcat-8.5.57 Using CATALINA_HOME: /usr/local/lib/apache-tomcat-8.5.57 Using CATALINA_TMPDIR: /usr/local/lib/apache-tomcat-8.5.57/temp Using JRE_HOME: /usr/local/lib/jdk1.8.0_261 Using CLASSPATH: /usr/local/lib/apache-tomcat-8.5.57/bin/bootstrap.jar:/usr/local/lib/apache-tomcat-8.5.57/bin/tomcat-juli.jar Tomcat started.
//tomcat 서비스 잘 떠있고
[centos@ip-10-203-38-47 init.d]$ ps -ef |grep tomcat8
centos 2297 1835 0 00:56 pts/1 00:00:00 grep --color=auto tomcat8
//tomcat 서비스 잘 꺼지고
[centos@ip-10-203-38-47 init.d]$ sudo service tomcat8 stop
Shutting down tomcat-8.5.57 Spay : Using CATALINA_BASE: /usr/local/lib/apache-tomcat-8.5.57 Using CATALINA_HOME: /usr/local/lib/apache-tomcat-8.5.57 Using CATALINA_TMPDIR: /usr/local/lib/apache-tomcat-8.5.57/temp Using JRE_HOME: /usr/local/lib/jdk1.8.0_261 Using CLASSPATH: /usr/local/lib/apache-tomcat-8.5.57/bin/bootstrap.jar:/usr/local/lib/apache-tomcat-8.5.57/bin/tomcat-juli.jar
[centos@ip-10-203-38-47 init.d]$ ps -ef | grep tomcat
centos 2394 1835 0 00:58 pts/1 00:00:00 grep --color=auto tomcat
[centos@ip-10-203-38-47 init.d]$ ps -ef | grep tomcat8
centos 2396 1835 0 00:58 pts/1 00:00:00 grep --color=auto tomcat8
[centos@ip-10-203-38-47 init.d]$ sudo systemctl start tomcat8
[centos@ip-10-203-38-47 init.d]$ ps -ef | grep tomcat
centos 2406 1835 0 00:59 pts/1 00:00:00 grep --color=auto tomcat
[centos@ip-10-203-38-47 init.d]$ sudo service tomcat8 restart
Restarting tomcat-8.5.57 Spay : Using CATALINA_BASE: /usr/local/lib/apache-tomcat-8.5.57 Using CATALINA_HOME: /usr/local/lib/apache-tomcat-8.5.57 Using CATALINA_TMPDIR: /usr/local/lib/apache-tomcat-8.5.57/temp Using JRE_HOME: /usr/local/lib/jdk1.8.0_261 Using CLASSPATH: /usr/local/lib/apache-tomcat-8.5.57/bin/bootstrap.jar:/usr/local/lib/apache-tomcat-8.5.57/bin/tomcat-juli.jar Sep 16, 2020 12:59:34 AM org.apache.catalina.startup.Catalina stopServer SEVERE: Could not contact [localhost:8005]. Tomcat may not be running. Sep 16, 2020 12:59:35 AM org.apache.catalina.startup.Catalina stopServer SEVERE: Catalina.stop: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:476) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:218) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:394) at java.net.Socket.connect(Socket.java:606) at java.net.Socket.connect(Socket.java:555) at java.net.Socket.<init>(Socket.java:451) at java.net.Socket.<init>(Socket.java:228) at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:504) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:388) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:478) Using CATALINA_BASE: /usr/local/lib/apache-tomcat-8.5.57 Using CATALINA_HOME: /usr/local/lib/apache-tomcat-8.5.57 Using CATALINA_TMPDIR: /usr/local/lib/apache-tomcat-8.5.57/temp Using JRE_HOME: /usr/local/lib/jdk1.8.0_261 Using CLASSPATH: /usr/local/lib/apache-tomcat-8.5.57/bin/bootstrap.jar:/usr/local/lib/apache-tomcat-8.5.57/bin/tomcat-juli.jar Tomcat started. [centos@ip-10-203-38-47 init.d]$ ps -ef | grep tomcat centos 2496 1 66 00:59 ? 00:00:03 /usr/local/lib/jdk1.8.0_261/bin/java -Djava.util.logging.config.file=/usr/local/lib/apache-tomcat-8.5.57/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/lib/apache-tomcat-8.5.57/bin/bootstrap.jar:/usr/local/lib/apache-tomcat-8.5.57/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/lib/apache-tomcat-8.5.57 -Dcatalina.home=/usr/local/lib/apache-tomcat-8.5.57 -Djava.io.tmpdir=/usr/local/lib/apache-tomcat-8.5.57/temp org.apache.catalina.startup.Bootstrap start centos 2529 1835 0 00:59 pts/1 00:00:00 grep --color=auto tomcat
//껏다 켜도 서비스가 재시동 됨..
[centos@ip-10-203-38-47 init.d]$ sudo shutdown -r now
//결론은 뭘까? 잘되기는 했는데.. 알수가 없다
* 아래 포스트를 참고하여, 해결해 보았습니다.
CentOS7 서비스활성화 하기
CentOS7(Redhat 7) 버전에서 변경된 가장 큰 변경사항이 있다면, 역시 systemd 가 메인 서비스 관리자로 등장한 것이라 할 수 있다. CentOS6 버전까지는 SysV Service에 의해 chkconfig 명령을 통해 서비스들의 Le
blog.helperchoi.com
https://iamfreeman.tistory.com/entry/CentOS-시스템-부팅-시-Tomcat-자동-실행-설정하기
[CentOS] 시스템 부팅 시 Tomcat 자동 실행 설정하기
[CentOS] 시스템 부팅 시 Tomcat 자동 실행 설정하기 CentOS에 Apache Tomcat을 설치한 이후에 시스템 재구동 시 자동으로 Tomcat이 실행되도록 설정하고 싶으실때 있으시죠? 서비스 서버에서 시스템 ��
iamfreeman.tistory.com
728x90
'개발노트 > Server' 카테고리의 다른 글
SSL 인증서 (0) | 2020.11.26 |
---|---|
Gzip이란? (0) | 2020.09.28 |
Git Hub remote: Permission 403 (0) | 2020.08.19 |
Web 서버 구축(Linux-ubuntu7) (0) | 2020.08.05 |
Web Server 설치 하는 방법 (0) | 2020.07.22 |