Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[RISOLTO] Proteggere /etc/localtime dagli aggiornamenti
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)
View previous topic :: View next topic  
Author Message
doom555
n00b
n00b


Joined: 29 Oct 2012
Posts: 57

PostPosted: Mon Oct 29, 2012 8:54 pm    Post subject: [RISOLTO] Proteggere /etc/localtime dagli aggiornamenti Reply with quote

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
View user's profile Send private message
ago
Developer
Developer


Joined: 01 Mar 2008
Posts: 1527
Location: Milan, Italy

PostPosted: Mon Oct 29, 2012 10:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
doom555
n00b
n00b


Joined: 29 Oct 2012
Posts: 57

PostPosted: Tue Oct 30, 2012 1:01 am    Post subject: Reply with quote

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
View user's profile Send private message
pierino_89
Guru
Guru


Joined: 03 Oct 2009
Posts: 522

PostPosted: Thu Nov 01, 2012 8:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
fbcyborg
Advocate
Advocate


Joined: 16 Oct 2005
Posts: 3056
Location: ROMA

PostPosted: Sat Nov 03, 2012 10:55 am    Post subject: Reply with quote

Ciao,

per proteggere un file dall'aggiornamento quando si aggiorna un package puoi inserire la seguente riga in /etc/portage/make.conf:

Code:
CONFIG_PROTECT="/path/al/file.conf"

_________________
[HOWTO] Come criptare la /home usando cryptsetup e luks
[HOWTO] Abilitare il supporto al dom0 XEN su kernel 3.X
Help answer the unanswered
Back to top
View user's profile Send private message
ago
Developer
Developer


Joined: 01 Mar 2008
Posts: 1527
Location: Milan, Italy

PostPosted: Sat Nov 03, 2012 11:04 am    Post subject: Reply with quote

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
View user's profile Send private message
pierino_89
Guru
Guru


Joined: 03 Oct 2009
Posts: 522

PostPosted: Sat Nov 03, 2012 12:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
doom555
n00b
n00b


Joined: 29 Oct 2012
Posts: 57

PostPosted: Sun Nov 04, 2012 3:26 pm    Post subject: Reply with quote

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:
Code:
Europe/Rome

riemergo sys-libs/timezone-data e vi faccio sapere...

RISOLTO
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) 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