Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Sysadmin sugar commands
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  

Did you write, install, or otherwise enable, or wish you had access to, the 'service' command?
Yes
45%
 45%  [ 9 ]
no
55%
 55%  [ 11 ]
Total Votes : 20

Author Message
Sean Russell
n00b
n00b


Joined: 22 Jun 2002
Posts: 14
Location: Bend, OR, USA

PostPosted: Sat Jun 29, 2002 2:18 am    Post subject: Sysadmin sugar commands Reply with quote

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


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Sat Jun 29, 2002 3:02 am    Post subject: Reply with quote

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


Joined: 19 Apr 2002
Posts: 413
Location: American Fork, UT

PostPosted: Sat Jun 29, 2002 3:41 am    Post subject: Reply with quote

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


Joined: 28 Jun 2002
Posts: 430
Location: Naples Italy

PostPosted: Sat Jun 29, 2002 4:28 am    Post subject: the ser... what? :P Reply with quote

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 ) :lol:
_________________
Need to flame people LIVE on IRC? Join #gentoo-otw on freenode!
Back to top
View user's profile Send private message
fghellar
Bodhisattva
Bodhisattva


Joined: 10 Apr 2002
Posts: 856
Location: Porto Alegre, BR

PostPosted: Sat Jun 29, 2002 4:43 am    Post subject: Reply with quote

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


Joined: 21 Apr 2002
Posts: 577

PostPosted: Sat Jun 29, 2002 7:01 am    Post subject: Re: the ser... what? :P Reply with quote

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 ) :lol:


"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 :oops:
Back to top
View user's profile Send private message
Sean Russell
n00b
n00b


Joined: 22 Jun 2002
Posts: 14
Location: Bend, OR, USA

PostPosted: Sat Jun 29, 2002 2:12 pm    Post subject: Reply with quote

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


Joined: 28 Jun 2002
Posts: 430
Location: Naples Italy

PostPosted: Sat Jun 29, 2002 4:55 pm    Post subject: Reply with quote

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 :wink:
_________________
Need to flame people LIVE on IRC? Join #gentoo-otw on freenode!
Back to top
View user's profile Send private message
Sean Russell
n00b
n00b


Joined: 22 Jun 2002
Posts: 14
Location: Bend, OR, USA

PostPosted: Sat Jun 29, 2002 5:43 pm    Post subject: Tab completion is /sometimes/ your friend. Reply with quote

KiTaSuMbA wrote:
Tab completion is your friend :wink:

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Page 1 of 1

 
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