Re: running services



Hmm,

try something like

service --status-all |grep " is " |while read a b c d
do
if [ $c = "stopped" ]
then
echo "$a off"
fi
if [ $b = "(pid" ]
then
echo "$a on"
fi
done

but as you are a C++ programmer you might want to do this in your code and
not on the shell



Matthijs Sneijders




CORUS
Research,
Development
&
Technology

Building
3G16 room
3-312

P.O. Box
10.000

1970 CA
IJMUIDEN

phone +31 (0)251-496400

fax +31 (0)251-470064

mail matthijs.sneijders@xxxxxxxxxxxxxx






|---------+------------------------------>
| | Muhammad Rizwan |
| | <rizwan@xxxxxxxxxxx|
| | m> |
| | Sent by: |
| | redhat-list-bounces|
| | @redhat.com |
| | |
| | |
| | 26-04-2006 18:15 |
| | Please respond to |
| | General Red Hat |
| | Linux discussion |
| | list |
| | |
|---------+------------------------------>
>----------------------------------------------------------------------------------------------------------------------|
| |
| To: General Red Hat Linux discussion list <redhat-list@xxxxxxxxxx> |
| cc: |
| Subject: Re: running services |
>----------------------------------------------------------------------------------------------------------------------|




Thanks for this reply. but i need some precise solution bocause i need
to use this command through my C++ code, now its almost impossible for
me to parse the results of "service --status-all".
Is there any command which 'll result me just name and status of
services.

thanks

On Wed, 2006-04-26 at 10:23, BERES Laszlo wrote:
Muhammad Rizwan wrote:

How i can get all the running services on linux system (through
command).

Use "service --status-all"

--

BÉRES László RHCE
systems engineer, trainer

--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



**********************************************************************
This transmission is confidential and must not be used or disclosed by
anyone other than the intended recipient. Neither Corus Group Plc nor
any of its subsidiaries can accept any responsibility for any use or
misuse of the transmission by anyone.
**********************************************************************


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list



Relevant Pages

  • Re: running services
    ... echo "$a off" ... Is there any command which 'll result me just name and status of ... systems engineer, trainer ... This transmission is confidential and must not be used or disclosed by ...
    (RedHat)
  • Re: Persisting env vars in cmd windows
    ... more about batch files as you go on, ... echo The time is %time::=.% ... But the piece de resistance was the "start" command, ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)
  • Re: Persisting env vars in cmd windows
    ... But the piece de resistance was the "start" command, ... - Have all code for the one project in one single batch file. ... @echo off ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)
  • Re: Persisting env vars in cmd windows
    ... even though it applies to any command, e.g. echo, copy, ... Similarly the syntax for the extremely powerful "for" command ... more about batch files as you go on, ... echo:: ERROR ERROR ERROR ERROR ...
    (microsoft.public.win2000.general)
  • Re: Bluetongue transmitted cow to calf?
    ... Research points to other transmission routes ... A vessel was entering Felixstowe carrying three massive container cranes ... massive collision ship to shore. ... former U-boat commander, who had cracked under the strain of command. ...
    (uk.business.agriculture)