You are not logged in.

#1 2011-10-01 17:15:33

jondkent
Member
From: London
Registered: 2005-09-13
Posts: 123

'service' command

Hi,

As I work on Red Hat servers during the day, I missed the service command (service blah start|restart|stop|status).  So I decided to write a version (no command code with the rhel version I can assure you).

This supports the init.d and rc.d file structure and also have code to try and provide the status on a service via the /var/run/[service] file.  Ultimately is dam simple bit of bash, but I find it very useful.

Everyone is more that welcome to use this.  Its GPL and is up on github @

https://github.com/jondkent/scripts

Hepl available via:

service -h [or --help]

Would be nice to know if this is of use to anyone.  Enhancements very welcome.

Regards,
Jon

Offline

#2 2011-10-01 17:57:00

firecat53
Member
From: Lake Stevens, WA, USA
Registered: 2007-05-14
Posts: 1,542
Website

Re: 'service' command

Hey, just out of curiosity, any different functions provided by 'service' over the builtin '/sbin/rc.d' command provided by the initscripts package?

 $ rc.d
usage: rc.d <action> <daemon> [daemon] ...
       rc.d list [started|stopped]
       rc.d help

<daemon> is the name of a script in /etc/rc.d
<action> can be a start, stop, restart, reload, status, ...
WARNING: initscripts are free to implement or not the above actions.

e.g: rc.d list
     rc.d list started
     rc.d help
     rc.d start sshd gpm

Scott

Edit: I see what you did now...made it more multi-distro and with the PID checking.

Last edited by firecat53 (2011-10-01 18:00:21)

Offline

#3 2011-10-01 18:04:23

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: 'service' command

Moving to Community Contribs.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#4 2011-10-01 18:13:49

jondkent
Member
From: London
Registered: 2005-09-13
Posts: 123

Re: 'service' command

firecat53 wrote:

Hey, just out of curiosity, any different functions provided by 'service' over the builtin '/sbin/rc.d' command provided by the initscripts package?

 $ rc.d
usage: rc.d <action> <daemon> [daemon] ...
       rc.d list [started|stopped]
       rc.d help

<daemon> is the name of a script in /etc/rc.d
<action> can be a start, stop, restart, reload, status, ...
WARNING: initscripts are free to implement or not the above actions.

e.g: rc.d list
     rc.d list started
     rc.d help
     rc.d start sshd gpm

Scott

Edit: I see what you did now...made it more multi-distro and with the PID checking.

Yup, thats idea as I wanted this to be as useful to me (and others) as I could.

Jon

Offline

Board footer

Powered by FluxBB