1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-03 11:12:13 +00:00

net-mgmt/pandorafms_server: fix startup script

PR:		192915
Submitted by:	maintainer
This commit is contained in:
William Grzybowski 2014-08-22 16:55:01 +00:00
parent cc32519043
commit 729ccc2661
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=365676
2 changed files with 34 additions and 33 deletions

View File

@ -2,6 +2,8 @@
# $FreeBSD$
PORTNAME= pandora_server
PORTREVISION= 1
CATEGORIES= net-mgmt
MAINTAINER= koichiro@rworks.jp

View File

@ -4370,7 +4370,7 @@ Index: FreeBSD/pandora_server
#
# **********************************************************************
@@ -10,27 +11,66 @@
@@ -10,27 +11,65 @@
# REQUIRE: LOGIN mysql
# KEYWORD: shutdown
@ -4392,25 +4392,19 @@ Index: FreeBSD/pandora_server
-# read configuration and set defaults
-pandora_server_enable=${pandora_server_enable:-"NO"}
-load_rc_config $name
+: ${pandora_server_enable:=NO}
+: ${pandora_server_configfile:=/usr/local/etc/pandora/pandora_server.conf}
-PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
-
-pidfile=/var/run/$name.pid
command=/usr/local/bin/${name}
-command_args="-D -P ${pidfile} /usr/local/etc/pandora/pandora_server.conf"
-required_files="/usr/local/etc/pandora/pandora_server.conf"
+
+command=/usr/local/bin/${name}
+command_args="-D"
+command_interpreter=/usr/local/bin/perl
+_pidprefix=/var/run/$name
+pidfile=${_pidprefix}.pid
+required_files="$pandora_server_configfile"
+
load_rc_config $name
-procname="/usr/local/bin/perl"
+load_rc_config $name
-PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
+if [ "$2" ]; then
+ profile="$2"
+ if [ "$pandora_server_profiles" ]; then
@ -4424,31 +4418,36 @@ Index: FreeBSD/pandora_server
+ eval pandora_server_enable="\${pandora_server_${profile}_enable:-$pandora_server_enable}"
+ eval pandora_server_flags="\${pandora_server_${profile}_flags:-$pandora_server_flags}"
+ eval pidfile="\${pandora_server_${profile}_pidfile:-$pidfile}"
+ pandora_server_flags="$pandora_server_flags -P $pidfile $pandora_server_configfile"
+ else
+ echo "$0: extra argument ignored"
+ fi
+else
+ if [ "${pandora_server_profiles}" ] && [ "$1" ]; then
+ for profile in ${pandora_server_profiles}; do
+ eval _enable="\${pandora_server_${profile}_enable}"
+ case "${_enable:-${pandora_server_enable}}" in
+ [Yy][Ee][Ss]);;
+ *) continue;;
+ esac
+ echo "===> pandora_server profile: ${profile}"
+ /usr/local/etc/rc.d/pandora_server $1 ${profile}
+ retcode="$?"
+ if [ "0${retcode}" -ne 0 ]; then
+ failed="${profile} (${retcode}) ${failed:-}"
+ else
+ success="${profile} ${success:-}"
+ fi
+ done
+ exit 0
+ fi
+elif [ "${pandora_server_profiles}" ] && [ "$1" ]; then
+ for profile in ${pandora_server_profiles}; do
+ eval _enable="\${pandora_server_${profile}_enable}"
+ case "${_enable:-${pandora_server_enable}}" in
+ [Yy][Ee][Ss]);;
+ *) continue;;
+ esac
+ echo "===> pandora_server profile: ${profile}"
+ /usr/local/etc/rc.d/pandora_server $1 ${profile}
+ retcode="$?"
+ if [ "0${retcode}" -ne 0 ]; then
+ failed="${profile} (${retcode}) ${failed:-}"
+ else
+ success="${profile} ${success:-}"
+ fi
+ done
+ exit 0
+fi
+
-pidfile=/var/run/$name.pid
-command=/usr/local/bin/${name}
-command_args="-D -P ${pidfile} /usr/local/etc/pandora/pandora_server.conf"
-required_files="/usr/local/etc/pandora/pandora_server.conf"
+pandora_server_flags="$pandora_server_flags -P $pidfile $pandora_server_configfile"
-procname="/usr/local/bin/perl"
-
run_rc_command "$1"
Index: FreeBSD/pandora_server.conf
===================================================================