서버 재부팅 시 서비스 자동 실행 쉘스크립트

Ubuntu Linux 기준으로 작성함.

init 파일 생성

/etc/init.d 에 example 생성 후 아래와 같이 설정.

$ chmod 755 example
$ chown root:root example

쉘 스크립트

example 의 코드는 아래와 같이 작성 가능.

#!/bin/sh

### BEGIN INIT INFO
# Provides: blog
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 ...
more ...