in reply to start and kill a process in a local shell

I'm assuming this is a daemon running in the background on a *nix box.

To capture it's output, have crontab or whatever starts it redirect to some standard directory with a filename containing the date and time the process started.

As far as stopping it is concerned, don't send a CTRL-C, use a kill -9 <id> where <id> is the process-number of the program.

  • Comment on Re: start and kill a process in a local shell

Replies are listed 'Best First'.
Re^2: start and kill a process in a local shell
by shmem (Chancellor) on Oct 12, 2007 at 10:41 UTC
    Signal KILL (9) is last resort and should be used as such. A process killed that way has no chance to clean up resources (e.g. flush buffers, close filehandles).

    Signals 1, 2, 3 or 15 should be used, an 9 only when the process is still running after those.

      You are correct. But when I saw a program (...) that does not exit itself, I made the unwarranted assumption that the original writer of the program didn't seem particularly interested in cleaning up.