MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: digitals (531)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //scripts.20110531.215904.25158/restartsrv_cppop
#!/usr/bin/perl
# cpanel - restartsrv_cppop                       Copyright(c) 2010 cPanel, Inc.
#                                                           All rights Reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

BEGIN { unshift @INC, '/usr/local/cpanel', '/scripts'; }

use RestartSrv;
use Cpanel::OSSys ();
use strict;

eval {
    local $SIG{'__DIE__'};
    require Cpanel::Rlimit;
    Cpanel::Rlimit::set_rlimit_to_infinity();
};

setuppath();

my %CPCONF = loadcpconfig();

if ( $CPCONF{'maildir'} eq '1' ) {
    exec( '/scripts/restartsrv_imap', @ARGV );
    exit();
}

my ( $system, $nodename, $release, $version, $machine ) = Cpanel::OSSys::uname();
my ( $restart, $check, $status ) = parseargv();

my $iscript = '';
my $initdir = '';

my $processowner = 'root';
my $service      = 'cppop';
my $disabled     = 0;
if ( -e '/etc/cppopdisable' ) {
    $disabled = 1;
}

if ($restart) {
    exit if ($disabled);

    my $lock_file = '/var/run/restartsrv_cppop.lock';
    lock_file($lock_file);

    #--restart or nothing (restart service)
    doomedprocess($service);
    if ( $restart != -1 ) {
        system "/usr/local/cpanel/etc/init/startcppop";
    }

    unlink $lock_file if -e $lock_file;

}
elsif ($status) {

    #--status (show ps)
    if ($disabled) {
        print "$service is disabled\n";
    }
    else {
        print check_service( 'service' => $service, 'user' => $processowner, 'regex' => qr/\bcppop(?:-ssl)?\b/ );
    }
}
elsif ($check) {
    exit if ($disabled);
    if ( check_service( 'service' => $service, 'user' => $processowner, 'regex' => qr/\bcppop(?:-ssl)?\b/ ) eq "" ) {
        print "$service is not running\n";
    }
}