mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
- Fix rc-script. Split restart command on stop/start and fix runing order.
Approved by: maintainer
This commit is contained in:
parent
85bbd85f43
commit
201c2fdb4c
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=216157
2 changed files with 28 additions and 17 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
PORTNAME= quagga
|
||||
PORTVERSION= 0.99.10
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= net ipv6
|
||||
MASTER_SITES= http://quagga.net/download/ \
|
||||
http://www.ru.quagga.net/download/ \
|
||||
|
|
|
@ -37,6 +37,25 @@ stop_postcmd()
|
|||
rm -f $pidfile
|
||||
}
|
||||
|
||||
do_cmd()
|
||||
{
|
||||
for daemon in ${quagga_daemons}; do
|
||||
command=%%PREFIX%%/sbin/${daemon}
|
||||
required_files=%%SYSCONF_DIR%%/${daemon}.conf
|
||||
pidfile=%%LOCALSTATE_DIR%%/${daemon}.pid
|
||||
if [ ${quagga_cmd} = "start" -a ! -f ${required_files} ]; then
|
||||
continue
|
||||
fi
|
||||
if [ ${quagga_cmd} = "stop" -a -z $(check_process ${command}) ]; then
|
||||
continue
|
||||
fi
|
||||
eval flags=\$\{${daemon}_flags:-\"${quagga_flags}\"\}
|
||||
name=${daemon}
|
||||
run_rc_command "$1"
|
||||
_rc_restart_done=false
|
||||
done
|
||||
}
|
||||
|
||||
# set defaults
|
||||
|
||||
load_rc_config $name
|
||||
|
@ -63,28 +82,19 @@ case "${quagga_cmd}" in
|
|||
if [ ! -z ${quagga_extralibs_path} ]; then
|
||||
/sbin/ldconfig -m ${quagga_extralibs_path}
|
||||
fi
|
||||
do_cmd "start"
|
||||
;;
|
||||
stop|restart)
|
||||
stop)
|
||||
quagga_daemons=$(reverse_list ${quagga_daemons})
|
||||
do_cmd "stop"
|
||||
;;
|
||||
restart)
|
||||
quagga_daemons=$(reverse_list ${quagga_daemons})
|
||||
do_cmd "stop"
|
||||
quagga_daemons=$(reverse_list ${quagga_daemons})
|
||||
do_cmd "start"
|
||||
esac
|
||||
|
||||
for daemon in ${quagga_daemons}; do
|
||||
command=%%PREFIX%%/sbin/${daemon}
|
||||
required_files=%%SYSCONF_DIR%%/${daemon}.conf
|
||||
pidfile=%%LOCALSTATE_DIR%%/${daemon}.pid
|
||||
if [ ${quagga_cmd} = "start" -a ! -f ${required_files} ]; then
|
||||
continue
|
||||
fi
|
||||
if [ ${quagga_cmd} = "stop" -a -z $(check_process ${command}) ]; then
|
||||
continue
|
||||
fi
|
||||
eval flags=\$\{${daemon}_flags:-\"${quagga_flags}\"\}
|
||||
name="${daemon}"
|
||||
run_rc_command "$1"
|
||||
_rc_restart_done=false
|
||||
done
|
||||
|
||||
if [ "${quagga_delay}" != "0" ]; then
|
||||
echo "Sleeping ${quagga_delay} seconds to obtain dynamic routing information..."
|
||||
sleep ${quagga_delay}
|
||||
|
|
Loading…
Add table
Reference in a new issue