Remove User= and Group= from systemd service files

Service files of Osmocom programs will have User= and Group= in the
future, so these don't run as root. It was decided that for OE-based
systems, we will still run them as root for now.

Related: OS#5684, OS#4107
Change-Id: I68a8fba034aeb0e2923b2958b8d6842410d8b23c
diff --git a/recipes-osmocom/osmo-pcap/osmo-pcap.inc b/recipes-osmocom/osmo-pcap/osmo-pcap.inc
index 3f39103..e64ca88 100644
--- a/recipes-osmocom/osmo-pcap/osmo-pcap.inc
+++ b/recipes-osmocom/osmo-pcap/osmo-pcap.inc
@@ -5,7 +5,7 @@
 
 DEPENDS = "libosmocore zeromq libpcap gnutls"
 
-INC_PR="r1.${META_TELEPHONY_OSMO_INC}"
+INC_PR="r2.${META_TELEPHONY_OSMO_INC}"
 
 inherit autotools pkgconfig systemd
 
@@ -14,12 +14,18 @@
     "
 PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_system_unitdir},--without-systemdsystemunitdir"
 
-# StateDirectory requires systemd >= v235, but poky pyro ships with v232 (SYS#6340):
 do_install_append() {
+	# StateDirectory requires systemd >= v235, but poky pyro ships with v232 (SYS#6340):
 	sed -i '/^StateDirectory=/d' "${D}${systemd_system_unitdir}/osmo-pcap-server.service"
 	sed -i '/^WorkingDirectory=/d' "${D}${systemd_system_unitdir}/osmo-pcap-server.service"
 	sed -i '/^StateDirectory=/d' "${D}${systemd_system_unitdir}/osmo-pcap-client.service"
 	sed -i '/^WorkingDirectory=/d' "${D}${systemd_system_unitdir}/osmo-pcap-client.service"
+
+	# Run as root (OS#5684):
+	sed -i '/^User=/d' "${D}${systemd_system_unitdir}/osmo-pcap-server.service"
+	sed -i '/^Group=/d' "${D}${systemd_system_unitdir}/osmo-pcap-server.service"
+	sed -i '/^User=/d' "${D}${systemd_system_unitdir}/osmo-pcap-client.service"
+	sed -i '/^Group=/d' "${D}${systemd_system_unitdir}/osmo-pcap-client.service"
 }
 
 PACKAGES =+ "osmo-pcap-server osmo-pcap-client"