SHA256
1
0
forked from pool/openvswitch

Accepting request 160488 from home:tpaszkowski:fixovsctrl

- Fix openvswitch-controller init script
- Add openflow-controller sysconfig file with default binding to ptcp:

OBS-URL: https://build.opensuse.org/request/show/160488
OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=20
This commit is contained in:
Marcus Meissner 2013-03-23 08:19:57 +00:00 committed by Git OBS Bridge
parent 5f721e7fe9
commit ef809c2ca7
4 changed files with 31 additions and 24 deletions

View File

@ -56,7 +56,7 @@ LOGFILE=$LOGDIR/$NAME.log # Server logfile
# is set start-stop-daemon will chuid the server # is set start-stop-daemon will chuid the server
# Include defaults if available # Include defaults if available
default=/etc/default/openvswitch-controller default=/etc/sysconfig/openvswitch-controller
if [ -f $default ] ; then if [ -f $default ] ; then
. $default . $default
fi fi
@ -69,7 +69,7 @@ if [ -n "$DAEMONUSER" ] ; then
DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'` DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'`
DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'` DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'`
else else
log_failure_msg "The user $DAEMONUSER, required to run $NAME does not exist." echo "The user $DAEMONUSER, required to run $NAME does not exist."
exit 1 exit 1
fi fi
fi fi
@ -135,7 +135,7 @@ start_server() {
# Start the process using the wrapper # Start the process using the wrapper
if [ -z "$DAEMONUSER" ] ; then if [ -z "$DAEMONUSER" ] ; then
start-stop-daemon --start --pidfile $PIDFILE \ start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- --detach --pidfile=$PIDFILE \ --exec $DAEMON -- --detach --pidfile=$PIDFILE \
$LISTEN $DAEMON_OPTS $SSL_OPTS $LISTEN $DAEMON_OPTS $SSL_OPTS
errcode=$? errcode=$?
@ -196,35 +196,32 @@ force_stop() {
case "$1" in case "$1" in
start) start)
log_daemon_msg "Starting $DESC " "$NAME" echo "Starting $DESC " "$NAME"
# Check if it's running first # Check if it's running first
if running ; then if running ; then
log_progress_msg "apparently already running" echo "apparently already running"
log_end_msg 0
exit 0 exit 0
fi fi
if start_server && running ; then if start_server && running ; then
# It's ok, the server started and is running # It's ok, the server started and is running
log_end_msg 0 :
else else
# Either we could not start it or it is not running # Either we could not start it or it is not running
# after we did # after we did
# NOTE: Some servers might die some time after they start, # NOTE: Some servers might die some time after they start,
# this code does not try to detect this and might give # this code does not try to detect this and might give
# a false positive (use 'status' for that) # a false positive (use 'status' for that)
log_end_msg 1 :
fi fi
;; ;;
stop) stop)
log_daemon_msg "Stopping $DESC" "$NAME" echo "Stopping $DESC" "$NAME"
if running ; then if running ; then
# Only stop the server if we see it running # Only stop the server if we see it running
stop_server stop_server
log_end_msg $?
else else
# If it's not running don't do anything # If it's not running don't do anything
log_progress_msg "apparently not running" echo "apparently not running"
log_end_msg 0
exit 0 exit 0
fi fi
;; ;;
@ -233,36 +230,32 @@ case "$1" in
$0 stop $0 stop
if running; then if running; then
# If it's still running try to kill it more forcefully # If it's still running try to kill it more forcefully
log_daemon_msg "Stopping (force) $DESC" "$NAME" echo "Stopping (force) $DESC" "$NAME"
force_stop force_stop
log_end_msg $?
fi fi
;; ;;
restart|force-reload) restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME" echo "Restarting $DESC" "$NAME"
stop_server stop_server
# Wait some sensible amount, some server need this # Wait some sensible amount, some server need this
[ -n "$DODTIME" ] && sleep $DODTIME [ -n "$DODTIME" ] && sleep $DODTIME
start_server start_server
running running
log_end_msg $?
;; ;;
status) status)
log_daemon_msg "Checking status of $DESC" "$NAME" echo "Checking status of $DESC" "$NAME"
if running ; then if running ; then
log_progress_msg "running" echo "running"
log_end_msg 0
else else
log_progress_msg "apparently not running" echo "apparently not running"
log_end_msg 1
exit 1 exit 1
fi fi
;; ;;
# Use this if the daemon cannot reload # Use this if the daemon cannot reload
reload) reload)
log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon" echo "Reloading $NAME daemon: not implemented, as the daemon"
log_warning_msg "cannot re-read the config file (use restart)." echo "cannot re-read the config file (use restart)."
;; ;;
*) *)
N=/etc/init.d/openvswitch-controller N=/etc/init.d/openvswitch-controller

View File

@ -0,0 +1,5 @@
# This is a POSIX shell fragment -*- sh -*-
# listen arguments
#
LISTEN="ptcp:"

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Mar 21 13:23:36 UTC 2013 - tpaszkowski@novell.com
- Fix openvswitch-controller init script
- Add openflow-controller sysconfig file with default binding to ptcp:
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Mar 12 13:36:57 UTC 2013 - tpaszkowski@suse.com Tue Mar 12 13:36:57 UTC 2013 - tpaszkowski@suse.com

View File

@ -33,8 +33,8 @@ Source1: preamble
Source2: openvswitch-switch.init Source2: openvswitch-switch.init
Source3: openvswitch-switch.template Source3: openvswitch-switch.template
Source4: openvswitch-switch.logrotate Source4: openvswitch-switch.logrotate
Source5: openvswitch-controller.init Source5: openvswitch-controller.init
Source6: openvswitch-controller.sysconfig
# brcompat is going to be deprecated soon # brcompat is going to be deprecated soon
# PATCH-FEATURE-UPSTREAM openvswitch-1.7.0-stp-fwd-delay.patch -- Set STP bridge forward delay # PATCH-FEATURE-UPSTREAM openvswitch-1.7.0-stp-fwd-delay.patch -- Set STP bridge forward delay
Patch1: %name-1.7.0-stp-fwd-delay.patch Patch1: %name-1.7.0-stp-fwd-delay.patch
@ -283,6 +283,8 @@ install -d -m 755 %{buildroot}/var/adm/fillup-templates
install -m 644 %SOURCE3 \ install -m 644 %SOURCE3 \
%{buildroot}/var/adm/fillup-templates/sysconfig.%{name}-switch %{buildroot}/var/adm/fillup-templates/sysconfig.%{name}-switch
install -m 644 %SOURCE6 \
%{buildroot}/var/adm/fillup-templates/sysconfig.%{name}-controller
install -m 755 %SOURCE2 \ install -m 755 %SOURCE2 \
%{buildroot}/%_sysconfdir/init.d/%{name}-switch %{buildroot}/%_sysconfdir/init.d/%{name}-switch
ln -s %_sysconfdir/init.d/%{name}-switch %{buildroot}%{_sbindir}/rc%{name}-switch ln -s %_sysconfdir/init.d/%{name}-switch %{buildroot}%{_sbindir}/rc%{name}-switch
@ -373,6 +375,7 @@ rmdir %{buildroot}%{_datadir}/%{name}/python
%{_sysconfdir}/init.d/openvswitch-controller %{_sysconfdir}/init.d/openvswitch-controller
%{_sbindir}/rc%{name}-controller %{_sbindir}/rc%{name}-controller
%{_mandir}/man8/ovs-controller.8.gz %{_mandir}/man8/ovs-controller.8.gz
/var/adm/fillup-templates/sysconfig.openvswitch-controller
%files -n python-openvswitch %files -n python-openvswitch
%defattr(-,root,root) %defattr(-,root,root)