linux autostart - rc.local, chkconfig 개발이야기
2010.08.17 19:46 Edit
Linux 서버 셋팅할 때마다 놓치는것이 service autostart 이슈인것 같습니다.
apache, mysql, redmine 등등의 서비스를 설치해두고 서버가 리붓 된 상황에 서비스가 올라오지 않을때 난감함이란 당해 보지 않으면 모르는 ㅎㅎ
그래서 가볍게 처리할 수 있는 rc.local 방법부터 정리합니다.
역시나 체계적 정리는 chkconfig를 통해 서비스를 등록하는것이 장땡이구요.
rc.local
vi /etc/rc.d/rc.local
# This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local /usr/local/mysql/bin/mysqld_safe & /usr/local/apache/bin/apachectl start
chkconfig
- Installing Hudson as a service on Redhat
- 리눅스 부팅시 서비스 자동으로 실행(chkconfig 사용)
- How to autostart tomcat init.d/rc.d
이슈
1. Sonatype Nexus Maven Repository Manager 띄우게끔 셋팅을 했는데 리부팅 후 서버가 올라오지 않길래 로그를 보니 "Unable to start JVM: No such file or directory (2)" 오류가 발생하더군요.
wrapper | --> Wrapper Started as Daemon wrapper | Launching a JVM... wrapper | Unable to start JVM: No such file or directory (2) wrapper | Unable to start a JVM wrapper | <-- Wrapper Stopped wrapper | --> Wrapper Started as Daemon
그래서 검색해보니 Installing java.. 에서 얘기하는데로 셋팅하고 리부팅하니 잘 되는 군요 ㅎㅎ
[root@localhost bin]# ln -sf /usr/local/java/bin/java /usr/bin/java [root@localhost bin]# ln -sf /usr/local/java/bin/java_vm /usr/bin/java_vm [root@localhost bin]# ll *java* lrwxrwxrwx 1 root root 24 8월 17 19:57 java -> /usr/local/java/bin/java lrwxrwxrwx 1 root root 27 8월 17 19:57 java_vm -> /usr/local/java/bin/java_vm
이 글과 관련된 글
- [2012/01/31] [Linux] Admin Part III - DNS, Subdomain (62)
- [2012/01/31] [Linux] Admin Part II - FTP & DB 유저생성,권한설정 (64)
- [2012/01/31] [Linux] Admin Part I - 데몬,경로,검색 (64)
- [2011/11/15] Vim 한글 깨질 때 (836)
- [2011/11/05] Cent OS, ssh 설정 (549)
