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: //proc/self/root/proc/self/root/scripts.20110531.215904.25158/restartsrv_mailman
#!/usr/bin/perl
# cpanel - restartsrv_mailman                     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'; }

## note: copied from restartsrv_tailwatchd and modified

use RestartSrv;
use strict;

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

setuppath();

my ( $restart, $check, $status ) = parseargv();

my $service = 'mailmanctl';
my $processowner = 'mailman';

## in other words, does $processowner or $service depend on $system
#OUT#( $processowner, $service ) = servicefixup( $system, $service );

my $disabled = 0;
## TODO: case 5966 and 30562
if ( -e '/etc/mailmandisable' ) {
    $disabled = 1;
}

my $mailmanctl = '/usr/local/cpanel/3rdparty/mailman/bin/mailmanctl';
if ( $restart && !$disabled ) {
    my $lock_file = '/var/run/restartsrv_mailman.lock';
    lock_file($lock_file);

    nooutputsystem( $mailmanctl, 'stop' );
    doomedprocess( $service );
    doomedprocess( "qrunner" );

    ## e.g. invoked with '--stop'
    if ( $restart != -1 ) {
        ## note: otherwise, we get the """The master qrunner lock could not be acquired.
        ##   It appears as though there is a stale master qrunner lock.""" warning
        nooutputsystem( $mailmanctl, '--stale-lock-cleanup', 'start' );
    }

    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 );
        print check_service( 'service' => '3rdparty/mailman/bin/qrunner', 'user' => $processowner );
    }
}
elsif ($check) {
    exit if ($disabled);
    if ( check_service( 'service' => $service, 'user' => $processowner ) eq '' ) {
        print "$service is not running\n";
    }
}