Re: Too Slow To Stop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mike - EMAIL IGNORED wrote:
> 
> #
> #  08/07/07
> #
> # chkconfig: 35 90 1
> # description: controls proc daemons
> #
> # Source function library.
> . /etc/init.d/functions
> 
> proc_prog=proc
> 
> VAR_SUBSYS_PROC=/var/lock/subsys/$proc_prog
> 
> if [ ! -x /usr/sbin/$proc_prog ]; then
>     echo -n $"/usr/sbin/$proc_prog does not exist."; failure; echo
>     exit -1
> fi
> 
> case $1 in
>    start)
>       if test -e $VAR_SUBSYS_PROC; then
>          echo_failure
>          echo
>       else
>          touch $VAR_SUBSYS_PROC
>          echo -n "Starting $proc_prog: "
>          OPTIONS="--daemon"
>          daemon --user=root /usr/sbin/$proc_prog $OPTIONS
>          echo
>       fi
>    ;;
>    stop)
>       echo -n "Stopping $proc_prog: "
>       killproc $proc_prog
>       echo
>       rm -f $VAR_SUBSYS_PROC
>    ;;
>    restart)
>       echo $0
>       $0 stop
>       sleep 2
>       $0 start
>    ;;
>    condrestart)
>       if test -e $VAR_SUBSYS_PROC; then
>          $0 stop
>          # avoid race
>          sleep 2
>          $0 start
>       else
>          echo -n Conditional Restart $proc_prog: not running
>          success; echo
>      fi
>    ;;
> #  reload)
> #  ;;
> #  status)
> #  ;;
>    *)
> 
>    echo "Usage: $DAEMON {start|stop|restart|condrestart|reload|status}"
You may want to change this to reflect that you do not implement
reload and status.

     echo "Usage: $DAEMON start|stop|restart|condrestart}"

>    exit 1
> esac
> 
with a couple of minor changes, the script looks fine. The problem
may be that your proc does not respond to a SIGTERM, so it is not
killed until the killproc function sends a SIGKILL. If this is the
case, then you may want to change "killproc $proc_prog" to
"killproc $proc_prog SIGKILL" so that it sends the kill signal right
away. A better fix would be if the process would respond to a
SIGTERM by doing a proper shutdown. Does your program trap SIGTERM
and do anything with it? (Or trap and ignore it?)

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux