首页 > 代码库 > nginx环境下配置nagios-关于start_perl_cgi.sh
nginx环境下配置nagios-关于start_perl_cgi.sh
1 #!/bin/bash
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
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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。