Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
When trying to find a service status, I issued the following command: <service xxx status> However the answer was <Usage: xxx {start|stop}> How do I know its current state, or ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2009
    Posts
    5

    How to change service status


    When trying to find a service status, I issued the following command:
    <service xxx status>

    However the answer was <Usage: xxx {start|stop}>

    How do I know its current state, or how do I change it in order for me to know its current state?

  2. #2
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    For suse, use Yast -> System Services (runlevel) to see and configure system services.

  3. #3
    Linux Guru gogalthorp's Avatar
    Join Date
    Oct 2006
    Location
    West (by God) Virginia
    Posts
    3,104
    Service is just a script that lives in /sbin so you can see totally how it is done. The option to list status is only provided for all service ie the output is a list of the status of all services.

    service -s

    or

    service --status-all

    to check ona a given service samba for example

    service smb status

    note you need to be root to do this

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Dec 2009
    Posts
    5
    Hi All.
    Thanks for your response.

    However, as you can see from my primary thread, the response i get is:

    <Usage: xxx {start|stop}>

    meaning i don't understand in which state this service is.
    How do i change it, so i will be replied (i.e. <Usage: xxx start> or <Usage: xxx stop>.

  6. #5
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    It's intended to be a helpful message offering you options for this command.

    In other words, the following are valid commands
    Code:
    service myservice start
    service myservice stop
    service myservice restart
    To start, stop, and restart the service, respectively. It is not telling you whether the service is already running.

  7. #6
    Just Joined!
    Join Date
    Dec 2009
    Posts
    5
    You mean that only <service --system-All>, will display the service state?

  8. #7
    Linux Newbie
    Join Date
    Mar 2007
    Posts
    142
    service -s or service --status-all will display all services and their status.

    service servicename start will start the service and so forth.

    service -h or service --help displays the usage (syntax).

    service servicename status
    :is only available for some services.
    service servicename
    :displays the options, or if status is available.
    If you get only start|stop it is not available for that service.

  9. #8
    Just Joined!
    Join Date
    Dec 2009
    Posts
    5
    Can i add a script to init.d, where it will show this service status?

  10. #9
    Linux Guru gogalthorp's Avatar
    Join Date
    Oct 2006
    Location
    West (by God) Virginia
    Posts
    3,104
    If the service does not report it's status no. I'd guess that all the services that can report their status already have a script that will do that. Exactly which service do you want to know the status?

  11. #10
    Just Joined!
    Join Date
    Dec 2009
    Posts
    5
    This is a private monitoring sysytem.
    Not an integrated built-in system (i.e. java, oracle etc.).

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •