Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] RedHat like 'service'
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) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
X-Drum
Advocate
Advocate


Joined: 24 Aug 2003
Posts: 2517
Location: ('Modica','Trieste','Ferrara') Italy

PostPosted: Mon Jun 07, 2004 9:53 pm    Post subject: [TIP] RedHat like 'service' Reply with quote

Salve allz!

avete presente il comodo 'service' di RedHat per la gestione dei servizi?
Code:
service nomeservizio start!stop!restart

ho trovato su internet uno script semplicissimo che lo 'emula' anche sotto gentoo!
in tal modo è possibile omettere il fullpath in cui risiede lo script del servizio
a me sembra molto comodo :D

l'ho messo in /sbin con questi permessi:
Code:
Access: (0700/-rwx------)  Uid: (    0/    root)   Gid: (    0/    root)


ecco lo script:
Code:
#!/bin/bash
# RedHat like 'service'
/etc/init.d/`echo $1` `echo $2` 2> ${HOME}/.serviceerror

_________________
"...There are two sort of lies, lies and benchmarks..."
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Mon Jun 07, 2004 11:52 pm    Post subject: Reply with quote

ma ce ne e' veramente bisogno?
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
X-Drum
Advocate
Advocate


Joined: 24 Aug 2003
Posts: 2517
Location: ('Modica','Trieste','Ferrara') Italy

PostPosted: Tue Jun 08, 2004 12:21 am    Post subject: Reply with quote

se sei schifosamente pigro come me ed in una giornata di lavoro lanci,rilanci 300mila volte servizi vari...la risposta è si! :lol:
ovvimamente si puo' vivere senza....tranquillamente
_________________
"...There are two sort of lies, lies and benchmarks..."
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Tue Jun 08, 2004 6:29 am    Post subject: Reply with quote

FonderiaDigitale wrote:
ma ce ne e' veramente bisogno?


Quoto.

E comunque per una sola riga avrei fatto una funzione da mettere nel .bashrc ;-)

Qualcosa tipo:
Code:

function service {
   /etc/init.d/`echo $1` `echo $2` 2> ${HOME}/.serviceerror
}

_________________
Ciao da me!
Back to top
View user's profile Send private message
X-Drum
Advocate
Advocate


Joined: 24 Aug 2003
Posts: 2517
Location: ('Modica','Trieste','Ferrara') Italy

PostPosted: Tue Jun 08, 2004 8:43 am    Post subject: Reply with quote

ah che lo deve uare solo root
_________________
"...There are two sort of lies, lies and benchmarks..."
Back to top
View user's profile Send private message
zUgLiO
l33t
l33t


Joined: 12 Aug 2003
Posts: 754
Location: Ferrara (Italy)

PostPosted: Tue Jun 08, 2004 8:51 am    Post subject: Reply with quote

allora metti il .bashrc solo in /root :D
_________________

voglio poi dire che il tempo mi avrà fatto abituare,

ma io non trovo nemmeno brutta la stiva buia di questa nave
Back to top
View user's profile Send private message
X-Drum
Advocate
Advocate


Joined: 24 Aug 2003
Posts: 2517
Location: ('Modica','Trieste','Ferrara') Italy

PostPosted: Tue Jun 08, 2004 8:52 am    Post subject: Reply with quote

usatelo!
_________________
"...There are two sort of lies, lies and benchmarks..."
Back to top
View user's profile Send private message
kaio
Apprentice
Apprentice


Joined: 26 Aug 2003
Posts: 293
Location: Gorizia - IT

PostPosted: Tue Jun 08, 2004 9:01 am    Post subject: Reply with quote

FonderiaDigitale wrote:
ma ce ne e' veramente bisogno?

Sottoscrivo in pieno anche perchè non vedo l'utilità quando basta fare:
Code:
/etc/init.d/nomeservizio start|stop|status|pause|zap
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30822
Location: here

PostPosted: Tue Jun 08, 2004 9:04 am    Post subject: Reply with quote

Posso capire che sia comodo, ma io preferisco scrivere /etc/init.d/servizio azione.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
zUgLiO
l33t
l33t


Joined: 12 Aug 2003
Posts: 754
Location: Ferrara (Italy)

PostPosted: Tue Jun 08, 2004 9:08 am    Post subject: Reply with quote

Code:

service nomeservizio start!stop!restart

2 TAB + al max 7 caratteri

Code:

/etc/init.d/nomeservizio start|stop|status|pause|zap|restart

3 TAB + al max 7 caratteri

Vince il service :D
_________________

voglio poi dire che il tempo mi avrà fatto abituare,

ma io non trovo nemmeno brutta la stiva buia di questa nave
Back to top
View user's profile Send private message
flyinspirit001
Apprentice
Apprentice


Joined: 25 May 2004
Posts: 266
Location: localhost,localdomain

PostPosted: Tue Jun 08, 2004 9:08 am    Post subject: Reply with quote

Anche io sono d'accordo con coloro che non lo ritengono necessario..dopo una vita a fare start/stop dei servizi ci ho preso troppo la mano.. e poi tutti i miei alias? hihihi ;)
_________________
"Ride the infinity, be your best. For you, for all"
Dungeon01 - linux registered user #362502
Back to top
View user's profile Send private message
X-Drum
Advocate
Advocate


Joined: 24 Aug 2003
Posts: 2517
Location: ('Modica','Trieste','Ferrara') Italy

PostPosted: Tue Jun 08, 2004 9:50 am    Post subject: Reply with quote

ok ok Mi cospargo il capo di cenere.....LOL
_________________
"...There are two sort of lies, lies and benchmarks..."
Back to top
View user's profile Send private message
shanghai
Guru
Guru


Joined: 08 Feb 2004
Posts: 493
Location: Roma, Italia, GeekLand

PostPosted: Tue Jun 08, 2004 11:13 am    Post subject: Reply with quote

X-Drum wrote:
usatelo!


HAHAHA eddai poverino diamogli soddisfazione :D
_________________
Il sonno della ragione genera mostri.
Back to top
View user's profile Send private message
shev
Bodhisattva
Bodhisattva


Joined: 03 Feb 2003
Posts: 4084
Location: Italy

PostPosted: Tue Jun 08, 2004 12:22 pm    Post subject: Reply with quote

shanghai wrote:
HAHAHA eddai poverino diamogli soddisfazione :D


Concordo, è una possibilità in più che possiamo avere. Finchè possiamo scegliere (anche di non usarlo :P) benvenga, quindi grazie X-Drum!

/me favorevole a tutto ciò che asseconda la pigrizia umana :lol:
_________________
Se per vivere ti dicono "siediti e stai zitto" tu alzati e muori combattendo
Back to top
View user's profile Send private message
kaio
Apprentice
Apprentice


Joined: 26 Aug 2003
Posts: 293
Location: Gorizia - IT

PostPosted: Tue Jun 08, 2004 1:12 pm    Post subject: Reply with quote

Certo che i programmatori e i sistemisti sono una tra le razze più pigre in assoluto
Back to top
View user's profile Send private message
assente
Guru
Guru


Joined: 12 Apr 2004
Posts: 570
Location: Torino, italia, New Europe

PostPosted: Tue Jun 08, 2004 1:36 pm    Post subject: Reply with quote

Sei molto più volenteroso di me.. io, i servizi che mi servono, ho fatto tutte icone d'avvio sulla barra :D apache/mysql restart adsl..
Back to top
View user's profile Send private message
n3m0
l33t
l33t


Joined: 08 Feb 2004
Posts: 798
Location: Richville, Naples, Italy, Europe

PostPosted: Tue Jun 08, 2004 7:17 pm    Post subject: Reply with quote

Io stavo lavorando a degli script qualche tempo fa.
I nomi erano:

rc-start {servizio}
rc-stop {servizio}
rc-restart {servizio}

In realta' gli script in se per se sono una vaccata, e li ho fatti in due secondi (anzi, a dirla tutta, e' solo uno script che fa il testo su argv[0] per sapere se fare start|stop|restart)

Li avevo fatti solo per avere una sorta di "coerenza" con gli altri comandi di gestione servizi di Gentoo (rc-status, rc-update), non per una reale necessita'.
Infatti, avevo pensato poi di tramutare il tutto in

rc-service [start|stop|resart|zap|...] {servizio}

Dove start|stop|... possono essere completati con <tab> e anche i servizi.
Il lavoro e' stato (ed e' ancora) interrotto mentre cercavo di fare una funzione di bash completion piu' completa di quella che avevo gia' fatto, in modo che, ad esempio, mostrasse (nel caso di start, ad es) solo i servizi running quando si premeva <tab><tab>...e non tutti
Ho interrotto causa vari esami e lavori interfogliati.
Mi sa che riprendero', appena avro' voglia e tempo coincidenti tra loro. :)
_________________
L’energia è la civiltà. Lasciarla in mano ai piromani/petrolieri è criminale. Perché aspettare che finisca il petrolio?
L’età della pietra non è mica finita per mancanza di pietre. - B.G.


Site/Blog: http://www.neminis.org
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Tue Jun 08, 2004 8:13 pm    Post subject: Reply with quote

fatevi tre bottoni rossi di quelli industriali da mettere sulla scrivania con start stop e restart :roll: :roll: [/code]
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
silian87
Advocate
Advocate


Joined: 06 Oct 2003
Posts: 2318
Location: Treviso, Italy

PostPosted: Tue Jun 08, 2004 8:34 pm    Post subject: Reply with quote

Io avevo fatto un programmino via dialog con tanto di installazione per i servizi. Dacci pure un occhio. https://forums.gentoo.org/viewtopic.php?t=118352&highlight=controllo+demoni
_________________
Musica che ascolto: http://www.last.fm/user/silian87/

Silian87 FAQs: http://marentax.homelinux.org/~silian87/silian87-faq.txt

GTalk: silian87@gmail.com
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Tue Jun 08, 2004 8:43 pm    Post subject: Reply with quote

campanilista :D
le trovi tutte per svenderlo :lol:
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
X-Drum
Advocate
Advocate


Joined: 24 Aug 2003
Posts: 2517
Location: ('Modica','Trieste','Ferrara') Italy

PostPosted: Tue Jun 08, 2004 8:45 pm    Post subject: Reply with quote

ho appena comprato una tastiera con tre tasti Ctrl-Alt-Canc
ok abbiamo capito che a fonderia questo "pseudo-script" non piace.. :D
_________________
"...There are two sort of lies, lies and benchmarks..."


Last edited by X-Drum on Tue Jun 08, 2004 8:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
silian87
Advocate
Advocate


Joined: 06 Oct 2003
Posts: 2318
Location: Treviso, Italy

PostPosted: Tue Jun 08, 2004 8:45 pm    Post subject: Reply with quote

hehehehehe (qualcuno se ne accorto....)...... :lol: :lol: :lol:

No..... e' uno dei pochi lavori che ritengo di aver fatto abbastanza bene. Visto che si presenta l'coccasione..... :lol:
_________________
Musica che ascolto: http://www.last.fm/user/silian87/

Silian87 FAQs: http://marentax.homelinux.org/~silian87/silian87-faq.txt

GTalk: silian87@gmail.com
Back to top
View user's profile Send private message
federico
Advocate
Advocate


Joined: 18 Feb 2003
Posts: 3272
Location: Italy, Milano

PostPosted: Wed Jun 09, 2004 5:37 am    Post subject: Reply with quote

kaio wrote:
Certo che i programmatori e i sistemisti sono una tra le razze più pigre in assoluto

Sono la razza che risolve i problemi agli utenti.
Non userei lo script in quanto sono abituato a scrivere /etc/init.d/ ma capisco bene che lanciare molte molte volte questi comandi possa diventare noioso.
Inoltre, se non fosse per programmatori e sistemisti non avresti molte automazioni che dai assolutamente per scontate.
Magra uscita.
_________________
Sideralis www.sideralis.org
Pic http://blackman.amicofigo.com/gallery
Arduino http://www.arduino.cc
Chi aveva potuto aveva spaccato
2000 pezzi buttati là
Molti saluti,qualche domanda
Semplice come musica punk
Back to top
View user's profile Send private message
koma
Advocate
Advocate


Joined: 06 Jun 2003
Posts: 2702
Location: Italy

PostPosted: Wed Jun 09, 2004 9:39 am    Post subject: Reply with quote

ma se lida tante volte perchè non usa il magico bash-completion?
Devo fare un restart..
la prima volta
Code:
 /etc/init.d/sshd restart

Quote:
2 tab e max 7 caratteri


Dopo
Code:
 /et{PAG SU}c/init.d/sshd restart

Quote:
4 tasti + un invio ;)

_________________
http://www.youtube.com/watch?v=_yoJI-Tl94g GLORY GLORY HYPNOTOAD
Back to top
View user's profile Send private message
bld
l33t
l33t


Joined: 26 Mar 2003
Posts: 759
Location: Outter Space

PostPosted: Wed Jun 09, 2004 10:58 am    Post subject: Reply with quote

kaio wrote:
Certo che i programmatori e i sistemisti sono una tra le razze più pigre in assoluto


cosa sono i "sistemisti" e poi non e' vero.. un programmatore non puo essere pigro imho. E poi a dire il vero, avere linux in mano e sparare comandi lunghi a ripezione vuol dire che non lo sai usare.. o che sei veramente poco inteligente. La possibile automatizzazione dei processi e' un punto di forza di questo sistema no? :P
_________________
A happy GNU/Linux user!!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) 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