Skip to content

Commit

Permalink
rhel: Fix systemd monitoring wrong pid for ovs-monitor-ipsec.
Browse files Browse the repository at this point in the history
Other services are running without monitors, so systemd can properly
track the pid.  But ovs-monitor-ipsec is running with a monitor, so
there is one more fork and systemd complains about the pid file:

  systemd[1]: openvswitch-ipsec.service: Supervising process 1037185
              which is not our child. We'll most likely not notice
              when it exits.

This is also causing some spurious kills sent to the child on service
stop.

Fix by running ovs-monitor-ipsec without a monitor as all other OVS
services.

We can't use start_daemon, that would take care of this, because the
script is not on the PATH and we don't want to accidentally change
permissions for OVS directories (ipsec runs as root), but we can mimic
the behavior.

Fixes: f385abd ("rhel: Use PIDFile on forking systemd service files")
Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
igsilya committed Jan 10, 2025
1 parent e63e2ef commit 956f21a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rhel/usr_lib_systemd_system_openvswitch-ipsec.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ EnvironmentFile=/etc/openvswitch/default.conf
EnvironmentFile=-/etc/sysconfig/openvswitch
EnvironmentFile=-/run/openvswitch.useropts

ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
ExecStart=/usr/share/openvswitch/scripts/ovs-ctl --no-monitor \
--ike-daemon=libreswan start-ovs-ipsec $OPTIONS
ExecStop=/usr/share/openvswitch/scripts/ovs-ctl stop-ovs-ipsec

Expand Down
3 changes: 2 additions & 1 deletion utilities/ovs-ctl.in
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ start_ovs_ipsec () {
set ${datadir}/scripts/ovs-monitor-ipsec unix:"$DB_SOCK"
set "$@" --log-file=${logdir}/ovs-monitor-ipsec.log
set "$@" --pidfile=${rundir}/ovs-monitor-ipsec.pid
set "$@" --detach --monitor
set "$@" --detach
test X"$MONITOR" = Xno || set "$@" --monitor
set "$@" --ike-daemon=$IKE_DAEMON
if test X$RESTART_IKE_DAEMON = Xno; then
set "$@" --no-restart-ike-daemon
Expand Down

0 comments on commit 956f21a

Please sign in to comment.