Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Script TMPFS...
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
Hav0c
n00b
n00b


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 10:02 am    Post subject: Script TMPFS... Reply with quote

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


Joined: 24 Nov 2005
Posts: 1415
Location: <ud|me|ts> - Italy

PostPosted: Thu Nov 27, 2008 10:39 am    Post subject: Reply with quote

da root:
Code:
mv temerge /usr/local/bin/

_________________
LP
Back to top
View user's profile Send private message
Hav0c
n00b
n00b


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 10:48 am    Post subject: Reply with quote

E' già in quella cartella... Può entrarci qualcosa il non aver riavviato?
Back to top
View user's profile Send private message
IlGab
Guru
Guru


Joined: 26 Nov 2004
Posts: 486

PostPosted: Thu Nov 27, 2008 10:57 am    Post subject: Reply with quote

Hav0c wrote:
E' già in quella cartella... Può entrarci qualcosa il non aver riavviato?


AAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaa riavvio windows style 8O

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


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 11:04 am    Post subject: Reply with quote

IlGab wrote:
Hav0c wrote:
E' già in quella cartella... Può entrarci qualcosa il non aver riavviato?


AAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaa riavvito windows style 8O

chmod +x /usr/local/bin/temerge


Già fatto... Per la precisione ho usato:

chmod u+x
Back to top
View user's profile Send private message
IlGab
Guru
Guru


Joined: 26 Nov 2004
Posts: 486

PostPosted: Thu Nov 27, 2008 11:07 am    Post subject: Reply with quote

Hav0c wrote:
IlGab wrote:
Hav0c wrote:
E' già in quella cartella... Può entrarci qualcosa il non aver riavviato?


AAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaa riavvito windows style 8O

chmod +x /usr/local/bin/temerge


Già fatto... Per la precisione ho usato:

chmod u+x


Code:
echo $PATH
Back to top
View user's profile Send private message
Hav0c
n00b
n00b


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 11:09 am    Post subject: Reply with quote

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


Joined: 26 Nov 2004
Posts: 486

PostPosted: Thu Nov 27, 2008 11:10 am    Post subject: Reply with quote

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


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 11:13 am    Post subject: Reply with quote

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


Joined: 24 Nov 2005
Posts: 1415
Location: <ud|me|ts> - Italy

PostPosted: Thu Nov 27, 2008 11:14 am    Post subject: Reply with quote

posta il risultato di:
Code:
which temerge

_________________
LP
Back to top
View user's profile Send private message
IlGab
Guru
Guru


Joined: 26 Nov 2004
Posts: 486

PostPosted: Thu Nov 27, 2008 11:14 am    Post subject: Reply with quote

Code:
which temerge
Back to top
View user's profile Send private message
Hav0c
n00b
n00b


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 11:16 am    Post subject: Reply with quote

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


Joined: 26 Nov 2004
Posts: 486

PostPosted: Thu Nov 27, 2008 11:18 am    Post subject: Reply with quote

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

Code:
ls -la
Back to top
View user's profile Send private message
Hav0c
n00b
n00b


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 11:19 am    Post subject: Reply with quote

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


Joined: 26 Nov 2004
Posts: 486

PostPosted: Thu Nov 27, 2008 11:20 am    Post subject: Reply with quote

Il file è eseguibile solo per root.
chmod +x temerge
Back to top
View user's profile Send private message
Hav0c
n00b
n00b


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 11:22 am    Post subject: Reply with quote

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


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 11:33 am    Post subject: Reply with quote

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


Joined: 02 Nov 2006
Posts: 4831
Location: somewhere in L.O.S.

PostPosted: Thu Nov 27, 2008 12:43 pm    Post subject: Reply with quote

è 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:wink:
mala tempora currunt...mater stultorum semper pregna est :evil:
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist :wink:
Back to top
View user's profile Send private message
Hav0c
n00b
n00b


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 1:06 pm    Post subject: Reply with quote

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


Joined: 08 Mar 2003
Posts: 3686
Location: London, UK

PostPosted: Thu Nov 27, 2008 2:59 pm    Post subject: Reply with quote

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


Joined: 24 Nov 2005
Posts: 1415
Location: <ud|me|ts> - Italy

PostPosted: Thu Nov 27, 2008 3:49 pm    Post subject: Reply with quote

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


Joined: 26 Nov 2004
Posts: 486

PostPosted: Thu Nov 27, 2008 4:25 pm    Post subject: Reply with quote

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


Joined: 02 Nov 2006
Posts: 4831
Location: somewhere in L.O.S.

PostPosted: Thu Nov 27, 2008 4:32 pm    Post subject: Reply with quote

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:wink:
mala tempora currunt...mater stultorum semper pregna est :evil:
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist :wink:
Back to top
View user's profile Send private message
Hav0c
n00b
n00b


Joined: 03 Jul 2008
Posts: 38
Location: Sunset Strip

PostPosted: Thu Nov 27, 2008 5:33 pm    Post subject: Reply with quote

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


Joined: 14 Sep 2006
Posts: 1269
Location: Verona

PostPosted: Thu Nov 27, 2008 7:19 pm    Post subject: Reply with quote

Domanda generale: ha qualche utilità montare e smontare ripetutamente /var/tmp/portage in RAM anziché tenerlo sempre montato?
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
Goto page 1, 2  Next
Page 1 of 2

 
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