On Wed, Dec 26, 2001 at 05:56:52AM +0530, mukund wrote:
> 
> It may sound absurd but i am stuck up.
> 
> How do i communicate with a running process from command line?
> 
> The daemon is written by me in perl, it accept username:passwd 
> string and returns OK or NOOK, depending on passwd match.
> ps -A gives the PID of daemon.
> 
> Any Idea?
> 
> 
---end quoted text---

Did'nt get the problem clearly. Do you want to execute some
program if OK and quit if NOOK ? There is no  way  you  can
modify the execution strategy of a daemon itself during ex-
ecution.

Normally if daemons are running, you write a  .pid  file in
/var/run, and check for its existance from the second prog-
ram if you want the second program to  run  depending  upon 
the pid status. As root, you  can  ofcourse  grep ps output
and take necessary action. You can also kill the process if
so desired with 'kill <process-id>'. The same  is  true  if 
the perl script has been invoked as an user  and  killed by
the same user.

However, for a process started by root, which  may  be used
by users, /var/run/progname.pid is perhaps the  better app-
roach, if users are to start another process  based  on the
daemon status.

Bish
    


--
:
####[ Linux One Stanza Tip (LOST) ]###########################

Sub : Listing partition                              LOST #067

To know the total size of hard disk inclusive of Non-Linux and
non-formatted partitions, as root do:

     #echo p | fdisk /dev/hdX 2> /dev/null 
     (where X is a, b, c etc)
OR   #fdisk -l (this will list all drives together)
  
####<[EMAIL PROTECTED]>####################################
:

_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to