strutture:lnf:dr:calcolo:sistemi:scientific_linux_7_template
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
strutture:lnf:dr:calcolo:sistemi:scientific_linux_7_template [2018/02/13 10:48] – [Tivoli Storage Manager e configurazione backup] dmaselli@infn.it | strutture:lnf:dr:calcolo:sistemi:scientific_linux_7_template [2019/04/16 09:23] (current) – [Data e ora (solo VM oVirt)] dmaselli@infn.it | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== ScientificLinux/ | ||
+ | ===== Impostare proxy per YUM ===== | ||
+ | |||
+ | echo ' | ||
+ | | ||
+ | | ||
+ | ==== Installazioni e aggiornamenti ==== | ||
+ | |||
+ | Aggiungiamo i repository **EPEL**: | ||
+ | |||
+ | < | ||
+ | yum install epel-release | ||
+ | </ | ||
+ | |||
+ | Installiamo i seguenti pacchetti: | ||
+ | |||
+ | < | ||
+ | yum install deltarpm bash-completion yum-utils | ||
+ | </ | ||
+ | |||
+ | Aggiorniamo i pacchetti installati | ||
+ | |||
+ | < | ||
+ | yum update | ||
+ | </ | ||
+ | |||
+ | Disabilitiamo '' | ||
+ | |||
+ | < | ||
+ | systemctl disable kdump.service | ||
+ | </ | ||
+ | |||
+ | ===== Impostare Version lock YUM (Solo SL)===== | ||
+ | yum remove yum-conf-sl7x | ||
+ | rpm -q --queryformat=' | ||
+ | |||
+ | |||
+ | ==== Installare xAuth per il forward di X11 via SSH ==== | ||
+ | |||
+ | yum install xorg-x11-xauth | ||
+ | |||
+ | |||
+ | ==== Abilitare verbose boot ==== | ||
+ | | ||
+ | sed -i ' | ||
+ | sed -i ' | ||
+ | |||
+ | ==== Sostituzione del Volume Group name (solo SL) ==== | ||
+ | |||
+ | Modifichiamo il nome del volume group assegnato automaticamente con **vglocal** | ||
+ | < | ||
+ | |||
+ | Sostituiamo tutte le occorrenze di **[automatic_name]** con **vglocal** nei seguenti file: | ||
+ | < | ||
+ | for f in / | ||
+ | </ | ||
+ | |||
+ | |||
+ | Quindi riavviamo la macchina. | ||
+ | |||
+ | |||
+ | ==== Data e ora ==== | ||
+ | |||
+ | Installare il servizio NTP: | ||
+ | yum install ntp | ||
+ | | ||
+ | Controllare che in ''/ | ||
+ | server ntp1.lnf.infn.it iburst | ||
+ | server ntp2.lnf.infn.it iburst | ||
+ | server ntp3.lnf.infn.it iburst | ||
+ | | ||
+ | Abilitare la sincronizzazione: | ||
+ | timedatectl set-ntp true | ||
+ | ==== Mail ==== | ||
+ | |||
+ | Installiamo il pacchetto '' | ||
+ | < | ||
+ | |||
+ | Modifichiamo il file main.cf di postfix ('' | ||
+ | < | ||
+ | inet_interfaces = all | ||
+ | relayhost = [smtp.lnf.infn.it] | ||
+ | mydomain = lnf.infn.it | ||
+ | </ | ||
+ | |||
+ | ==== Kerberos ==== | ||
+ | |||
+ | Installiamo i pacchetti per il client Kerberos | ||
+ | |||
+ | < | ||
+ | |||
+ | Editiamo il file di configurazione ''/ | ||
+ | |||
+ | < | ||
+ | [libdefaults] | ||
+ | default_realm = LNF.INFN.IT | ||
+ | |||
+ | [domain_realm] | ||
+ | .lnf.infn.it = LNF.INFN.IT | ||
+ | lnf.infn.it | ||
+ | |||
+ | [realms] | ||
+ | LNF.INFN.IT = { | ||
+ | kdc = kdc5s3.lnf.infn.it: | ||
+ | kdc = kdc5s2.lnf.infn.it: | ||
+ | kdc = kdc5s1.lnf.infn.it: | ||
+ | kdc = kdc5s0.lnf.infn.it: | ||
+ | kdc = kdc5p.lnf.infn.it: | ||
+ | admin_server = kdc5p.lnf.infn.it: | ||
+ | default_domain = lnf.infn.it | ||
+ | } | ||
+ | INFN.IT = { | ||
+ | kdc = k5.infn.it: | ||
+ | kdc = afscnaf.infn.it: | ||
+ | kdc = afsrm1.roma1.infn.it: | ||
+ | kdc = afsna.na.infn.it: | ||
+ | admin_server = k5.infn.it: | ||
+ | default_domain = infn.it | ||
+ | } | ||
+ | |||
+ | [appdefaults] | ||
+ | |||
+ | aklog_homedir = true | ||
+ | |||
+ | pam-afs-session = { | ||
+ | minimum_uid = 1000 | ||
+ | ignore_root = true | ||
+ | debug = true | ||
+ | } | ||
+ | |||
+ | pam = { | ||
+ | minimum_uid = 1000 | ||
+ | ticket_lifetime = 259200 # 86400 | ||
+ | renew_lifetime = 604800 | ||
+ | forwardable = true | ||
+ | krb4_convert = false | ||
+ | ccache_dir = /tmp | ||
+ | tokens = true | ||
+ | krb4_convert_524 = false | ||
+ | krb4_use_as_req = false | ||
+ | #afs_cells = lnf.infn.it=afs@LNF.INFN.IT | ||
+ | afs_cells = lnf.infn.it=afs/ | ||
+ | # | ||
+ | validate = true | ||
+ | #validate = false | ||
+ | keytab = FILE:/ | ||
+ | debug = false | ||
+ | #debug = true | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== OpenAFS (Solo SL) ==== | ||
+ | |||
+ | Installiamo i pacchetti | ||
+ | |||
+ | < | ||
+ | |||
+ | Modifichiamo il file '' | ||
+ | < | ||
+ | |||
+ | e il file '' | ||
+ | < | ||
+ | |||
+ | ==== Abilitare gli aggiornamenti automatici di sicurezza (Solo SL) ==== | ||
+ | |||
+ | Modifichiamo il file yum-cron.conf ('' | ||
+ | |||
+ | < | ||
+ | update_cmd = minimal-security | ||
+ | </ | ||
+ | |||
+ | ==== Disabilitare SELinux ==== | ||
+ | |||
+ | Per disabilitare SELinux modifichiamo il file di configurazione ''/ | ||
+ | |||
+ | < | ||
+ | |||
+ | Dopo aver salvato il file è necessario il reboot del sistema per rendere le modifiche effettive. | ||
+ | ==== Networking ==== | ||
+ | |||
+ | Disabilitare Network Manager: | ||
+ | systemctl stop NetworkManager | ||
+ | systemctl disable NetworkManager | ||
+ | cat > / | ||
+ | search lnf.infn.it | ||
+ | nameserver 193.206.84.12 | ||
+ | nameserver 193.206.84.112 | ||
+ | nameserver 193.206.84.212 | ||
+ | EOT | ||
+ | |||
+ | Togliamo tutti i riferimenti a ipv6 in ''/ | ||
+ | |||
+ | Inoltre togliamo tutti i riferimenti univoci alle interfacce. | ||
+ | |||
+ | Modifichiamo le seguenti voci nel file ''/ | ||
+ | < | ||
+ | net.ipv6.conf.all.disable_ipv6 = 1 | ||
+ | net.ipv6.conf.default.disable_ipv6 = 1 | ||
+ | </ | ||
+ | |||
+ | Rendiamo effettive le modifiche eseguendo il comando: | ||
+ | |||
+ | < | ||
+ | |||
+ | Modifichiamo la voce '' | ||
+ | |||
+ | < | ||
+ | |||
+ | Quindi riavviamo '' | ||
+ | |||
+ | < | ||
+ | systemctl restart sshd | ||
+ | systemctl status sshd | ||
+ | </ | ||
+ | |||
+ | Infine modifichiamo la voce '' | ||
+ | |||
+ | < | ||
+ | inet_interfaces = 127.0.0.1 | ||
+ | </ | ||
+ | ==== oVirt agent ==== | ||
+ | |||
+ | Installiamo il pacchetto relativo ai guest agent di oVirt | ||
+ | |||
+ | < | ||
+ | |||
+ | Eseguiamo i seguenti comandi per avviare il servizio e abilitarlo al boot: | ||
+ | |||
+ | < | ||
+ | systemctl enable ovirt-guest-agent.service | ||
+ | systemctl start ovirt-guest-agent.service | ||
+ | </ | ||
+ | |||
+ | ==== VMWare agent ==== | ||
+ | |||
+ | Installiamo il pacchetto relativo ai guest agent di VMWare | ||
+ | |||
+ | < | ||
+ | |||
+ | Eseguiamo i seguenti comandi per avviare il servizio e abilitarlo al boot: | ||
+ | |||
+ | < | ||
+ | systemctl enable vmtoolsd | ||
+ | systemctl start vmtoolsd | ||
+ | </ | ||
+ | |||
+ | === Disabilitare LRO sulle interfacce virtuali === | ||
+ | |||
+ | https:// | ||
+ | |||
+ | inserire in / | ||
+ | echo 'for if in `cat / | ||
+ | chmod +x / | ||
+ | ==== Disabilitare firewalld e abilitare iptables ==== | ||
+ | |||
+ | Per disabilitare '' | ||
+ | |||
+ | < | ||
+ | systemctl stop firewalld | ||
+ | systemctl disable firewalld | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | Installiamo quindi il pacchetto '' | ||
+ | |||
+ | < | ||
+ | |||
+ | Abilitiamo '' | ||
+ | |||
+ | < | ||
+ | |||
+ | Cancelliamo il contenuto del file ''/ | ||
+ | |||
+ | < | ||
+ | |||
+ | Infine avviamo il servizio e verifichiamo lo stato | ||
+ | |||
+ | < | ||
+ | systemctl start iptables | ||
+ | systemctl status iptables | ||
+ | </ | ||
+ | ==== check-mk agent ==== | ||
+ | |||
+ | Installiamo il pacchetto '' | ||
+ | |||
+ | < | ||
+ | |||
+ | Scarichiamo la versione corretta di check_mk_agent e il relativo file di configurazione di xinetd | ||
+ | < | ||
+ | curl http:// | ||
+ | curl http:// | ||
+ | chmod +x / | ||
+ | </ | ||
+ | |||
+ | Abilitiamo l' | ||
+ | |||
+ | < | ||
+ | systemctl enable xinetd | ||
+ | systemctl start xinetd | ||
+ | systemctl status xinetd | ||
+ | </ | ||
+ | |||
+ | ==== Log rate limit ==== | ||
+ | |||
+ | aggiungere a / | ||
+ | |||
+ | RateLimitInterval=0 | ||
+ | RateLimitBurst=0 | ||
+ | |||
+ | |||
+ | ==== Custom script ==== | ||
+ | |||
+ | Creiamo la directory ''/ | ||
+ | |||
+ | < | ||
+ | |||
+ | Copiamo nella directory appena create gli script: | ||
+ | |||
+ | * z-send.warnings | ||
+ | * summarize | ||
+ | |||
+ | < | ||
+ | |||
+ | |||
+ | ==== Log alert script ==== | ||
+ | |||
+ | Modifichiamo il file ''/ | ||
+ | |||
+ | < | ||
+ | local6.* | ||
+ | |||
+ | # Custom hourly warning mail | ||
+ | *.warning | ||
+ | |||
+ | # Send all logs to logsrv.lnf.infn.it | ||
+ | *.* | ||
+ | </ | ||
+ | |||
+ | |||
+ | Creiamo il file '' | ||
+ | |||
+ | < | ||
+ | |||
+ | Creiamo un link simbolico dallo script '' | ||
+ | |||
+ | < | ||
+ | |||
+ | Infine riavviamo il servizio '' | ||
+ | |||
+ | < | ||
+ | systemctl restart rsyslog | ||
+ | systemctl status rsyslog | ||
+ | </ | ||
+ | ==== Tivoli Storage Manager e configurazione backup ==== | ||
+ | |||
+ | Scarichiamo la versione client di Tivoli Storage Manager | ||
+ | |||
+ | < | ||
+ | |||
+ | Estraiamo il contenuto: | ||
+ | |||
+ | < | ||
+ | |||
+ | Lanciamo l' | ||
+ | |||
+ | < | ||
+ | |||
+ | Modifichiamo il file ''/ | ||
+ | |||
+ | <code bash> | ||
+ | cat > / | ||
+ | ************************************************************************ | ||
+ | * Tivoli Storage Manager | ||
+ | * * | ||
+ | * Sample Client System Options file for UNIX (dsm.sys.smp) | ||
+ | ************************************************************************ | ||
+ | |||
+ | * This file contains the minimum options required to get started | ||
+ | * using TSM. Copy dsm.sys.smp to dsm.sys. | ||
+ | * enter the appropriate values for each option listed below and | ||
+ | * remove the leading asterisk (*) for each one. | ||
+ | |||
+ | * If your client node communicates with multiple TSM servers, be | ||
+ | * sure to add a stanza, beginning with the SERVERNAME option, for | ||
+ | * each additional server. | ||
+ | |||
+ | ************************************************************************ | ||
+ | |||
+ | servername | ||
+ | commmethod | ||
+ | tcpport | ||
+ | tcpserveraddress | ||
+ | Inclexcl | ||
+ | passwordaccess | ||
+ | passworddir | ||
+ | nodename | ||
+ | users root | ||
+ | schedlogname | ||
+ | |||
+ | EOT | ||
+ | |||
+ | cat > / | ||
+ | ************************************************************************ | ||
+ | * Tivoli Storage Manager | ||
+ | * * | ||
+ | * Sample Client User Options file for UNIX (dsm.opt.smp) | ||
+ | ************************************************************************ | ||
+ | |||
+ | * This file contains an option you can use to specify the TSM | ||
+ | * server to contact if more than one is defined in your client | ||
+ | * system options file (dsm.sys). | ||
+ | * If you enter a server name for the option below, remove the | ||
+ | * leading asterisk (*). | ||
+ | |||
+ | ************************************************************************ | ||
+ | |||
+ | * SErvername | ||
+ | servername tsm01 | ||
+ | compressalways no | ||
+ | |||
+ | EOT | ||
+ | |||
+ | touch / | ||
+ | |||
+ | |||
+ | cat > / | ||
+ | [Unit] | ||
+ | Description=Tivoli Storage Manager Client Scheduler | ||
+ | After=network.target | ||
+ | |||
+ | [Service] | ||
+ | Type=simple | ||
+ | ExecStart=/ | ||
+ | StandardOutput=syslog | ||
+ | SyslogFacility=local6 | ||
+ | SyslogLevel=debug | ||
+ | StandardError=journal | ||
+ | KillMode=process | ||
+ | Restart=always | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target'' | ||
+ | EOT | ||
+ | |||
+ | </ | ||
+ | ==== Templatize script ==== | ||
+ | |||
+ | Configurati tutti i servizi precedenti è necessario eseguire il seguente script per ripulire la macchina da tutte le configurazioni non necessarie: | ||
+ | |||
+ | <code bash> | ||
+ | cat > / | ||
+ | #!/bin/bash | ||
+ | |||
+ | echo | ||
+ | echo Making this system as a template in 10 seconds... | ||
+ | sleep 10 | ||
+ | |||
+ | set -x | ||
+ | |||
+ | / | ||
+ | / | ||
+ | |||
+ | set -e | ||
+ | |||
+ | / | ||
+ | |||
+ | / | ||
+ | rm -rf / | ||
+ | |||
+ | / | ||
+ | /bin/rm -f / | ||
+ | /bin/rm -f / | ||
+ | /bin/rm -rf / | ||
+ | |||
+ | /bin/cat /dev/null > / | ||
+ | /bin/cat /dev/null > / | ||
+ | /bin/cat /dev/null > / | ||
+ | /bin/cat /dev/null > / | ||
+ | |||
+ | /bin/sed -r -i '/ | ||
+ | |||
+ | /bin/rm -f / | ||
+ | /bin/rm -rf /tmp/* | ||
+ | /bin/rm -rf /var/tmp/* | ||
+ | /bin/rm -f / | ||
+ | /bin/rm -f / | ||
+ | /bin/rm -f / | ||
+ | /bin/rm -f / | ||
+ | /bin/rm -f / | ||
+ | /bin/rm -f / | ||
+ | |||
+ | /bin/rm -f / | ||
+ | unset HISTFILE | ||
+ | |||
+ | hostnamectl set-hostname ' | ||
+ | newaliases | ||
+ | |||
+ | shutdown -h now | ||
+ | EOT | ||
+ | |||
+ | # bash / | ||
+ | |||
+ | </ |