List of services - Linux

This is a discussion on List of services - Linux ; Hello everybody ! The command /sbin/chkconfig --list give the list of the services activated or disabled depending of the run-level. The result is given in plain text, translated to french for example for me. For example : oki4daemon 0:Arrêt 1:Arrêt ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: List of services

  1. List of services

    Hello everybody !

    The command /sbin/chkconfig --list give the list of the services activated
    or disabled depending of the run-level. The result is given in plain text,
    translated to french for example for me.

    For example :
    oki4daemon 0:Arrêt 1:Arrêt 2:Arrêt 3:Arrêt 4:Arrêt 5:Arrêt 6:Arrêt
    portmap 0:Arrêt 1:Arrêt 2:Arrêt 3:Marche 4:Marche
    5:Marche 6:Arrêt

    My question is :

    Is there a way to know exactly the same thing, with the result, not in plain
    text, but in numerical, with 0 for disabled and 1 for activated for example.

    oki4daemon 0:0 1:0 2:0 3:0 4:0 5:0 6:0
    portmap 0:0 1:0 2:0 3:1 4:1 5:1 6:0

    Thank a lot.

    Thibault



  2. Re: List of services

    "tibo" wrote in message
    news:9a4fcfb22569876b37670e2737995f23@news.teranew s.com...
    > Hello everybody !
    >
    > The command /sbin/chkconfig --list give the list of the services activated
    > or disabled depending of the run-level. The result is given in plain text,
    > translated to french for example for me.
    >
    > For example :
    > oki4daemon 0:Arrêt 1:Arrêt 2:Arrêt 3:Arrêt 4:Arrêt 5:Arrêt 6:Arrêt
    > portmap 0:Arrêt 1:Arrêt 2:Arrêt 3:Marche 4:Marche
    > 5:Marche 6:Arrêt
    >
    > My question is :
    >
    > Is there a way to know exactly the same thing, with the result, not in

    plain
    > text, but in numerical, with 0 for disabled and 1 for activated for

    example.
    >
    > oki4daemon 0:0 1:0 2:0 3:0 4:0 5:0 6:0
    > portmap 0:0 1:0 2:0 3:1 4:1 5:1 6:0
    >
    > Thank a lot.
    >
    > Thibault
    >
    >

    You could just pipe the output through a little sed script:
    |sed -e 's/Marche/1/g' -e 's/Arrêt/0/g'
    --
    Jonathan.



  3. Re: List of services

    Thank you for your answer.

    My problem is that I want to get rid of the language.

    The matter is that, if I connect to an english or a chinese (!) Linux, this
    script won't work.
    In this case, I'd have to make as many scripts as languages, and a script to
    detect the language.

    That's why I need a command on the system that gives me a numerical result.
    And maybe the command chkconfig --list takes the informations in a file ?

    If you know a solution, please tell me.

    Thanks again.


    a écrit dans le message de
    news:3ffe7eb3$0$15346$afc38c87@news.easynet.co.uk. ..
    > "tibo" wrote in message
    > news:9a4fcfb22569876b37670e2737995f23@news.teranew s.com...
    > > Hello everybody !
    > >
    > > The command /sbin/chkconfig --list give the list of the services

    activated
    > > or disabled depending of the run-level. The result is given in plain

    text,
    > > translated to french for example for me.
    > >
    > > For example :
    > > oki4daemon 0:Arrêt 1:Arrêt 2:Arrêt 3:Arrêt 4:Arrêt 5:Arrêt 6:Arrêt
    > > portmap 0:Arrêt 1:Arrêt 2:Arrêt 3:Marche 4:Marche
    > > 5:Marche 6:Arrêt
    > >
    > > My question is :
    > >
    > > Is there a way to know exactly the same thing, with the result, not in

    > plain
    > > text, but in numerical, with 0 for disabled and 1 for activated for

    > example.
    > >
    > > oki4daemon 0:0 1:0 2:0 3:0 4:0 5:0 6:0
    > > portmap 0:0 1:0 2:0 3:1 4:1 5:1 6:0
    > >
    > > Thank a lot.
    > >
    > > Thibault
    > >
    > >

    > You could just pipe the output through a little sed script:
    > |sed -e 's/Marche/1/g' -e 's/Arrêt/0/g'
    > --
    > Jonathan.
    >
    >




  4. Re: List of services

    "tibo" wrote in message
    news:9a4fcfb22569876b37670e2737995f23@news.teranew s.com

    > The command /sbin/chkconfig --list give the list of the services
    > activated or disabled depending of the run-level. The result is given
    > in plain text, translated to french for example for me.
    >
    > For example :
    > oki4daemon 0:Arrêt 1:Arrêt 2:Arrêt 3:Arrêt 4:Arrêt 5:Arrêt
    > 6:Arrêt portmap 0:Arrêt 1:Arrêt 2:Arrêt 3:Marche
    > 4:Marche 5:Marche 6:Arrêt
    >
    > My question is :
    >
    > Is there a way to know exactly the same thing, with the result, not
    > in plain text, but in numerical, with 0 for disabled and 1 for
    > activated for example.
    >
    > oki4daemon 0:0 1:0 2:0 3:0 4:0 5:0 6:0
    > portmap 0:0 1:0 2:0 3:1 4:1 5:1 6:0


    Relatively trivial, as a matter of fact. In the ~/.bash_profile or ~/.bashrc
    or at a command line:

    alias "chkconfig"="/sbin/chkconfig --list | sed -e 's/Arrêt/0/g' -e
    's/Marche/1/g' "

    This will allow the command "chkconfig" to expand to what you desire. Of
    course, to unalias the command for normal usage, one would precede the
    command with a backslash:

    \chkconfig --list

    if /sbin is in $PATH, or simply

    /sbin/chkconfig --list


    tony


    --
    use hotmail for any email replies



    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

  5. Re: List of services

    "tibo" wrote in message
    news:47516530349bc872750f820bc4afebf3@news.teranew s.com

    > The matter is that, if I connect to an english or a chinese (!)
    > Linux, this script won't work.
    > In this case, I'd have to make as many scripts as languages, and a
    > script to detect the language.
    >
    > That's why I need a command on the system that gives me a numerical
    > result.


    That's the beauty of an open-source operating system. Edit the source code
    and recompile it.

    --
    use hotmail for any email replies



    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

  6. Re: List of services

    tibo wrote:
    > Thank you for your answer.
    >
    > My problem is that I want to get rid of the language.
    >
    > The matter is that, if I connect to an english or a chinese (!) Linux, this
    > script won't work.
    > In this case, I'd have to make as many scripts as languages, and a script to
    > detect the language.
    >
    > That's why I need a command on the system that gives me a numerical result.
    > And maybe the command chkconfig --list takes the informations in a file ?
    >
    > If you know a solution, please tell me.


    LANG=C

    You'll find this in startup scripts, so that the output is predictable,
    from a Natural Language POV.

    LANG=C chkconfig --list | sed -e 's/Marche/1/g' -e 's/Arr?t/0/g'

    Actually, if you just want it to be uniform, just use LANG=C in all your
    scripts, so put this at the start of all your scripts.

    #!/bin/sh
    LANG=C

    --
    Cameron Kerr
    cameron.kerr@paradise.net.nz : http://nzgeeks.org/cameron/
    Empowered by Perl!

  7. Re: List of services


    "Cameron Kerr" a écrit dans le message de
    news:400240b1@news.orcon.net.nz...
    > tibo wrote:
    > > Thank you for your answer.
    > >


    >
    > LANG=C
    >
    > You'll find this in startup scripts, so that the output is predictable,
    > from a Natural Language POV.
    >
    > LANG=C chkconfig --list | sed -e 's/Marche/1/g' -e 's/Arr?t/0/g'
    >
    > Actually, if you just want it to be uniform, just use LANG=C in all your
    > scripts, so put this at the start of all your scripts.
    >
    > #!/bin/sh
    > LANG=C


    I'm going to see that, I think it could be a great solution. Thank you for
    your answer.




+ Reply to Thread