2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 09:58:01 +00:00
ovs/rhel/usr_lib_systemd_system_ovsdb-server.service
Timothy Redaelli 113f925aa5 rhel: Use /run instead of /var/run.
Systemd unit file generates warnings about PID file path since /var/run
is a legacy path so just use /run instead of /var/run.

/var/run is a symlink of /run starting from RHEL7 (and any other distribution
that uses systemd).

Reported-at: https://bugzilla.redhat.com/1952081
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
2021-11-08 22:45:49 +01:00

32 lines
1.3 KiB
Desktop File

[Unit]
Description=Open vSwitch Database Unit
After=syslog.target network-pre.target
Before=network.target network.service
Wants=ovs-delete-transient-ports.service
PartOf=openvswitch.service
[Service]
Type=forking
PIDFile=/run/openvswitch/ovsdb-server.pid
Restart=on-failure
EnvironmentFile=/etc/openvswitch/default.conf
EnvironmentFile=-/etc/sysconfig/openvswitch
EnvironmentFile=-/run/openvswitch.useropts
# Environment is reloaded for each Exec*, make sure to
# remove openvswitch.useropts first to reload a fresh
# OVS_USER_ID from default.conf or sysconfig.
ExecStartPre=/usr/bin/rm -f /run/openvswitch.useropts
ExecStartPre=-/usr/bin/chown ${OVS_USER_ID} /run/openvswitch /var/log/openvswitch
ExecStartPre=/bin/sh -c '/usr/bin/echo "OVS_USER_ID=${OVS_USER_ID}" > /run/openvswitch.useropts'
ExecStartPre=/bin/sh -c 'if [ "$${OVS_USER_ID/:*/}" != "root" ]; then /usr/bin/echo "OVS_USER_OPT=--ovs-user=${OVS_USER_ID}" >> /run/openvswitch.useropts; fi'
ExecStart=/usr/share/openvswitch/scripts/ovs-ctl \
--no-ovs-vswitchd --no-monitor --system-id=random \
${OVS_USER_OPT} \
start $OPTIONS
ExecStop=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop
ExecReload=/usr/share/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd \
${OVS_USER_OPT} \
--no-monitor restart $OPTIONS