[EMAIL PROTECTED] wrote:

> Hello All,
>
> I would like to be able to start/stop a daemon called super written in
> python.  I placed a script called super in the /etc/rc.d/init.d directory.
> This script looks like the majority of the other daemons located in the
> same directory with start, stop, status etc functions.  When the super
> daemon starts, it also starts 4 python threads.  So, using gtop, I can see
> that I have 6 processes started:  2 shell processes  and 4 python
> processes.  The stop function in my super script looks like this:
>
> stop)
>      echo -n "Stopping super: "
>         killproc super
>         RETVAL=$?
>      echo
>      [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/super
>
>      echo -n "Stopping python threads: "
>         killproc python
>         RETVAL=$?
>      echo
>      [ $RETVAL -eq 0 ]
>      ;;
>
> The shell processes (taken care of by killproc super) kill fine.  The
> problem I am running into is with the command killproc python.  It tries to
> kill all 4 python threads but when the parent process is killed,the other
> three automatically die.  So I end up getting errors such as:
> "/etc/init.d/super:  kill: (1584)- no such pid" for each of the three pids.
>
> Any thoughts on how to fix this or get around the three error messages?

Don't killproc the python threads?  just  a thought or maybe you want to kill
them first.   I haven't programmed in python, but if this were C, or Perl I
would trap the kill signal and shutdown my children first.  If they shutdown
properly then I would shutdown the parent and  return zero or what ever
killproc wants to feel happy.  If they (anyone of my children) didn't shutdown
I would return something that whould make killproc become angry.   Is killproc
a function of python? I'm just curious since I don't see any info or manual
pages?

>
>
> Thanks in advance!
> Rebecca
>
> _______________________________________________
> Redhat-devel-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Mojo



_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

Reply via email to