Skip to content

Commit 24e8109

Browse files
author
Justin Pettit
committed
debian: Bring Debian packaging in-line with new file locations
This commit brings the Debian packaging in-line with the similar changes that were made to XenServer in commit bc39196.
1 parent 87eeed4 commit 24e8109

14 files changed

Lines changed: 67 additions & 48 deletions

debian/openvswitch-controller.init

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ NAME=ovs-controller # Introduce the short server's name here
3535
DESC=ovs-controller # Introduce a short description here
3636
LOGDIR=/var/log/openvswitch # Log directory to use
3737

38-
PIDFILE=/var/run/$NAME.pid
38+
PIDFILE=/var/run/openvswitch/$NAME.pid
3939

4040
test -x $DAEMON || exit 0
4141

debian/openvswitch-monitor.default

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ THRESHOLD=3
1818
INTERVAL=1
1919

2020
# LOG_FILE: File to log messages related to monitoring.
21-
LOG_FILE="/var/log/openvswitch/monitor"
21+
LOG_FILE="/var/log/openvswitch/ovs-monitor.log"
2222

2323
# SWITCH_VCONN: The vconn used to connect to the switch
2424
# (ovs-openflowd). The ovs-openflowd must be configured to listen to
2525
# this vconn. The default here set is also listened to by default by
2626
# the openvswitch-switch package, so ordinarily there is no need to
2727
# modify this.
28-
SWITCH_VCONN="/var/run/ovs-openflowd.mgmt"
28+
SWITCH_VCONN="/var/run/openvswitch/ovs-openflowd.mgmt"

debian/openvswitch-monitor.init

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
3737

3838
DAEMON=/usr/sbin/ovs-monitor
39-
NAME=openvswitch-monitor
39+
NAME=ovs-monitor
4040
DESC="Open vSwitch switch monitor"
4141

42-
PIDFILE=/var/run/$NAME.pid
42+
PIDFILE=/var/run/openvswitch/$NAME.pid
4343

4444
test -x $DAEMON || exit 0
4545

debian/openvswitch-pki-server.postinst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# postinst script for openflow
2+
# postinst script for openflow-pki-server
33
#
44
# see: dh_installdeb(1)
55

debian/openvswitch-pki.postinst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# postinst script for openvswitch
2+
# postinst script for openvswitch-pki
33
#
44
# see: dh_installdeb(1)
55

debian/openvswitch-switch.init

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ running_pid()
6666
# running name
6767
#
6868
# Checks for a running process named 'name' by looking for a pidfile
69-
# named /var/run/${name}.pid
69+
# named /var/run/openvswitch/${name}.pid
7070
running()
7171
{
7272
local name=$1
73-
local pidfile=/var/run/${name}.pid
73+
local pidfile=/var/run/openvswitch/${name}.pid
7474

7575
# No pidfile, probably no daemon present
7676
[ ! -f "$pidfile" ] && return 1
@@ -84,11 +84,11 @@ running()
8484
# force_stop name
8585
#
8686
# Checks for a running process named 'name', by looking for a pidfile
87-
# named /var/run/${name}.pid, and then kills it and waits for it to
88-
# die.
87+
# named /var/run/openvswitch/${name}.pid, and then kills it and waits
88+
# for it to die.
8989
force_stop() {
9090
local name=$1
91-
local pidfile=/var/run/${name}.pid
91+
local pidfile=/var/run/openvswitch/${name}.pid
9292

9393
[ ! -f "$pidfile" ] && return
9494
if running $name; then
@@ -206,14 +206,16 @@ case "$1" in
206206

207207
# Create an empty configuration database if it doesn't exist.
208208
if test ! -e /etc/openvswitch/conf.db; then
209+
install -d -m 755 -o root -g root /etc/openvswitch
210+
209211
# Create configuration database.
210212
ovsdb-tool -vANY:console:emer \
211-
create /etc/openvswitch-switch/conf \
213+
create /etc/openvswitch/conf.db \
212214
/usr/share/openvswitch/vswitch.ovsschema
213215
else
214216
# Upgrade or downgrade schema and compact database.
215217
ovsdb-tool -vANY:console:emer \
216-
convert /etc/openvswitch-switch/conf \
218+
convert /etc/openvswitch/conf.db \
217219
/usr/share/openvswitch/vswitch.ovsschema
218220
fi
219221

@@ -223,19 +225,29 @@ case "$1" in
223225
monitor_opt=
224226
fi
225227

228+
if [ ! -d /var/run/openvswitch ]; then
229+
install -d -m 755 -o root -g root /var/run/openvswitch
230+
fi
231+
232+
if [ ! -d /var/log/openvswitch ]; then
233+
install -d -m 755 -o root -g root /var/log/openvswitch
234+
fi
235+
226236
# Start ovsdb-server.
227237
set --
238+
set -- "$@" /etc/openvswitch/conf.db
228239
set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err
229-
set -- "$@" --log-file
240+
set -- "$@" --log-file=/var/log/openvswitch/ovsdb-server.log
230241
set -- "$@" --detach --pidfile $monitor_opt
231-
set -- "$@" --remote punix:/var/run/ovsdb-server
232-
set -- "$@" /etc/openvswitch-switch/conf
242+
set -- "$@" --remote punix:/var/run/openvswitch/db.sock
243+
set -- "$@" --remote db:Open_vSwitch,managers
233244
set -- "$@" --private-key=db:SSL,private_key
234245
set -- "$@" --certificate=db:SSL,certificate
235246
set -- "$@" --bootstrap-ca-cert=db:SSL,ca_cert
236247
set -- "$@" $OVSDB_SERVER_OPTS
237248
echo -n "Starting ovsdb-server: "
238-
start-stop-daemon --start --quiet --pidfile /var/run/ovsdb-server.pid \
249+
start-stop-daemon --start --quiet \
250+
--pidfile /var/run/openvswitch/ovsdb-server.pid \
239251
--exec $ovsdb_server -- "$@"
240252
if running ovsdb-server; then
241253
echo "ovsdb-server."
@@ -248,12 +260,13 @@ case "$1" in
248260
# Start ovs-vswitchd.
249261
set --
250262
set -- "$@" --verbose=ANY:console:emer --verbose=ANY:syslog:err
251-
set -- "$@" --log-file
263+
set -- "$@" --log-file=/var/log/openvswitch/ovs-vswitchd.log
252264
set -- "$@" --detach --pidfile $monitor_opt
253-
set -- "$@" unix:/var/run/ovsdb-server
265+
set -- "$@" unix:/var/run/openvswitch/db.sock
254266
set -- "$@" $OVS_VSWITCHD_OPTS
255267
echo -n "Starting ovs-vswitchd: "
256-
start-stop-daemon --start --quiet --pidfile /var/run/ovs-vswitchd.pid \
268+
start-stop-daemon --start --quiet \
269+
--pidfile /var/run/openvswitch/ovs-vswitchd.pid \
257270
--exec $ovs_vswitchd -- "$@"
258271
if running ovs-vswitchd; then
259272
echo "ovs-vswitchd."
@@ -264,13 +277,13 @@ case "$1" in
264277
stop)
265278
echo -n "Stopping ovs-vswitchd: "
266279
start-stop-daemon --stop --quiet --oknodo \
267-
--pidfile /var/run/ovs-vswitchd.pid \
280+
--pidfile /var/run/openvswitch/ovs-vswitchd.pid \
268281
--exec $ovs_vswitchd
269282
echo "ovs-vswitchd."
270283

271284
echo -n "Stopping ovsdb-server: "
272285
start-stop-daemon --stop --quiet --oknodo \
273-
--pidfile /var/run/ovsdb-server.pid \
286+
--pidfile /var/run/openvswitch/ovsdb-server.pid \
274287
--exec $ovsdb_server
275288
echo "ovsdb-server."
276289
;;
Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
/var/log/openvswitch/ovs-openflowd.log {
2-
daily
3-
compress
4-
create 640 root adm
5-
delaycompress
6-
missingok
7-
rotate 30
8-
postrotate
9-
ovs-appctl --target=ovs-openflowd vlog/reopen
10-
endscript
1+
/var/log/openvswitch/*.log {
2+
daily
3+
compress
4+
create 640 root adm
5+
delaycompress
6+
missingok
7+
rotate 30
8+
postrotate
9+
# Tell Open vSwitch daemons to reopen their log files
10+
if [ -e /var/run/openvswitch/ovs-vswitchd.pid ]; then
11+
ovs-appctl --t ovs-vswitchd vlog/reopen
12+
fi
13+
if [ -e /var/run/openvswitch/ovsdb-server.pid ]; then
14+
ovs-appctl --t ovsdb-server vlog/reopen
15+
fi
16+
endscript
1117
}

debian/openvswitch-switch.postrm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ set -e
2121

2222
case "$1" in
2323
purge)
24-
rm -f /etc/openvswitch-switch/conf
25-
rm -f /etc/openvswitch-switch/.conf.~lock~
24+
rm -f /etc/openvswitch/conf.db
25+
rm -f /etc/openvswitch/.conf.db.~lock~
2626
rm -f /etc/default/openvswitch-switch
2727
rm -f /var/log/openvswitch/*
2828
;;

debian/openvswitch-switch.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# e.g. "--fail=open"
1010
OVSDB_SERVER_OPTS=
1111

12-
# OVS_VSWITCHD_OPTS: Additional options to pass to ovs-openflowd,
12+
# OVS_VSWITCHD_OPTS: Additional options to pass to ovs-vswitchd,
1313
# e.g. "--fail=open"
1414
OVS_VSWITCHD_OPTS=
1515

debian/openvswitch-switchui.default

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# The ovs-openflowd must be configured to listen to this vconn. The default
1414
# here set is also listened to by default by the openvswitch-switch
1515
# package, so ordinarily there is no need to modify this.
16-
SWITCH_VCONN="unix:/var/run/ovs-openflowd.mgmt"
16+
SWITCH_VCONN="unix:/var/run/openvswitch/ovs-openflowd.mgmt"
1717

1818
# EZIO3_DEVICE: To display the switch monitor on an EZIO3 (aka
1919
# MTB-134) 16x2 LCD displays found on server appliances made by

0 commit comments

Comments
 (0)