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
nginx环境下配置nagios-关于start_perl_cgi.sh,布布扣,bubuko.com