View previous topic :: View next topic |
Author |
Message |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 10:02 am Post subject: Script TMPFS... |
|
|
Salve, ho trovato sulla Gentoo-Wiki uno scriptino che attiva automaticamente tmpfs quando si lancia emerge (lo chiamano "temerge"). Ora, come faccio a poterlo lanciare da qualsiasi cartella (come il vero emerge) invece di dovermi spostare ogni volta nella cartella dove l'ho messo? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lucapost Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/17095691174866151fd78ae.gif)
Joined: 24 Nov 2005 Posts: 1419 Location: <ud|me|ts> - Italy
|
Posted: Thu Nov 27, 2008 10:39 am Post subject: |
|
|
da root:
Code: | mv temerge /usr/local/bin/ |
_________________ LP |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 10:48 am Post subject: |
|
|
E' già in quella cartella... Può entrarci qualcosa il non aver riavviato? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
IlGab Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Megaman/megamanx.gif)
Joined: 26 Nov 2004 Posts: 486
|
Posted: Thu Nov 27, 2008 10:57 am Post subject: |
|
|
Hav0c wrote: | E' già in quella cartella... Può entrarci qualcosa il non aver riavviato? |
AAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaa riavvio windows style
chmod +x /usr/local/bin/temerge
Last edited by IlGab on Thu Nov 27, 2008 11:08 am; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 11:04 am Post subject: |
|
|
IlGab wrote: | Hav0c wrote: | E' già in quella cartella... Può entrarci qualcosa il non aver riavviato? |
AAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaa riavvito windows style
chmod +x /usr/local/bin/temerge |
Già fatto... Per la precisione ho usato:
chmod u+x |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
IlGab Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Megaman/megamanx.gif)
Joined: 26 Nov 2004 Posts: 486
|
Posted: Thu Nov 27, 2008 11:07 am Post subject: |
|
|
Hav0c wrote: | IlGab wrote: | Hav0c wrote: | E' già in quella cartella... Può entrarci qualcosa il non aver riavviato? |
AAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaa riavvito windows style
chmod +x /usr/local/bin/temerge |
Già fatto... Per la precisione ho usato:
chmod u+x |
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 11:09 am Post subject: |
|
|
Quote: | havoc@Hal9001 ~ $ echo $path
havoc@Hal9001 ~ $ su
Password:
Hal9001 havoc # echo $path
Hal9001 havoc # |
Mi sa che c'è qualcosa che non va XD[/quote] |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
IlGab Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Megaman/megamanx.gif)
Joined: 26 Nov 2004 Posts: 486
|
Posted: Thu Nov 27, 2008 11:10 am Post subject: |
|
|
Hav0c wrote: | Quote: | havoc@Hal9001 ~ $ echo $path
havoc@Hal9001 ~ $ su
Password:
Hal9001 havoc # echo $path
Hal9001 havoc # |
Mi sa che c'è qualcosa che non va XD |
Sembra una chat
$PATH in maiuscolo |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 11:13 am Post subject: |
|
|
Ops
Quote: | havoc@Hal9001 ~ $ echo $PATH
/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2:/usr/games/bin
havoc@Hal9001 ~ $
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lucapost Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/17095691174866151fd78ae.gif)
Joined: 24 Nov 2005 Posts: 1419 Location: <ud|me|ts> - Italy
|
Posted: Thu Nov 27, 2008 11:14 am Post subject: |
|
|
posta il risultato di:
_________________ LP |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
IlGab Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Megaman/megamanx.gif)
Joined: 26 Nov 2004 Posts: 486
|
Posted: Thu Nov 27, 2008 11:14 am Post subject: |
|
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 11:16 am Post subject: |
|
|
Quote: | havoc@Hal9001 ~ $ which temerge
which: no temerge in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2:/usr/games/bin) |
Solo che temerge in realtà c'è...
Quote: | havoc@Hal9001 ~ $ cd /usr/local/bin
havoc@Hal9001 /usr/local/bin $ ls
temerge
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
IlGab Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Megaman/megamanx.gif)
Joined: 26 Nov 2004 Posts: 486
|
Posted: Thu Nov 27, 2008 11:18 am Post subject: |
|
|
Hav0c wrote: | Quote: | havoc@Hal9001 ~ $ which temerge
which: no temerge in (/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2:/usr/games/bin) |
Solo che temerge in realtà c'è...
Quote: | havoc@Hal9001 ~ $ cd /usr/local/bin
havoc@Hal9001 /usr/local/bin $ ls
temerge
|
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 11:19 am Post subject: |
|
|
Quote: | havoc@Hal9001 ~ $ cd /usr/local/bin
havoc@Hal9001 /usr/local/bin $ ls -la
totale 12
drwxr-xr-x 2 root root 4096 27 nov 10:52 .
drwxr-xr-x 9 root root 4096 17 giu 19:37 ..
-rw-r--r-- 1 root root 0 17 giu 19:37 .keep
-rwxr--r-- 1 root root 576 27 nov 10:52 temerge
havoc@Hal9001 /usr/local/bin $
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
IlGab Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Megaman/megamanx.gif)
Joined: 26 Nov 2004 Posts: 486
|
Posted: Thu Nov 27, 2008 11:20 am Post subject: |
|
|
Il file è eseguibile solo per root.
chmod +x temerge |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 11:22 am Post subject: |
|
|
Continua a non funzionare...
Quote: | havoc@Hal9001 ~ $ su
Password:
Hal9001 havoc # cd /usr/local/bin
Hal9001 bin # chmod +x temerge
Hal9001 bin # temerge -s mozilla-firefox
bash: temerge: command not found
Hal9001 bin #
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 11:33 am Post subject: |
|
|
Colpo di scena... temerge mi funziona come utente non root, solo che...
Quote: | Hal9001 bin # temerge gamin
bash: temerge: command not found
Hal9001 bin # exit
exit
havoc@Hal9001 ~ $ temerge gamin
* Mounting 3000M of memory to /var/tmp/portage ...
mount: è possibile solo per root [ ok ]
* emerging gamin
emerge: superuser access is required.
* unmounting tmpfs ...
umount: solo root può farlo [ !! ]
havoc@Hal9001 ~ $
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
djinnZ Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/3978748614ef08bfa7f764.jpg)
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Thu Nov 27, 2008 12:43 pm Post subject: |
|
|
è uno script bash per caso? hai mai provato a dare uno sguardo qui? _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist ![Wink :wink:](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 1:06 pm Post subject: |
|
|
djinnZ wrote: | è uno script bash per caso? hai mai provato a dare uno sguardo qui? |
lo script è questo:
Quote: | #!/bin/bash
MEMSIZE=850M
mounted=false
. /etc/init.d/functions.sh
mounttmpfs() {
mount -t tmpfs tmpfs -o size=$MEMSIZE /var/tmp/portage
mounted="true"
}
compile() {
einfo "emerging ${*}"
emerge ${*}
}
unmount() {
ebegin "unmounting tmpfs"
umount -f /var/tmp/portage
eend $?
}
ebegin "Mounting $MEMSIZE of memory to /var/tmp/portage"
if [ -z "$(mount | grep /var/tmp/portage)" ]
then
mounttmpfs
else
eerror "tmpfs already mounted!"
exit 0
fi
eend $?
compile ${*}
if [ -n "$mounted" ]
then
unmount
fi |
(io ho impostato MEMSIZE=3000M avendo 4 gb di ram)
Il link al momento non mi si apre, fra qualche minuto riprovo |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Peach Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/113917422347ec3b2cbcf21.gif)
Joined: 08 Mar 2003 Posts: 3686 Location: London, UK
|
Posted: Thu Nov 27, 2008 2:59 pm Post subject: |
|
|
djinnZ wrote: | è uno script bash per caso? hai mai provato a dare uno sguardo qui? |
abbiamo ancora problemi con sourceforge che non ci da output
meglio guardare qui:
http://www.gechi.it/node/15 _________________ Gentoo user since 2004.
"It's all fun and games, until someone loses an eye" - mom |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
lucapost Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/17095691174866151fd78ae.gif)
Joined: 24 Nov 2005 Posts: 1419 Location: <ud|me|ts> - Italy
|
Posted: Thu Nov 27, 2008 3:49 pm Post subject: |
|
|
[quote="Hav0c"]
Quote: |
...
MEMSIZE=850M
...
mount -t tmpfs tmpfs -o size=$MEMSIZE /var/tmp/portage
...
|
non serve a nulla, se non sbaglio è scritto qui: https://forums.gentoo.org/viewtopic-t-469501-highlight-bashrcng.html
se hai più di 1Gb di ram, il mio consiglio è di aggiungere queste righe a /etc/fstab:
Code: | none /var/tmp/ tmpfs auto 0 0
none /tmp/ tmpfs auto 0 0 |
quando devi compilare gcc, wxgtk, openoffice, ecc ricordati di smontare /var/tmp _________________ LP |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
IlGab Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Megaman/megamanx.gif)
Joined: 26 Nov 2004 Posts: 486
|
Posted: Thu Nov 27, 2008 4:25 pm Post subject: |
|
|
Non ti monta il disco perchè solo root può farlo e non un utente normale a meno che non usi sudo o robe simili.
Nella man page di mount non ho trovato opzioni relative al fatto che possa essere montato da utente.
Ad ogni modo non vedo perchè tu debba farlo da utente quando, a quanto mi risulta, devi essere root per installare pacchetti sul sistema
edit: perchè montare 1GB in /tmp ??? viene usata in compilazione ? non mi risulta... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
djinnZ Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/3978748614ef08bfa7f764.jpg)
Joined: 02 Nov 2006 Posts: 4831 Location: somewhere in L.O.S.
|
Posted: Thu Nov 27, 2008 4:32 pm Post subject: |
|
|
Code: | none /var/tmp/ tmpfs noauto,users 0 0 | in fstab non mi risulta che tmpfs sia un'eccezione. _________________ scita et risus abundant in ore stultorum sed etiam semper severi insani sunt
mala tempora currunt...mater stultorum semper pregna est
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist ![Wink :wink:](images/smiles/icon_wink.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hav0c n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Jul 2008 Posts: 38 Location: Sunset Strip
|
Posted: Thu Nov 27, 2008 5:33 pm Post subject: |
|
|
IlGab wrote: | Non ti monta il disco perchè solo root può farlo e non un utente normale a meno che non usi sudo o robe simili.
Nella man page di mount non ho trovato opzioni relative al fatto che possa essere montato da utente.
Ad ogni modo non vedo perchè tu debba farlo da utente quando, a quanto mi risulta, devi essere root per installare pacchetti sul sistema
edit: perchè montare 1GB in /tmp ??? viene usata in compilazione ? non mi risulta... |
Il problema è che se provo a lanciare temerge (non facendo ./temerge, bensì scrivendo proprio "temerge") dice command not found |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
riverdragon Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1612070051450d4028d2ee7.jpg)
Joined: 14 Sep 2006 Posts: 1269 Location: Verona
|
Posted: Thu Nov 27, 2008 7:19 pm Post subject: |
|
|
Domanda generale: ha qualche utilità montare e smontare ripetutamente /var/tmp/portage in RAM anziché tenerlo sempre montato? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|