주의!! <- 퍼렁색은 실제 디랙토리 위치에 지정
service redmine start
service redmine stop
service redmine status
service redmine restart
보라색배경은 꼭 있어야 된다고 한다.
Linux Service 등록
1). 아래의 소스를 /etc/init.d/ 아래에 redmine으로 저장한 뒤
2). chkconfig --add redmine
3). chkconfig --list redmine으로 on/off 상태 확인하고.
ex)[root@redmine2 init.d]# chkconfig --list redmine
redmine 0:off 1:off 2:off 3:off 4:off 5:off 6:off
4). 위와같이 off 상태이면 chkconfig redmine on
5). 한번더 확인
ex) [root@redmine2 init.d]# chkconfig --list redmine
redmine 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#!/bin/sh # chkconfig: 2345 95 20 # description: Some description # What your script does (not sure if this is necessary though) # processname: myscript status=`ps -ef |grep ruby|grep redmine | awk '{print $2}'` if [ "$1" == "start" ];then if [ "$status" != "" ];then echo "redmine (pid $status) is running..." else echo "Starting redmine" /usr/local/bin/ruby /redmine/redmine-2.4.2/script/rails server webrick -e production -d fi elif [ "$1" == "stop" ]; then echo "Stopping redmine" kill -9 $status
elif [ "$1" == "status" ];then if [ "$status" != "" ];then echo "redmine (pid $status) is running..." else echo "redmine is stopped" fi elif [ "$1" == "restart" ];then echo "Stopping redmine" kill -9 $status echo "Starting redmine" /usr/local/bin/ruby /redmine/redmine-2.4.2/script/rails server webrick -e production -d else echo "redmine {start|stop|restart|status}" fi |
'OS > Linux' 카테고리의 다른 글
[Linux] pssh script (0) | 2016.03.10 |
---|---|
[YUM] yum repository Local 참조 (0) | 2016.03.10 |
[Linux] bash shell shock (0) | 2016.03.10 |
[Linux] ibus-daemon start on boot (시작프로그램 등록) (0) | 2016.03.10 |
[Linux] 영어설치 -> 한글설치 (0) | 2016.03.10 |