Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
FG2: Ho dato "emerge < pacchetto-nome >", e
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30894
Location: here

PostPosted: Sat Sep 25, 2004 1:13 pm    Post subject: FG2: Ho dato "emerge < pacchetto-nome >", e Reply with quote

Navigazione: [ back FG1: Cosa sono le lettere in "[ebuild N]" ] [ next FG3: Come ottenere la lista dei pacchetti installati? ] [ Fondamenti Gentoo ] [ Indice ]


Ho dato "emerge < pacchetto-nome >", e alla fine ho ricevuto l'output: "xx config files need updating" Cosa faccio?


Le possibilità sono: l'output che avete visto avete visto è come questo:
Code:
* Regenerating GNU info directory index...
* Processed 70 info files.
* IMPORTANT: 40 config files in /etc need updating.
* Type emerge --help config to learn how to update config files.


Seguendo le indicazioni sopra digitiamo "emerge --help config", si avrà:
Quote:
Config file management support (preliminary)

Portage has a special feature called "config file protection". The purpose of
this feature is to prevent new package installs from clobbering existing
configuration files. By default, config file protection is turned on for /etc
and the KDE configuration dirs; more may be added in the future.

When Portage installs a file into a protected directory tree like /etc, any
existing files will not be overwritten. If a file of the same name already
exists, Portage will change the name of the to-be- installed file from 'foo' to
'._cfg0000_foo'. If '._cfg0000_foo' already exists, this name becomes
'._cfg0001_foo', etc. In this way, existing files are not overwritten,
allowing the administrator to manually merge the new config files and avoid any
unexpected changes.

In addition to protecting overwritten files, Portage will not delete any files
from a protected directory when a package is unmerged. While this may be a
little bit untidy, it does prevent potentially valuable config files from being
deleted, which is of paramount importance.

Protected directories are set using the CONFIG_PROTECT variable, normally
defined in /etc/make.globals. Directory exceptions to the CONFIG_PROTECTed
directories can be specified using the CONFIG_PROTECT_MASK variable. To find
files that need to be updated in /etc, type:

# find /etc -iname '._cfg????_*'

You can disable this feature by setting CONFIG_PROTECT="-*" in /etc/make.conf.
Then, Portage will mercilessly auto-update your config files. Alternatively,
you can leave Config File Protection on but tell Portage that it can overwrite
files in certain specific /etc subdirectories. For example, if you wanted
Portage to automatically update your rc scripts and your wget configuration,
but didn't want any other changes made without your explicit approval, you'd
add this to /etc/make.conf:

CONFIG_PROTECT_MASK="/etc/wget /etc/rc.d"



Questo mostra cosa di andrà a cambiare, non lo ripeterò dopo. Quindi, sappiamo usare il comando find per avere una lista di cosa necessita di essere aggiornata (find /etc -iname '._cfg????_*'). Per esempio, potreste vedere:
Code:
# find /etc -iname '._cfg????_*'
/etc/conf.d/._cfg0000_net
/etc/init.d/._cfg0000_clock
/etc/init.d/._cfg0000_bootmisc
/etc/init.d/._cfg0000_checkfs
/etc/skel/._cfg0000_.bash_profile
/etc/skel/._cfg0000_.bashrc
/etc/._cfg0000_fstab
/etc/._cfg0000_hosts
/etc/._cfg0000_modules.autoload


Nota: L'output cambierà in base al vostro sistema e al pacchetto emerso. Per semplificare, questo è soltanto un elenco parziale dopo aver effettuato un emerge.

Se, e ripeto, SE non avete fatto cambiamenti ad un file, è probabilmente più sicuro aggiornare. Ci sono due modi per aggionare i file di configurazione, e sono: il comando "diff" o il comando "etc-update".

Aggiornare con "diff":
/etc/init.d/bootmisc potrebbe essere un file che non ha subito cambiamenti. Questo è l'ouput se diamo il diff di questi files:
Code:
# diff  bootmisc ._cfg0000_bootmisc
3,4c3,4
< # Distributed under the terms of the GNU General Public License, v2 or later
< # $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/bootmisc,v 1.22 2002/11/04 14:51:07 azarah Exp $
---
> # Distributed under the terms of the GNU General Public License v2
> # $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/bootmisc,v 1.23 2002/11/18 13:07:02 azarah Exp $



Aggiornare con "etc-update":
Scrivete il comando
Code:
etc-update

ritorna qualcosa del genere:
Code:
Scanning Configuration files...
Automerging trivial changes in: sample-tls.cf
Automerging trivial changes in: transport
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
1) /etc/ffserver.conf
/etc/._cfg0000_ffserver.conf
2) /etc/apache2/conf/modules.d/70_mod_php.conf
/etc/apache2/conf/modules.d/._cfg0000_70_mod_php.conf
3) /etc/conf.d/hdparm
/etc/conf.d/._cfg0000_hdparm
4) /etc/php/cli-php4/php.ini
/etc/php/cli-php4/._cfg0000_php.ini
5) /etc/postfix/main.cf
/etc/postfix/._cfg0000_main.cf
6) /etc/postfix/postfix-script
/etc/postfix/._cfg0000_postfix-script
7) /etc/postfix/sample/sample-ipv6.cf
/etc/postfix/sample/._cfg0000_sample-ipv6.cf
8) /etc/sound/events/gnomemeeting.soundlist
/etc/sound/events/._cfg0000_gnomemeeting.soundlist
Please select a file to edit by entering the corresponding number.
(-1 to exit) (-3 to auto merge all remaining files)
(-5 to auto-merge AND not use 'mv -i'):

Selezionando qualch'uno di questi file (con il numero) la lista produce questo:
Code:
Showing differences between /etc/postfix/main.cf and /etc/postfix/._cfg0000_main.cf
--- /etc/postfix/main.cf 2003-06-21 02:27:20.000000000 -0700
+++ /etc/postfix/._cfg0000_main.cf 2003-06-30 06:47:17.000000000 -0700
@@ -206,8 +206,8 @@
# with 450 (try again later) until you are certain that your
# local_recipient_maps settings are OK.
#
-unknown_local_recipient_reject_code = 550
-#unknown_local_recipient_reject_code = 450
+#unknown_local_recipient_reject_code = 550
+unknown_local_recipient_reject_code = 450

# "Maildir/" for qmail-style delivery (the / is required).
#
#home_mailbox = Mailbox
-#home_mailbox = .maildir/
+home_mailbox = .maildir/
+home_mailbox = .maildir/

# The mail_spool_directory parameter specifies the directory where
# UNIX-style mailboxes are kept. The default setting depends on the
# system type.
#
-mail_spool_directory = /var/mail
+#mail_spool_directory = /var/mail
#mail_spool_directory = /var/spool/mail

# The mailbox_command parameter specifies the optional external
@@ -635,4 +635,4 @@

# readme_directory: The location of the Postfix README files.
#
-readme_directory = /usr/share/doc/postfix-2.0.12-r1
+readme_directory = /usr/share/doc/postfix-2.0.131) Replace original with update
2) Delete update, keeping original as is
3) Interactively merge original with update
4) Show differences again
Please select from the menu above (-1 to ignore this update):


Il file si configurazione main.cf di postfix e' stato schelto perche' rappresenta un caso in cui il file e' stato modificato a mano e potrebbe causare un mal funzionamento del mail server se la configurazione fosse riscritta nello stesso file.

Questo e' lo stesso output che abbiamo utilizzando il comando "diff", ma abbiamo a disposizione diverse opzioni:
Code:
1) Sovrascrivere il file originale con l'aggiornamento
2) Rimuovere l'aggiornamento e mantenere l'originale
3) Creare interattivamente un nuovo file unendo l'originale con l'aggiornamento
4) Mostrare nuovamente le differenze
-1 Ignorare questo aggiornamento

Che possono essere analizzate come segue:
Code:
1) Se l'aggiornamento sembra abbastanza insignificante, avanti e sovrascrivi l'originale.
2) Se l'aggiornamento non e' necessario, mantieni l'originale
3) Osservare i cambiamenti e scegliere i cambiamenti da tenere. Questa e' l'opzione che offre maggior flessibilita'
4) Mostrare le differenze fra i due file


L'opzione interattiva (# 3) visualizza le differenze una alla volta, offrendo una scelta di cui cambiamento mantenere.

Qua e' l'opzione in azione:
Code:
/etc/postfix/._cfg0000_main.cf /etc/postfix/main.cf /etc/postfix/main.cf.merged
Merging /etc/postfix/._cfg0000_main.cf and /etc/postfix/main.cf
unknown_local_recipient_reject_code = 550 | #unknown_local_recipient_reject_code = 550
#unknown_local_recipient_reject_code = 450 | unknown_local_recipient_reject_code = 450



Il file visualizzato ha sulla sinistra l'originale e a destra la nuova configurazione. In questo particolare caso, il cambiamento fatto alla configurazione deve rimanere cosi'. Premendo "l" manterra' la modifica.
Code:
%l
#home_mailbox = .maildir/ | home_mailbox = .maildir/
> home_mailbox = .maildir/


Di nuovo, questo è un cambiamento che non dovrebbe essere fatto, scrivere "l" per mantenere questa linea intatta.
Code:
%l
readme_directory = /usr/share/doc/postfix-2.0.12-r1 | readme_directory = /usr/share/doc/postfix-2.0.13


Sopra c'e' un esempio di configurazione che ha informazioni piu' utili. Poiche' la documentazione ha cambiato locazione bisogna aggiornare questa configurazione. Digitando "r" si seleziona la colonna di destra (aggiornamento).

Code:
%r
1) Replace /etc/postfix/main.cf with merged file
2) Show differences between merged file and original
3) Remerge original with update
4) Return to the previous menu
Please select from the menu above (-1 to exit, losing this merge):



A questo punto, e' stato generato un file temporaneo che contiene i dati originali e quelli che si sono scelti di cambiare.

Queste quattro opzioni fanno quanto segue:
1) Sovrascivere il file originale con quello temporaneo creato da noi con i passi precedenti
2) Visualizzare le differenze tra il file originale e quello creato da noi.
3) Iniziare il processo di merging con il file creato e quello originale.
4) Non fare cambiamenti e ritornare alla lista dei file da aggiornare.

Selezionando l'opzione q per sostituire il file di configurazione originale otteniamo:
Code:
Replacing /etc/postfix/main.cf with /etc/postfix/main.cf.merged
mv: overwrite `/etc/postfix/main.cf'?
rm: remove regular file `/etc/postfix/._cfg0000_main.cf'?


Cofermate la sovrascrizione del file originale con un semplice "y". Inoltre, sempre con un "y", confermate l'eliminazione del file ._cfg????_* cosi che portage non richieda piu' l'update al prossimo etc-update.

Dopo la conferma dell'aggiornamento ritornerete alla lista dei file da aggiornare (con l'esclusione di quelli che abbiamo gia' aggiornato):
The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files.
Code:
1) /etc/ffserver.conf
/etc/._cfg0000_ffserver.conf
2) /etc/apache2/conf/modules.d/70_mod_php.conf
/etc/apache2/conf/modules.d/._cfg0000_70_mod_php.conf
3) /etc/conf.d/hdparm
/etc/conf.d/._cfg0000_hdparm
4) /etc/php/cli-php4/php.ini
/etc/php/cli-php4/._cfg0000_php.ini6) /etc/postfix/postfix-script
/etc/postfix/._cfg0000_postfix-script
7) /etc/postfix/sample/sample-ipv6.cf
/etc/postfix/sample/._cfg0000_sample-ipv6.cf
8) /etc/sound/events/gnomemeeting.soundlist
/etc/sound/events/._cfg0000_gnomemeeting.soundlist
Please select a file to edit by entering the corresponding number.
(-1 to exit) (-3 to auto merge all remaining files)
(-5 to auto-merge AND not use 'mv -i'):


Dopo che tutti i file sono stati controllati e aggiornati controllate che etc-update termini con:
Code:
Exiting: Nothing left to do; exiting. :)



Autore prima parte: pjp (testo originale)
Autore (etc-update): papabean (testo originale)

Traduttore prima parte: GianX
Traduttore (etc-update): fedeliallalinea
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Cazzantonio
Bodhisattva
Bodhisattva


Joined: 20 Mar 2004
Posts: 4514
Location: Somewere around the world

PostPosted: Sat Sep 25, 2004 5:31 pm    Post subject: Reply with quote

C'è anche il comando dispatch-conf che ha un funzionamento simile ad etc-update ma consente anche (tra le altre cose) di fare automaticamente un backup dei vechi files di configurazione
Per usarlo basta creare una directory dove salvare i vecchi files (di default è /etc/config-archive/ )
Code:
mkdir /etc/config-archive/

il file di configurazione per dispatch-conf è /etc/dispatch-conf.conf che viene creato al primo avvio del programma
Code:
man dispatch-conf
ha tutte le informazioni che si possono desiderare sul suo funzionamento ed è semplice e sintetico
_________________
Any mans death diminishes me, because I am involved in Mankinde; and therefore never send to know for whom the bell tolls; It tolls for thee.
-John Donne
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum