Skip to content

Commit

Permalink
rhel: Use systemd Restart option for ovn-controllers.
Browse files Browse the repository at this point in the history
This change stops the use of OVS's monitor for the ovn-controller and
ovn-controller-vtep systemd services. Instead, the services use the
systemd Restart option to restart the services automatically if they
fail.

This patch changes the ovn-controller service Type from "oneshot" to
"forking". The Restart option is incompatible with oneshot services. The
patch does not change the ovn-controller-vtep service type from
"simple", however.

Signed-off-by: Mark Michelson <[email protected]>
Acked-by: Lance Richardson <[email protected]>
Signed-off-by: Russell Bryant <[email protected]>
  • Loading branch information
putnopvut authored and russellb committed Aug 3, 2017
1 parent d19cf8b commit 94896b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ovn/utilities/ovn-ctl
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ set_defaults () {

DB_SB_CREATE_INSECURE_REMOTE="no"
DB_NB_CREATE_INSECURE_REMOTE="no"

MONITOR="yes"
}

set_option () {
Expand Down
1 change: 1 addition & 0 deletions rhel/usr_lib_systemd_system_ovn-controller-vtep.service
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ After=openvswitch.service

[Service]
Type=simple
Restart=on-failure
Environment=OVS_RUNDIR=%t/openvswitch
Environment=OVN_DB=unix:%t/openvswitch/db.sock
Environment=VTEP_DB=unix:%t/openvswitch/db.sock
Expand Down
7 changes: 4 additions & 3 deletions rhel/usr_lib_systemd_system_ovn-controller.service
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ Requires=openvswitch.service
After=openvswitch.service

[Service]
Type=oneshot
RemainAfterExit=yes
Type=forking
Restart=on-failure
EnvironmentFile=-/etc/sysconfig/ovn-controller
ExecStart=/usr/share/openvswitch/scripts/ovn-ctl start_controller $OVN_CONTROLLER_OPTS
ExecStart=/usr/share/openvswitch/scripts/ovn-ctl --no-monitor \
start_controller $OVN_CONTROLLER_OPTS
ExecStop=/usr/share/openvswitch/scripts/ovn-ctl stop_controller

[Install]
Expand Down

0 comments on commit 94896b2

Please sign in to comment.