rc.subr (131061) | rc.subr (131135) |
---|---|
1# $NetBSD: rc.subr,v 1.60 2003/07/26 05:13:47 lukem Exp $ | 1# $NetBSD: rc.subr,v 1.60 2003/07/26 05:13:47 lukem Exp $ |
2# $FreeBSD: head/etc/rc.subr 131061 2004-06-24 16:57:49Z mtm $ | 2# $FreeBSD: head/etc/rc.subr 131135 2004-06-26 09:27:30Z mtm $ |
3# 4# Copyright (c) 1997-2002 The NetBSD Foundation, Inc. 5# All rights reserved. 6# 7# This code is derived from software contributed to The NetBSD Foundation 8# by Luke Mewburn. 9# 10# Redistribution and use in source and binary forms, with or without --- 476 unchanged lines hidden (view full) --- 487 command=$_overide_command 488 fi 489 490 _keywords="start stop restart rcvar $extra_commands" 491 rc_pid= 492 _pidcmd= 493 _procname=${procname:-${command}} 494 | 3# 4# Copyright (c) 1997-2002 The NetBSD Foundation, Inc. 5# All rights reserved. 6# 7# This code is derived from software contributed to The NetBSD Foundation 8# by Luke Mewburn. 9# 10# Redistribution and use in source and binary forms, with or without --- 476 unchanged lines hidden (view full) --- 487 command=$_overide_command 488 fi 489 490 _keywords="start stop restart rcvar $extra_commands" 491 rc_pid= 492 _pidcmd= 493 _procname=${procname:-${command}} 494 |
495 # setup pid check command if not fast 496 if [ -z "$rc_fast" -a -n "$_procname" ]; then | 495 # setup pid check command 496 if [ -n "$_procname" ]; then |
497 if [ -n "$pidfile" ]; then 498 _pidcmd='rc_pid=$(check_pidfile '"$pidfile $_procname $command_interpreter"')' 499 else 500 _pidcmd='rc_pid=$(check_process '"$_procname $command_interpreter"')' 501 fi 502 if [ -n "$_pidcmd" ]; then 503 _keywords="${_keywords} status poll" 504 fi --- 76 unchanged lines hidden (view full) --- 581 echo "${name} is running as pid $rc_pid." 582 else 583 echo "${name} is not running." 584 return 1 585 fi 586 ;; 587 588 start) | 497 if [ -n "$pidfile" ]; then 498 _pidcmd='rc_pid=$(check_pidfile '"$pidfile $_procname $command_interpreter"')' 499 else 500 _pidcmd='rc_pid=$(check_process '"$_procname $command_interpreter"')' 501 fi 502 if [ -n "$_pidcmd" ]; then 503 _keywords="${_keywords} status poll" 504 fi --- 76 unchanged lines hidden (view full) --- 581 echo "${name} is running as pid $rc_pid." 582 else 583 echo "${name} is not running." 584 return 1 585 fi 586 ;; 587 588 start) |
589 if [ -n "$rc_pid" ]; then | 589 if [ -z "$rc_fast" -a -n "$rc_pid" ]; then |
590 echo "${name} already running? (pid=$rc_pid)." 591 exit 1 592 fi 593 594 if [ ! -x ${_chroot}${command} ]; then 595 info "run_rc_command: cannot run ($command)." 596 return 0 597 fi --- 68 unchanged lines hidden (view full) --- 666 if [ -n "${_postcmd}" ]; then 667 debug "run_rc_command: evaluating ${_postcmd}()." 668 eval $_postcmd 669 fi 670 ;; 671 672 stop) 673 if [ -z "$rc_pid" ]; then | 590 echo "${name} already running? (pid=$rc_pid)." 591 exit 1 592 fi 593 594 if [ ! -x ${_chroot}${command} ]; then 595 info "run_rc_command: cannot run ($command)." 596 return 0 597 fi --- 68 unchanged lines hidden (view full) --- 666 if [ -n "${_postcmd}" ]; then 667 debug "run_rc_command: evaluating ${_postcmd}()." 668 eval $_postcmd 669 fi 670 ;; 671 672 stop) 673 if [ -z "$rc_pid" ]; then |
674 [ -n "$rc_fast" ] && exit 0 |
|
674 if [ -n "$pidfile" ]; then 675 echo \ 676 "${name} not running? (check $pidfile)." 677 else 678 echo "${name} not running?" 679 fi 680 exit 1 681 fi --- 606 unchanged lines hidden --- | 675 if [ -n "$pidfile" ]; then 676 echo \ 677 "${name} not running? (check $pidfile)." 678 else 679 echo "${name} not running?" 680 fi 681 exit 1 682 fi --- 606 unchanged lines hidden --- |