Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Come continuare uno script bash dopo chroot?
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) Forum di discussione italiano
View previous topic :: View next topic  
Author Message
diego_82
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 257
Location: Londra

PostPosted: Mon Dec 11, 2006 11:02 am    Post subject: [solved] Come continuare uno script bash dopo chroot? Reply with quote

Salve a tutti. Sto creando un piccolo script per automatizzare alcune fasi dell'installazione della mia amatissima gentoo. Il problema è che ho scoperto che, se effettuo un chroot, il flusso dello script si blocca, quindi non vengono eseguite le istruzioni successive. Esiste un modo per far continuare lo script senza che si blocchi dopo il chroot?

Grazie. Diego.


Last edited by diego_82 on Mon Dec 11, 2006 12:23 pm; edited 1 time in total
Back to top
View user's profile Send private message
crisandbea
Veteran
Veteran


Joined: 03 Jul 2005
Posts: 1778
Location: BOSCO (SA) ... ma domiciliato a Bologna....

PostPosted: Mon Dec 11, 2006 11:05 am    Post subject: Re: Come continuare uno script bash dopo chroot? Reply with quote

diego_82 wrote:
Salve a tutti. Sto creando un piccolo script per automatizzare alcune fasi dell'installazione della mia amatissima gentoo. Il problema è che ho scoperto che, se effettuo un chroot, il flusso dello script si blocca, quindi non vengono eseguite le istruzioni successive. Esiste un modo per far continuare lo script senza che si blocchi dopo il chroot?

Grazie. Diego.


in cosa si blocca???

ciauz
Back to top
View user's profile Send private message
diego_82
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 257
Location: Londra

PostPosted: Mon Dec 11, 2006 11:17 am    Post subject: Reply with quote

Code:
operazione 1
operazione 2
chroot /mnt/gentoo /bin/bash


Dopo il chroot non effettua le operazioni successive.
Back to top
View user's profile Send private message
Luca89
Advocate
Advocate


Joined: 27 Apr 2005
Posts: 2107
Location: Agrigento (Italy)

PostPosted: Mon Dec 11, 2006 11:21 am    Post subject: Reply with quote

diego_82 wrote:
Dopo il chroot non effettua le operazioni successive.


Ovvio, perchè il chroot apre una subshell che non puoi controllare dal processo madre, prova uno di questi due modi:

Code:
chroot /mnt/gentoo /bin/bash <<EOF
comando
comando
comando
EOF


oppure

Code:
chroot /mnt/gentoo /bin/bash -c "
comando
comando
comando"

_________________
Running Fast!
Back to top
View user's profile Send private message
diego_82
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 257
Location: Londra

PostPosted: Mon Dec 11, 2006 11:29 am    Post subject: Reply with quote

Ti ringrazio provo subito.
Back to top
View user's profile Send private message
diego_82
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 257
Location: Londra

PostPosted: Mon Dec 11, 2006 12:22 pm    Post subject: Reply with quote

Luca89 wrote:

Code:
chroot /mnt/gentoo /bin/bash -c "
comando
comando
comando"


Perfetto! Così funziona alla grande! Grazie!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Forum di discussione italiano 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