View previous topic :: View next topic |
Author |
Message |
X-Drum Advocate
Joined: 24 Aug 2003 Posts: 2517 Location: ('Modica','Trieste','Ferrara') Italy
|
Posted: Mon Jun 07, 2004 9:53 pm Post subject: [TIP] RedHat like 'service' |
|
|
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
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 |
|
|
FonderiaDigitale Veteran
Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Mon Jun 07, 2004 11:52 pm Post subject: |
|
|
ma ce ne e' veramente bisogno? _________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
|
|
Back to top |
|
|
X-Drum Advocate
Joined: 24 Aug 2003 Posts: 2517 Location: ('Modica','Trieste','Ferrara') Italy
|
Posted: Tue Jun 08, 2004 12:21 am Post subject: |
|
|
se sei schifosamente pigro come me ed in una giornata di lavoro lanci,rilanci 300mila volte servizi vari...la risposta è si!
ovvimamente si puo' vivere senza....tranquillamente _________________ "...There are two sort of lies, lies and benchmarks..." |
|
Back to top |
|
|
randomaze Bodhisattva
Joined: 21 Oct 2003 Posts: 9985
|
Posted: Tue Jun 08, 2004 6:29 am Post subject: |
|
|
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 |
|
|
X-Drum Advocate
Joined: 24 Aug 2003 Posts: 2517 Location: ('Modica','Trieste','Ferrara') Italy
|
Posted: Tue Jun 08, 2004 8:43 am Post subject: |
|
|
ah che lo deve uare solo root _________________ "...There are two sort of lies, lies and benchmarks..." |
|
Back to top |
|
|
zUgLiO l33t
Joined: 12 Aug 2003 Posts: 754 Location: Ferrara (Italy)
|
Posted: Tue Jun 08, 2004 8:51 am Post subject: |
|
|
allora metti il .bashrc solo in /root _________________
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 |
|
|
X-Drum Advocate
Joined: 24 Aug 2003 Posts: 2517 Location: ('Modica','Trieste','Ferrara') Italy
|
Posted: Tue Jun 08, 2004 8:52 am Post subject: |
|
|
usatelo! _________________ "...There are two sort of lies, lies and benchmarks..." |
|
Back to top |
|
|
kaio Apprentice
Joined: 26 Aug 2003 Posts: 293 Location: Gorizia - IT
|
Posted: Tue Jun 08, 2004 9:01 am Post subject: |
|
|
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 |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 30922 Location: here
|
Posted: Tue Jun 08, 2004 9:04 am Post subject: |
|
|
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 |
|
|
zUgLiO l33t
Joined: 12 Aug 2003 Posts: 754 Location: Ferrara (Italy)
|
Posted: Tue Jun 08, 2004 9:08 am Post subject: |
|
|
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 _________________
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 |
|
|
flyinspirit001 Apprentice
Joined: 25 May 2004 Posts: 266 Location: localhost,localdomain
|
Posted: Tue Jun 08, 2004 9:08 am Post subject: |
|
|
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 |
|
|
X-Drum Advocate
Joined: 24 Aug 2003 Posts: 2517 Location: ('Modica','Trieste','Ferrara') Italy
|
Posted: Tue Jun 08, 2004 9:50 am Post subject: |
|
|
ok ok Mi cospargo il capo di cenere.....LOL _________________ "...There are two sort of lies, lies and benchmarks..." |
|
Back to top |
|
|
shanghai Guru
Joined: 08 Feb 2004 Posts: 493 Location: Roma, Italia, GeekLand
|
Posted: Tue Jun 08, 2004 11:13 am Post subject: |
|
|
HAHAHA eddai poverino diamogli soddisfazione _________________ Il sonno della ragione genera mostri. |
|
Back to top |
|
|
shev Bodhisattva
Joined: 03 Feb 2003 Posts: 4084 Location: Italy
|
Posted: Tue Jun 08, 2004 12:22 pm Post subject: |
|
|
shanghai wrote: | HAHAHA eddai poverino diamogli soddisfazione |
Concordo, è una possibilità in più che possiamo avere. Finchè possiamo scegliere (anche di non usarlo ) benvenga, quindi grazie X-Drum!
/me favorevole a tutto ciò che asseconda la pigrizia umana _________________ Se per vivere ti dicono "siediti e stai zitto" tu alzati e muori combattendo |
|
Back to top |
|
|
kaio Apprentice
Joined: 26 Aug 2003 Posts: 293 Location: Gorizia - IT
|
Posted: Tue Jun 08, 2004 1:12 pm Post subject: |
|
|
Certo che i programmatori e i sistemisti sono una tra le razze più pigre in assoluto |
|
Back to top |
|
|
assente Guru
Joined: 12 Apr 2004 Posts: 570 Location: Torino, italia, New Europe
|
Posted: Tue Jun 08, 2004 1:36 pm Post subject: |
|
|
Sei molto più volenteroso di me.. io, i servizi che mi servono, ho fatto tutte icone d'avvio sulla barra apache/mysql restart adsl.. |
|
Back to top |
|
|
n3m0 l33t
Joined: 08 Feb 2004 Posts: 798 Location: Richville, Naples, Italy, Europe
|
Posted: Tue Jun 08, 2004 7:17 pm Post subject: |
|
|
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. _________________ Lenergia è la civiltà. Lasciarla in mano ai piromani/petrolieri è criminale. Perché aspettare che finisca il petrolio?
Letà della pietra non è mica finita per mancanza di pietre. - B.G.
Site/Blog: http://www.neminis.org |
|
Back to top |
|
|
FonderiaDigitale Veteran
Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Tue Jun 08, 2004 8:13 pm Post subject: |
|
|
fatevi tre bottoni rossi di quelli industriali da mettere sulla scrivania con start stop e restart [/code] _________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
|
|
Back to top |
|
|
silian87 Advocate
Joined: 06 Oct 2003 Posts: 2318 Location: Treviso, Italy
|
|
Back to top |
|
|
FonderiaDigitale Veteran
Joined: 06 Nov 2003 Posts: 1710 Location: Rome, Italy
|
Posted: Tue Jun 08, 2004 8:43 pm Post subject: |
|
|
campanilista
le trovi tutte per svenderlo _________________ Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica
|
|
Back to top |
|
|
X-Drum Advocate
Joined: 24 Aug 2003 Posts: 2517 Location: ('Modica','Trieste','Ferrara') Italy
|
Posted: Tue Jun 08, 2004 8:45 pm Post subject: |
|
|
ho appena comprato una tastiera con tre tasti Ctrl-Alt-Canc
ok abbiamo capito che a fonderia questo "pseudo-script" non piace.. _________________ "...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 |
|
|
silian87 Advocate
Joined: 06 Oct 2003 Posts: 2318 Location: Treviso, Italy
|
|
Back to top |
|
|
federico Advocate
Joined: 18 Feb 2003 Posts: 3272 Location: Italy, Milano
|
Posted: Wed Jun 09, 2004 5:37 am Post subject: |
|
|
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 |
|
|
koma Advocate
Joined: 06 Jun 2003 Posts: 2702 Location: Italy
|
Posted: Wed Jun 09, 2004 9:39 am Post subject: |
|
|
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 |
|
|
bld l33t
Joined: 26 Mar 2003 Posts: 759 Location: Outter Space
|
Posted: Wed Jun 09, 2004 10:58 am Post subject: |
|
|
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? _________________ A happy GNU/Linux user!! |
|
Back to top |
|
|
|