nginx环境下配置nagios-关于start_perl_cgi.sh
2 set -x
3 dir=/export/servers/nginx
4
5 stop ()
6 {
7 #pkill -f $dir/perl-fcgi.pl
8 kill $(cat $dir/logs/perl-fcgi.pid)
9 rm $dir/logs/perl-fcgi.pid 2>/dev/null
10 rm $dir/logs/perl-fcgi.sock 2>/dev/null
11 echo "stop perl-fcgi done"
12 }
13
14 start ()
15 {
16 rm $dir/now_start_perl_fcgi.sh 2>/dev/null
17
18 chown nagios.nagios $dir/logs
19 echo "$dir/perl-fcgi.pl -l $dir/logs/perl-fcgi.log -pid $dir/logs/perl-fcgi.pid -S $dir/logs/perl-fcgi.sock" >>$dir/now_start_perl_fcgi.sh
20
21 chown nagios.nagios $dir/now_start_perl_fcgi.sh
22 chmod u+x $dir/now_start_perl_fcgi.sh
23
24 sudo -u nagios $dir/now_start_perl_fcgi.sh
25 echo "start perl-fcgi done"
26 }
27
28 case $1 in
29 stop)
30 stop
31 ;;
32 start)
33 start
34 ;;
35 restart)
36 stop
37 start
38 ;;
39 esac
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。