-
-
Save hyunjun/ad60cf79c390b3fe0523 to your computer and use it in GitHub Desktop.
upstart configuration @ redhat 6.3 (Santiago)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cat /etc/redhat-release | |
Red Hat Enterprise Linux Server release 6.3 (Santiago) | |
# cd /etc/init | |
# vi some_program.conf | |
description "upstart of some_program" | |
author "a@b.c" | |
start on runlevel [2345] | |
respawn | |
script | |
su - non_root | |
cd /some/program/path | |
exec /python_path/bin/python src/some_program.py | |
end script | |
# # some_program은 간단한 web server로, test/real 두 가지를 각 branch에서 실행시키기 위해 똑같은 configuration을 만들고 path만 다르게 해서 두 번 실행시켰음 | |
# # 아직 하나의 script에서 두 개의 git branch의 program을 실행시키는 방법은 모르겠음 | |
# initctl reload-configuration | |
# initctl start my_upstart | |
# 정상 실행이 되면 ps -ef | grep some_program으로 찾은 pid로 kill을 해도 자동으로 재시작해야 함(respawn을 넣었으므로) | |
# initctl status my_upstart | |
# initctl stop my_upstart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment