Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Write the script to stop and restart the daemon  (Read 4585 times)

0 Members and 1 Guest are viewing this topic.

sun_os

    Topic Starter


    Beginner

    Write the script to stop and restart the daemon
    « on: July 29, 2010, 03:58:09 AM »
    There are two two tasks I need to check whtat is the process id, once I find the process id, I need to kill the daemon.

    Is it use the if.. then....else

    Thanks  :)

    ghostdog74



      Specialist

      Thanked: 27
      Re: Write the script to stop and restart the daemon
      « Reply #1 on: July 29, 2010, 04:12:05 AM »
      look at pgrep, pkill, pidof etc. then read up on shell scripting.

      meta1203



        Rookie

        Thanked: 1
        Re: Write the script to stop and restart the daemon
        « Reply #2 on: July 29, 2010, 09:30:18 AM »
        What Program are you wanting to kill? If it has a name, you can use this:
        Code: [Select]
        #!/bin/bash
        killall [name of program]
        Make sure to replace "[name of program]" with your program name.