VulsRepo皆さん使ってますか!?
Vuls Repoの起動スクリプト(init file)がないので自作してみました。ちなみにAmazon Linux(CentOS6系)で使えます。
■/etc/init.d/vuls-repo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
#!/bin/bash #chkconfig: 2345 85 15 #descpriction: VulsRepo #OS Amazon Linux/CentOS6 # source function library . /etc/rc.d/init.d/functions RETVAL=0 start() { echo -n $"Starting VulsRepo: " /usr/bin/nohup /home/vuls/vulsrepo/server/vulsrepo-server >/dev/null 2>&1 & RETVAL=$? if [ $RETVAL == 0 ]; then success else failure fi echo } stop() { echo -n $"Stopping VulsRepo: " /usr/bin/pkill vulsrepo RETVAL=$? if [ $RETVAL == 0 ]; then success else failure fi echo } status() { if /usr/bin/pgrep vulsrepo > /dev/null then echo -n $"VulsRepo is running: " else echo -n $"VulsRepo is not running: " fi RETVAL=$? echo } case "$1" in start) start ;; stop) stop ;; status) status ;; restart) stop start ;; *) echo -e $"Usage: $0 {start|stop|restart}" exit 1 esac exit $RETVAL |
■確認
・status
1 2 |
$ sudo /etc/init.d/vuls-repo status VulsRepo is running: |
・stop
1 2 3 4 5 |
$ sudo /etc/init.d/vuls-repo stop Stopping VulsRepo: [ OK ] $ sudo /etc/init.d/vuls-repo status VulsRepo is not running |
・start
1 2 |
$ sudo /etc/init.d/vuls-repo start Starting VulsRepo: [ OK ] |
・restart
1 2 3 4 5 6 |
$ sudo /etc/init.d/vuls-repo restart Stopping VulsRepo: [ OK ] Starting VulsRepo: [ OK ] $ sudo /etc/init.d/vuls-repo status VulsRepo is running: |
・reload
1 2 |
$ sudo /etc/init.d/vuls-repo reload Reload VulsRepo: [ OK ] |
■まとめ
これでダイジェスト認証のパス変更時に、毎回起動スクリプト叩けば楽になりましたね。
$ sudo chkconfig vuls-repo on 忘れずに!
https://github.com/usiusi360/vulsrepo/pull/55
https://github.com/usiusi360/vulsrepo/blob/master/server/scripts/vulsrepo.init
0件のコメント