Service list - Linux

This is a discussion on Service list - Linux ; hi guys i m fresher to linux programming, i m working on Fedora Core 4.0 and i want to list out the available service in linux i.e. i want to print name of service, location of service, startup type, and ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Service list

  1. Service list

    hi guys

    i m fresher to linux programming, i m working on Fedora Core 4.0 and i
    want to list out the available service in linux i.e. i want to print
    name of service, location of service, startup type, and status of
    information using c library.

    but the problem is i don't know which function/structure is helped to
    list out this all, or if any command then please suggest me or if any
    source of c program is available then please forwarded to me..

    thanks in advance

    chandrakant


  2. Re: Service list

    solanki.chandrakant@gmail.com wrote:
    > hi guys
    >
    > i m fresher to linux programming, i m working on Fedora Core 4.0 and i
    > want to list out the available service in linux i.e. i want to print
    > name of service, location of service, startup type, and status of
    > information using c library.


    Please define "service"!

    I assume you mean some service available through some network port.
    A number of "service"s are always started,
    some are started by appropriate scripts in /etc/rc.d/rc.d
    (e.g. /etc/rc.d/rc5.d for Multiuser w/ grphical UI), but not all of
    these scripts start sevices, some just perform some configuraion function.
    The executables for some services, while available, are not started
    until the service is required! The (x)inetd takes care of this, see
    /etc/(x)inetd.conf and/or /etc/xinetd.d.

    If all you want to know is which networking ports are open, use netstat.

    > but the problem is i don't know which function/structure is helped to
    > list out this all, or if any command then please suggest me or if any
    > source of c program is available then please forwarded to me..


    No need for C code, a few (100? ;-) lines of shell (or your favorite
    scripting language) will do.

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett


  3. Re: Service list

    solanki.chandrakant@gmail.com wrote:
    > i m fresher to linux programming, i m working on Fedora Core 4.0 and i
    > want to list out the available service in linux i.e. i want to print
    > name of service, location of service, startup type, and status of
    > information using c library.


    This looks like you are coming from Windows environment and can't
    imagine that an OS could work differently. I have bad news for you,
    Linux doesn't have the concept of "services" in the Windows sense.

    --
    Markku Kolkka
    markku.kolkka@iki.fi


  4. Re: Service list

    Markku Kolkka wrote in part:
    > solanki.chandrakant@gmail.com wrote:
    >> i m fresher to linux programming, i m working on Fedora Core 4.0 and i
    >> want to list out the available service in linux i.e. i want to print
    >> name of service, location of service, startup type, and status of
    >> information using c library.

    >
    > This looks like you are coming from Windows environment and
    > can't imagine that an OS could work differently. I have bad
    > news for you, Linux doesn't have the concept of "services"
    > in the Windows sense.


    I humbly bow before your greater knowledge of MS-Windows.
    I won't waste my [few] neurons

    Doesn't /etc/services list all well-known ports? And doesn't
    /etc/inetd.conf show all services that `inetd` will spawn?
    Some other services (like sshd and httpd) might be started directly,
    usually by something in /etc/rc.d/* but will show in `ps aux`.

    All in nice plain-text, no `c` required!

    -- Robert



  5. Re: Service list


    Robert Redelmeier wrote:

    > Doesn't /etc/services list all well-known ports?


    Yes.

    > And doesn't
    > /etc/inetd.conf show all services that `inetd` will spawn?


    Not on systems that don't use 'inetd'. I was under the impression
    'inetd' was basically obsolete on Linux, but I don't know every
    distribution.

    > Some other services (like sshd and httpd) might be started directly,
    > usually by something in /etc/rc.d/* but will show in `ps aux`.


    It depends on the definition of "service".

    > All in nice plain-text, no `c` required!


    One common definition of a service is any program running without a
    controlling terminal. You can get this easily from 'ps'. If you mean a
    program that accepts network connections, you can track open ports with
    'netstat', but that gets a bit confusing for UDP.

    The answer to the OP is basically that they need to learn a bit about
    how UNIX works and then decide what they really mean by "service".

    DS


  6. Re: Service list

    David Schwartz wrote:
    > Robert Redelmeier wrote:
    >
    >
    >>Doesn't /etc/services list all well-known ports?

    >
    >
    > Yes.
    >
    >
    >>And doesn't
    >>/etc/inetd.conf show all services that `inetd` will spawn?

    >
    >
    > Not on systems that don't use 'inetd'. I was under the impression
    > 'inetd' was basically obsolete on Linux, but I don't know every
    > distribution.


    "inetd" is, but "xinetd" is not.
    I don't really know what the impact of disposing of xinetd would be, but
    apart from the fact that there will only be _one_ xinetd waiting for
    connection requests rather than n service "providers", xinetd takes care
    of the entire connection setup, including access checks, and hands open
    network sockets on the provider's stdin/out/err, making it veeeery easy
    to build a small service: no need for socket/bind/listen/accept.

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett


+ Reply to Thread