Forum Moderators: coopster & phranque

Message Too Old, No Replies

Scripting Help

         

Anubix

5:21 pm on May 9, 2001 (gmt 0)



I'm working on a script as follows:

#!/bin/sh

/bin/chmod -R 777 /var/log/radacct/199.*
cp /etc/raddb/users.temp /etc/raddb/users
rm /etc/raddb/users.temp_*
/bin/kill -HUP 301
~
~; 'cat /etc/raddb/radiusd.pid ¦awk '{print $1}''

it's fairly simple, but for some reason, the kill part does not work...the first part of the script works perfect, but i can't get it to work entirely...
it's runing on FreeBSD 4.2-Release, using the csh shell...

if anyone could help me it would be greatly appreciated...of if u couldn't help, help me get pointed in the right direction...

thanx

evinrude

6:12 pm on May 9, 2001 (gmt 0)

10+ Year Member



My guess is the PID you are trying to kill isn't always going to be 301. Processes grab different numbers each time a new one is created. Applications often write their PID to a file (typically stored in a directory such as /var/run). If the application you are wanting to kill does this, you could grab the PID from that file, and kill it that way.

Anubix

6:18 pm on May 9, 2001 (gmt 0)



okay...i'll take a look at that and see what happens, thanx...