Find the answer to your Linux question:
Results 1 to 7 of 7
Hi all, How can I find out if a process/module (e.g.: dhclient, dhcpd, vncserver, ........, etc) can be restarted or not ?? Thanks manik ::Moderator Note:: Do not post the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2005
    Posts
    8

    restarting a module


    Hi all,

    How can I find out if a process/module (e.g.: dhclient, dhcpd, vncserver, ........, etc) can be restarted or not ??

    Thanks
    manik

    ::Moderator Note:: Do not post the same question in more than one forum. -TM

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,807
    Look in /etc/init.d/ it contains all the SysV init scripts for the services. For any of those, you can do a 'service [servicename] start|stop|restart|status', etc.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Dec 2005
    Posts
    8
    Thanks Roxoff.

    a quick question:

    I had a process "dhclient" running on my machine. I tried "killall -HUP dhclient", to restart it. But after I issued "killall -HUP dhclient", the process "dhclient" was killed but didnt got restarted.

    Now when is I do "dhclient start" in /etc/init.d/, "dhclient" does not get restarted. i get following error: bash: ./dhclient: No such file or directory


    Manik

  4. #4
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,807
    dhclient is the program that acts as a DHCP client. It isn't started directly by its own SysV service.

    Try using:

    service network restart

    and it should come back if you are using DHCP to assign your network addresses.
    Linux user #126863 - see http://linuxcounter.net/

  5. #5
    Just Joined!
    Join Date
    Dec 2005
    Posts
    8
    Thanks Roxoff.

    is there another way to determine, on basis of their PID's, which processes can restarted. Actually i want determine the re-startable nature of a process from a C program

    (I know, as you suggested earlier, that I can always parse the /etc/init.d/ to get this information)

    Thanks
    manik

  6. #6
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,807
    I suppose that all processes _can_ be restarted. You'd need to be careful about any you do restart, of course. You never can be quite sure if any other processes are depending on them being there. And finding any original startup options may be challenging. I'm pretty sure that if a process is a part of a larger package that is running that you'd be better off restarting the whole system rather than just a process.

    As far as doing this from C - well it's not something I've got experience of. Maybe others could help here?
    Linux user #126863 - see http://linuxcounter.net/

  7. #7
    Just Joined!
    Join Date
    Dec 2005
    Posts
    8
    Thanks Roxoff !

Posting Permissions

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