Current File : //cpanel_installer/install
#!/usr/bin/perl

# cpanel - installd/install                        Copyright 2021 cPanel, L.L.C.
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited

package installd::install;

use strict;
use warnings;
use FindBin;

use Cwd          ();
use Getopt::Long ();

use lib $FindBin::Bin;
use Common ();
use CpanelLogger;    # need imports!

use Installer ();

my $background_pre_sysup_pid;

exit run(@ARGV) unless caller;

sub run {
    my (@args) = @_;
    my $ret = eval { script(@args) };
    if ( !defined $ret || $@ ) {
        chomp $@;
        print STDERR $@ if $@;
        return 1;
    }
    return $ret;
}

sub script {
    my (@args) = @_;

    my $installer = Installer->new;
    $installer->setup(@args);

    # Determine local distro and version. Fail if unsupported.
    $installer->check_system_support();

    # Do the clean install check pause right after
    # network manager so they see the warning since
    # this will pause for 5 seconds
    $installer->check_networking_scripts();
    $installer->clean_install_check();

    # Bootstrap checks.
    INFO("Running health checks prior to start.");
    $installer->check_system_files();
    $installer->setup_and_check_resolv_conf;

    $installer->ensure_pkgs_installed;

    # Remove rpms and stop unneeded services. This must happen before there are parallel executions of yum/rpm
    # because rpm from 4.12.0-alpha-90 does not wait for transaction lock when stdin is not a tty
    # (it errors and dies instead). My CentOS 8 VM has rpm 4.14.2. We could work around this with fcntl, but
    # that syscall is complicated to use in this bootstrap environment.
    $installer->remove_distro_software;

    # lts_version also bootstraps our version info.
    # Install base distro required RPMS and setup YUM
    my $lts = $installer->lts_version;
    INFO("Installing cPanel & WHM major version $lts.");
    $installer->do_initial_clock_update;
    $installer->start_nscd;

    # Look for conditions that require tier manipulation or require us to block the install.
    $installer->check_for_install_version_blockers;

    # bootstrap the cPanel perl ecosystem in a background process.
    my $bootstrap_cpanel_perl_pid = $installer->run_in_background( sub { $installer->bootstrap_cpanel_perl } );

    # We don't allow this to run in parallel on systems that exit if an installer lock exists.
    if ( $installer->distro_type eq 'debian' || $installer->distro_major == 8 ) {
        wait_for_cpanel_perl_to_finish($bootstrap_cpanel_perl_pid);
        undef $bootstrap_cpanel_perl_pid;
    }

    $installer->pre_checks_while_waiting_for_fix_cpanel_perl;

    # Start background rpm download only after disable_software since it does rpm -e
    $background_pre_sysup_pid = $installer->background_download_packages_used_during_initial_install;

    wait_for_cpanel_perl_to_finish($bootstrap_cpanel_perl_pid);

    # Install cPanel files.
    INFO('Installing /usr/local/cpanel files...');
    DEBUG( "HTTPUPDATE is set to " . CpanelConfig::get_update_source() );

    if ( $installer->stop_at_update_now ) {
        waitpid( $background_pre_sysup_pid, 0 );
        DEBUG("") for ( 1 .. 5 );
        DEBUG("The system is in dry run mode (--stop_at_update_now). It would normally");
        DEBUG("run updatenow and cpanel_initial_install at this point.");
        DEBUG(" If you're reaching this point, then the latest script has succeeded!");
        return 0;
    }

    # Install cpanel files and directories. TERMINATE if failure.
    $installer->updatenow;

    # We used to wait for yum to finish here but
    # that just blocked the installer from downloading
    # rpms so we do the waitpid after

    chmod( 0700, '/usr/local/cpanel/scripts/cpanel_initial_install' );

    system( '/usr/local/cpanel/scripts/cpanel_initial_install', '--skipapache', $installer->skip_apache, '--skipreposetup', $installer->skip_repo_setup, '--installstart', $installer->install_start );

    if ( $? >> 8 != 0 ) {
        kill 'TERM', $background_pre_sysup_pid if $background_pre_sysup_pid;
        FATAL('The system failed to run the /usr/local/cpanel/scripts/cpanel_initial_install script.');

        return 1;
    }

    # Cleanup before exiting
    waitpid( $background_pre_sysup_pid, 0 );
    return 0;
}

sub wait_for_cpanel_perl_to_finish {
    my ($pid) = @_;
    return unless $pid;    # Skip if it has cleared.

    local $?;
    waitpid( $pid, 0 );
    if ( $? != 0 ) {
        kill 'TERM', $background_pre_sysup_pid if $background_pre_sysup_pid;
        FATAL("Bootstrapping cPanel Perl failed: $?");
    }

    return;
}

1;
Seguro Celular
Home business sonyw300 6 de febrero de 2020
SEGURO PARA CUALQUIER MOMENTO
Evita cualquier situación con nuestro seguro para celular.

Contar con un seguro para celular te brinda una protección integral contra situaciones comunes como robo, accidentes y pérdida. No solo te ahorrará dinero en reparaciones o reemplazos, sino que también te proporcionará la tranquilidad de saber que estás respaldado en caso de cualquier eventualidad. Es una inversión inteligente para salvaguardar tu dispositivo, tus datos y tu tranquilidad.

De viaje
Protegido siempre ante cualquier imprevisto
Contratar ahora!
Robo
Asegura tu equipo ante un posible robo
Contratar ahora!
Accidentes
No pases un mal momento, protege tu dispositivo
Contratar ahora!
Previous slide
Next slide
¿Porqué seguro celular es para ti?
Nos comprometemos en brindarte la mejor protección para tu dispositivo
Cobertura mundial

Sea cual sea el problema estamos aquí para proteger tu inversión y brindarte la tranquilidad que necesitas.

Proceso de reclamación fácil y rápido

Sabemos que necesitas una solución rápida en caso de cualquier incidente.

Opciones personalizadas:

Ofrecemos opciones flexibles que se adaptan a tus requisitos individuales.

Atención al cliente excepcional

Estamos disponible para responder y brindarte asistencia personalizada en todo momento.

Tu tranquilidad está a
solo un clic de distancia

Protege tu dispositivo de cualquier imprevisto
TESTIMONIOS
¿Qué dicen nuestros
valiosos clientes?
"¡Increíble servicio de seguro para celular! Rápido, eficiente y confiable. Mi reclamo fue procesado sin problemas y recibí un reemplazo de mi teléfono en tiempo récord. ¡Gracias por brindar una excelente protección para mis dispositivos!"
male1085054890319
Herman Miller
"Me encanta la tranquilidad que me brinda su servicio de seguro para celular. Sé que mi dispositivo está protegido contra cualquier daño accidental o robo. Además, el proceso de reclamación es sencillo. Super recomendado!
female1021755931884
Sofia Millan
"Me ha salvado en más de una ocasión. El personal siempre está dispuesto a ayudar y resolver cualquier problema que surja. Gracias a su servicio, puedo disfrutar de mi teléfono sin preocupaciones.
male20131085934506012
Alexander Rodriguez