Index: [Article Count Order] [Thread]

Date:  Fri, 26 Oct 2007 15:36:30 -0700
From:  "Ken Marcus - Precision Web Hosting, Inc." <kenmarcus (at mark) precisionweb.net>
Subject:  [coba-e:10972] Re: admserv not starting back
To:  <coba-e (at mark) bluequartz.org>
Message-Id:  <0a6801c81820$a85211b0$6700a8c0@OfficeKen>
References:  <291601c817f2$cd4eb0f0$5001010a@sales>
X-Mail-Count: 10972


----- Original Message ----- 
From: "Tushar Patel" <tupatel (at mark) ecpi.com>
To: <coba-e (at mark) bluequartz.org>
Sent: Friday, October 26, 2007 10:08 AM
Subject: [coba-e:10965] admserv not starting back


> Hi,
>
> I just install backup gu from Nuonce and some how it wont show up in the
> server gui, so I thaught I will restart the admserv, bad idea now I can't
> even start it back.
>
> some how it will stop, put some process must be taking 444 port.
>
> Any idea what I can do to start it back?
>
>
>
> [root (at mark) ns10 init.d]# ./admserv stop
> Stopping admin web server:  httpd.admsrv                   [  OK  ]
> [root (at mark) ns10 init.d]# ./admserv start
> Starting admin web server: (98)Address already in use: make_sock: could 
> not
> bind to address 0.0.0.0:444
> no listening sockets available, shutting down
> Unable to open logs
>                                                           [FAILED]
> [root (at mark) ns10 init.d]# ./admserv stop
> Stopping admin web server:  httpd.admsrv                   [  OK  ]
> [root (at mark) ns10 init.d]# ./admserv stop
> Stopping admin web server:  httpd.admsrv                   [  OK  ]
> [root (at mark) ns10 init.d]#
>
>
> Thanks in advance.
>
> Tushar


Tushar

The script I have set to run periodically is

#!/usr/bin/perl
##################################################################
# checks the admserv process and restarts if necessary
#################################################################

$mailprog = '/usr/sbin/sendmail';
$running = "no";
$processtokill = "nothing";

require 'setup.conf';

@ps =`ps auxwwwww | grep httpd | grep admsrv`;
$aps = "@ps";

foreach $line (@ps){
   if ( ($line =~ /usr\/sbin\/httpd.admsrv/)  ) {
      #print "The all is well\n";
      $running = "yes";
   }
}


if ($running eq "no") {
         print "admserv problem \n";
         open (MAIL, "|$mailprog -t") || &safe_die("Can't open 
$mailprog!\n");
         print MAIL "From: $sendto\n";
         print MAIL "Reply-To: $sendto\n";
         print MAIL "To: $sendto\n";
         print MAIL "Subject: $serverdomain admserv restart\n\n";

         system ("/etc/rc.d/init.d/admserv stop");
         sleep (5);

         $fuser =`/sbin/fuser 444/tcp`;
         chomp ($fuser);
         ($prev0, $processtokill)  = split(/tcp:/,$fuser);

         print "The /fuser of 444  is $fuser \n";
         if ($processtokill =~ /\d/){
            system ("kill -9 $processtokill");
            print MAIL "I killed  $processtokill \n";
            print      "I killed  $processtokill \n";
         }

         system ("/etc/rc.d/init.d/admserv start");

         print MAIL "The ps is $aps \n";
         print MAIL "The /fuser of 444  is $fuser \n";
         print MAIL "444 process  $processtokill \n";

         close (MAIL);

}