View previous topic :: View next topic |
Author |
Message |
doom555 n00b
Joined: 29 Oct 2012 Posts: 57
|
Posted: Mon Oct 29, 2012 8:54 pm Post subject: [RISOLTO] Proteggere /etc/localtime dagli aggiornamenti |
|
|
Non riesco a capire perchè su questa installazione di Gentoo (profilo hardened) dopo l'aggiornamento di alcuni pacchetti mi viene sovrascritto /etc/localtime costringendomi ogni volta ad eseguire una copia da /usr/share/zoneinfo/Europe/Rome. Non ho impostato le variabili CONFIG_PROTECT e CONFIG_PROTECT_MASK nel make.conf , di default mi sembrano gia ok:
Code: | # emerge --info | grep CONFIG_PROTECT
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" |
Inoltre utilizzo anche un altra installazione di Gentoo (profilo desktop/gnome) dove comunque non ho configurato le due variabili e dove il problema non si presenta!
Da che cosa potrebbe dipendere? Viene aggiornato in automatico ogni volta!
Last edited by doom555 on Sun Nov 04, 2012 3:53 pm; edited 1 time in total |
|
Back to top |
|
|
ago Developer
Joined: 01 Mar 2008 Posts: 1527 Location: Milan, Italy
|
Posted: Mon Oct 29, 2012 10:24 pm Post subject: |
|
|
quel file viene sovrascritto da sys-libs/timezone-data. La prossima volta fai un controllo incrociato tra la data che riporta ls -la e qlop -l:
Code: | ago@devil ~ $ ls -la /etc/localtime
-rw-r--r-- 1 root root 2652 ott 21 15:04 /etc/localtime
ago@devil ~ $ qlop -l | grep "Oct 21"
Sun Oct 21 15:04:16 2012 >>> sys-libs/glibc-2.15-r3
Sun Oct 21 15:04:41 2012 >>> sys-libs/timezone-data-2012f
Sun Oct 21 15:05:19 2012 >>> app-arch/zip-3.0-r1
Sun Oct 21 15:06:31 2012 >>> dev-libs/libevent-2.0.20
Sun Oct 21 15:09:09 2012 >>> net-analyzer/ettercap-0.7.5_p20121020
Sun Oct 21 15:10:27 2012 >>> sys-fs/udev-171-r8
Sun Oct 21 15:11:22 2012 >>> net-libs/libproxy-0.4.10 |
Se vuoi usa chattr per bloccare il file o aggiungi un *.start in local.d che lo sovrascrive ad ogni avvio |
|
Back to top |
|
|
doom555 n00b
Joined: 29 Oct 2012 Posts: 57
|
Posted: Tue Oct 30, 2012 1:01 am Post subject: |
|
|
Si, l'aggiornamento di sys-libs/timezone-data mi sovrascrive il file, quello che non riesco a capire è perchè solo in questa installazione mi succede! |
|
Back to top |
|
|
pierino_89 Guru
Joined: 03 Oct 2009 Posts: 522
|
Posted: Thu Nov 01, 2012 8:57 pm Post subject: |
|
|
Non credo sia un male che il file venga sovrascritto con una versione aggiornata dello stesso... Se invece te ne mette un altro probabilmente hai settato la timezone male da qualche parte!
La prossima volta che te lo sovrascrive, cerca di capire con quale timezone viene sostituito. _________________ Linux registered user 461710 |
|
Back to top |
|
|
fbcyborg Advocate
Joined: 16 Oct 2005 Posts: 3056 Location: ROMA
|
|
Back to top |
|
|
ago Developer
Joined: 01 Mar 2008 Posts: 1527 Location: Milan, Italy
|
Posted: Sat Nov 03, 2012 11:04 am Post subject: |
|
|
Non serve impostare config_protect su quel file, quando timezone_data si aggiorna, si aggiorna anche quel file.
La cosa essenziale è che diff -ru /usr/share/zoneinfo/CET /etc/localtime non produca output. |
|
Back to top |
|
|
pierino_89 Guru
Joined: 03 Oct 2009 Posts: 522
|
Posted: Sat Nov 03, 2012 12:37 pm Post subject: |
|
|
Ancora più essenziale è che /etc/timezone sia corretto, dato che l'ebuild si basa sul contenuto di quel file per installare /etc/localtime:
Code: |
[...]
src="${ROOT}etc/timezone"
if [[ -e ${src} ]] ; then
tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
else
tz="FOOKABLOIE"
fi
[...]
[[ -L ${etc_lt} ]] && rm -f "${etc_lt}"
cp -f "${ROOT}"/usr/share/zoneinfo/"${tz}" "${etc_lt}"
|
_________________ Linux registered user 461710 |
|
Back to top |
|
|
doom555 n00b
Joined: 29 Oct 2012 Posts: 57
|
Posted: Sun Nov 04, 2012 3:26 pm Post subject: |
|
|
pierino_89 wrote: | Ancora più essenziale è che /etc/timezone sia corretto, dato che l'ebuild si basa sul contenuto di quel file per installare /etc/localtime:
Code: |
[...]
src="${ROOT}etc/timezone"
if [[ -e ${src} ]] ; then
tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
else
tz="FOOKABLOIE"
fi
[...]
[[ -L ${etc_lt} ]] && rm -f "${etc_lt}"
cp -f "${ROOT}"/usr/share/zoneinfo/"${tz}" "${etc_lt}"
|
|
Probabilmente ho risolto...
Non so perchè avevo configurato /etc/timezone così
Code: | # cat /etc/timezone
TIMEZONE="Europe/Rome" |
Ora provo a sostituire con:
riemergo sys-libs/timezone-data e vi faccio sapere...
RISOLTO |
|
Back to top |
|
|
|