기본 콘텐츠로 건너뛰기

우분투 service 등록

* 서비스 등록 

1. 부팅 레벨 확인
#runlevel
N 2
2. /etc/init.d 폴더에 스크립트 저장
3. /etc/rc2.d 폴더에 소프트 링크 등록

* 부팅시 실행될 내용 등록

/etc/rc.local : 시작시 실행할 명령
/etc/rc6.d/* : 종료시 실행할 명령
파일은 모두 chmod +x 로 실행권한이 있어야 함.
파일 이름은 K99_로 시작하게 할 것.


* 다른 방법(패키지 이용)

Ubuntu Service

    Ubuntu에서 Service의 등록과 실행 등

Boot-Up Manager

    sudo apt-get install bum
    각종 서비스의 시작/종료/자동시작 지정등을 할 수 있다.

Service 자동 시작

    How can I configure a service to run at startup
    sysv-rc-conf 패키지를 설치해 CUI 로 적용할 수 있다.
    update-rc.d 명령

    # 서비스 자동 시작 등록
    sudo update-rc.d 서비스명 defaults

    # 자동 시작 제거
    sudo update-rc.d 서비스명 remove

댓글

이 블로그의 인기 게시물

java 특정 디렉토리에 있는 파일 목록을 읽어내기, 정렬해서 가져오기

폴더 리스트 가져오기 String path="C:\"; File dirFile=new File(path); File []fileList=dirFile.listFiles(); for(File tempFile : fileList) {   if(tempFile.isFile()) {     String tempPath=tempFile.getParent();     String tempFileName=tempFile.getName();     System.out.println("Path="+tempPath);     System.out.println("FileName="+tempFileName);     /*** Do something withd tempPath and temp FileName ^^; ***/   } } 정렬해서 가져오기 import java.io.FileFilter; import java.io.IOException; import java.util.Arrays; import java.util.Date; import org.apache.commons.io.comparator.LastModifiedFileComparator; import org.apache.commons.io.filefilter.FileFileFilter; public class LastModifiedFileComparatorTest { public static void main(String[] args) throws IOException { File directory = new File("."); // get just files, not directories File[] files = directory.listFiles((FileFilter) FileFileFilter.FILE); System.out.println("Defaul...

dmesg 메시지 실시간으로 보기

참조사이트 http://imitator.kr/Linux/556 # tail -f /var/log/messages # tail -f |dmesg //기본 2초 단위로 갱신 된다. # watch "dmesg | tail -f" //1초 단위로 갱신하면서 보여준다. # watch -n 1 "dmesg | tail -f" // 보여주는 줄을 20으로 늘린다. (기본 10줄) # watch -n 1 "dmesg | tail -f -n 20"