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:
parent
5f721e7fe9
commit
ef809c2ca7
@ -56,7 +56,7 @@ LOGFILE=$LOGDIR/$NAME.log # Server logfile
|
||||
# is set start-stop-daemon will chuid the server
|
||||
|
||||
# Include defaults if available
|
||||
default=/etc/default/openvswitch-controller
|
||||
default=/etc/sysconfig/openvswitch-controller
|
||||
if [ -f $default ] ; then
|
||||
. $default
|
||||
fi
|
||||
@ -69,7 +69,7 @@ if [ -n "$DAEMONUSER" ] ; then
|
||||
DAEMONUID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $3}'`
|
||||
DAEMONGID=`getent passwd |grep "^$DAEMONUSER:" | awk -F : '{print $4}'`
|
||||
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
|
||||
fi
|
||||
fi
|
||||
@ -135,7 +135,7 @@ start_server() {
|
||||
|
||||
# Start the process using the wrapper
|
||||
if [ -z "$DAEMONUSER" ] ; then
|
||||
start-stop-daemon --start --pidfile $PIDFILE \
|
||||
start-stop-daemon --start --quiet --pidfile $PIDFILE \
|
||||
--exec $DAEMON -- --detach --pidfile=$PIDFILE \
|
||||
$LISTEN $DAEMON_OPTS $SSL_OPTS
|
||||
errcode=$?
|
||||
@ -196,35 +196,32 @@ force_stop() {
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
log_daemon_msg "Starting $DESC " "$NAME"
|
||||
echo "Starting $DESC " "$NAME"
|
||||
# Check if it's running first
|
||||
if running ; then
|
||||
log_progress_msg "apparently already running"
|
||||
log_end_msg 0
|
||||
echo "apparently already running"
|
||||
exit 0
|
||||
fi
|
||||
if start_server && running ; then
|
||||
# It's ok, the server started and is running
|
||||
log_end_msg 0
|
||||
:
|
||||
else
|
||||
# Either we could not start it or it is not running
|
||||
# after we did
|
||||
# NOTE: Some servers might die some time after they start,
|
||||
# this code does not try to detect this and might give
|
||||
# a false positive (use 'status' for that)
|
||||
log_end_msg 1
|
||||
:
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
log_daemon_msg "Stopping $DESC" "$NAME"
|
||||
echo "Stopping $DESC" "$NAME"
|
||||
if running ; then
|
||||
# Only stop the server if we see it running
|
||||
stop_server
|
||||
log_end_msg $?
|
||||
else
|
||||
# If it's not running don't do anything
|
||||
log_progress_msg "apparently not running"
|
||||
log_end_msg 0
|
||||
echo "apparently not running"
|
||||
exit 0
|
||||
fi
|
||||
;;
|
||||
@ -233,36 +230,32 @@ case "$1" in
|
||||
$0 stop
|
||||
if running; then
|
||||
# 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
|
||||
log_end_msg $?
|
||||
fi
|
||||
;;
|
||||
restart|force-reload)
|
||||
log_daemon_msg "Restarting $DESC" "$NAME"
|
||||
echo "Restarting $DESC" "$NAME"
|
||||
stop_server
|
||||
# Wait some sensible amount, some server need this
|
||||
[ -n "$DODTIME" ] && sleep $DODTIME
|
||||
start_server
|
||||
running
|
||||
log_end_msg $?
|
||||
;;
|
||||
status)
|
||||
|
||||
log_daemon_msg "Checking status of $DESC" "$NAME"
|
||||
echo "Checking status of $DESC" "$NAME"
|
||||
if running ; then
|
||||
log_progress_msg "running"
|
||||
log_end_msg 0
|
||||
echo "running"
|
||||
else
|
||||
log_progress_msg "apparently not running"
|
||||
log_end_msg 1
|
||||
echo "apparently not running"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
# Use this if the daemon cannot reload
|
||||
reload)
|
||||
log_warning_msg "Reloading $NAME daemon: not implemented, as the daemon"
|
||||
log_warning_msg "cannot re-read the config file (use restart)."
|
||||
echo "Reloading $NAME daemon: not implemented, as the daemon"
|
||||
echo "cannot re-read the config file (use restart)."
|
||||
;;
|
||||
*)
|
||||
N=/etc/init.d/openvswitch-controller
|
||||
|
5
openvswitch-controller.sysconfig
Normal file
5
openvswitch-controller.sysconfig
Normal file
@ -0,0 +1,5 @@
|
||||
# This is a POSIX shell fragment -*- sh -*-
|
||||
|
||||
# listen arguments
|
||||
#
|
||||
LISTEN="ptcp:"
|
@ -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
|
||||
|
||||
|
@ -33,8 +33,8 @@ Source1: preamble
|
||||
Source2: openvswitch-switch.init
|
||||
Source3: openvswitch-switch.template
|
||||
Source4: openvswitch-switch.logrotate
|
||||
|
||||
Source5: openvswitch-controller.init
|
||||
Source6: openvswitch-controller.sysconfig
|
||||
# brcompat is going to be deprecated soon
|
||||
# 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
|
||||
@ -283,6 +283,8 @@ install -d -m 755 %{buildroot}/var/adm/fillup-templates
|
||||
|
||||
install -m 644 %SOURCE3 \
|
||||
%{buildroot}/var/adm/fillup-templates/sysconfig.%{name}-switch
|
||||
install -m 644 %SOURCE6 \
|
||||
%{buildroot}/var/adm/fillup-templates/sysconfig.%{name}-controller
|
||||
install -m 755 %SOURCE2 \
|
||||
%{buildroot}/%_sysconfdir/init.d/%{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
|
||||
%{_sbindir}/rc%{name}-controller
|
||||
%{_mandir}/man8/ovs-controller.8.gz
|
||||
/var/adm/fillup-templates/sysconfig.openvswitch-controller
|
||||
|
||||
%files -n python-openvswitch
|
||||
%defattr(-,root,root)
|
||||
|
Loading…
Reference in New Issue
Block a user