View previous topic :: View next topic |
Did you write, install, or otherwise enable, or wish you had access to, the 'service' command? |
Yes |
|
45% |
[ 9 ] |
no |
|
55% |
[ 11 ] |
|
Total Votes : 20 |
|
Author |
Message |
Sean Russell n00b
Joined: 22 Jun 2002 Posts: 14 Location: Bend, OR, USA
|
Posted: Sat Jun 29, 2002 2:18 am Post subject: Sysadmin sugar commands |
|
|
This is just a poll, not a debate. I just want to know, for my own edification, how many people added a 'service' script to start, stop, and check the status of init.d scripts as one of the first things they added to their Gentoo installation? Or one of the first things they wished they had?
I'm speaking of Redhat/Mandrake's 'service' command, used like 'service qmail restart', or 'service apache stop'. _________________ --- SER
Jabber: ser@jabber.com |
|
Back to top |
|
|
BradN Advocate
Joined: 19 Apr 2002 Posts: 2391 Location: Wisconsin (USA)
|
Posted: Sat Jun 29, 2002 3:02 am Post subject: |
|
|
This would be a good idea... I don't leave my net.eth0 enabled on my laptop by default, because it hangs for the 30 seconds or whatever the timeout is at startup if there is no ethernet connected, and therefore I have to do a /etc/init.d/net.eth0 start whenever I want to use ethernet... I'm too lazy to make a script for it though |
|
Back to top |
|
|
Utoxin Guru
Joined: 19 Apr 2002 Posts: 413 Location: American Fork, UT
|
Posted: Sat Jun 29, 2002 3:41 am Post subject: |
|
|
I only recently had access to a Redhat box, so I'm used to using /etc/init.d to do all that stuff. _________________ Gentoo:
1. A small fast penguin from Antarctica.
2. A small fast penguin on your computer.
Cool. |
|
Back to top |
|
|
KiTaSuMbA Guru
Joined: 28 Jun 2002 Posts: 430 Location: Naples Italy
|
Posted: Sat Jun 29, 2002 4:28 am Post subject: the ser... what? :P |
|
|
3 years ago, I'd kiss anyone providing a gui tool for the job... today I disdain anyone using "shutdown -r" now on a desktop machine instead of "init 6", so you can imagine the (un)usefulness of such a tool instead of directly executing the init.d scripts (gentoo's ones are even pretty-colored for christ's sake ) _________________ Need to flame people LIVE on IRC? Join #gentoo-otw on freenode! |
|
Back to top |
|
|
fghellar Bodhisattva
Joined: 10 Apr 2002 Posts: 856 Location: Porto Alegre, BR
|
Posted: Sat Jun 29, 2002 4:43 am Post subject: |
|
|
BradN wrote: | This would be a good idea... I don't leave my net.eth0 enabled on my laptop by default, because it hangs for the 30 seconds or whatever the timeout is at startup if there is no ethernet connected, and therefore I have to do a /etc/init.d/net.eth0 start whenever I want to use ethernet... I'm too lazy to make a script for it though |
In /etc/profile:
Code: | alias neton="/etc/init.d/net.eth0 start"
alias netoff="/etc/init.d/net.eth0 stop" |
_________________ | www.gentoo.org | www.tldp.org | www.google.com | |
|
Back to top |
|
|
dice Guru
Joined: 21 Apr 2002 Posts: 577
|
Posted: Sat Jun 29, 2002 7:01 am Post subject: Re: the ser... what? :P |
|
|
KiTaSuMbA wrote: | 3 years ago, I'd kiss anyone providing a gui tool for the job... today I disdain anyone using "shutdown -r" now on a desktop machine instead of "init 6", so you can imagine the (un)usefulness of such a tool instead of directly executing the init.d scripts (gentoo's ones are even pretty-colored for christ's sake ) |
"init 6"?? pfft, just give it the three finger salute
BradN: In your /etc/conf.d/net edit the line dhcpcd_eth0="" to read dhcpcd_eth0="-t 5". That'll set the DHCP timeout to 5 seconds, then it'll only wait that long on startup.
Edit: init 6 != init 0 |
|
Back to top |
|
|
Sean Russell n00b
Joined: 22 Jun 2002 Posts: 14 Location: Bend, OR, USA
|
Posted: Sat Jun 29, 2002 2:12 pm Post subject: |
|
|
BradN wrote: | I'm too lazy to make a script for it though |
It's a two-liner. I've thrown one in bugs.gentoo.org, but all you need is:
Code: | #!/bin/sh
/etc/init.d/$* |
or, if you're being clever:
Code: | #!/bin/sh
service=$1 ; shift
/etc/init.d/$service "$@" |
KiTaSuMbA wrote: | so you can imagine the (un)usefulness of such a tool instead of directly executing the init.d scripts (gentoo's ones are even pretty-colored for christ's sake ) |
Well, the 'service' command just runs the /etc/init.d/ scripts; it is just easier/faster for humans to type the word 'service ' than '/etc/init.d/'. Try it a few times . With 'service', you still get all of the pretty colors. _________________ --- SER
Jabber: ser@jabber.com |
|
Back to top |
|
|
KiTaSuMbA Guru
Joined: 28 Jun 2002 Posts: 430 Location: Naples Italy
|
Posted: Sat Jun 29, 2002 4:55 pm Post subject: |
|
|
quote="Sean Russell"]
Well, the 'service' command just runs the /etc/init.d/ scripts; it is just easier/faster for humans to type the word 'service ' than '/etc/init.d/'. Try it a few times . With 'service', you still get all of the pretty colors.[/quote]
Tab completion is your friend _________________ Need to flame people LIVE on IRC? Join #gentoo-otw on freenode! |
|
Back to top |
|
|
Sean Russell n00b
Joined: 22 Jun 2002 Posts: 14 Location: Bend, OR, USA
|
Posted: Sat Jun 29, 2002 5:43 pm Post subject: Tab completion is /sometimes/ your friend. |
|
|
KiTaSuMbA wrote: | Tab completion is your friend |
I agree; tab completion is great, when it works and there are unambiguous completions. However, tab completion also works on 'service ', and if you /really/ want to make a point, call the script 'svc' and save yourself the stretch to the tab key. _________________ --- SER
Jabber: ser@jabber.com |
|
Back to top |
|
|
|