Add systemd service 09/217709/5 accepted/tizen/unified/20191127.141724 submit/tizen/20191126.081457
authorJaehyun Kim <jeik01.kim@samsung.com>
Wed, 13 Nov 2019 11:19:53 +0000 (20:19 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Mon, 25 Nov 2019 12:36:01 +0000 (21:36 +0900)
Change-Id: I575a499c947158395f9b00aaa616147de139f3ff
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
packaging/clat.service [new file with mode: 0644]
packaging/clat.spec
packaging/org.tizen.clatd.service

diff --git a/packaging/clat.service b/packaging/clat.service
new file mode 100644 (file)
index 0000000..6650ba7
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=CLAT Daemon
+
+[Service]
+Type=dbus
+BusName=org.tizen.clatd
+User=network_fw
+Group=network_fw
+SmackProcessLabel=System
+ExecStart=/usr/bin/clatd
+Capabilities=cap_net_admin,cap_net_raw,cap_ipc_lock,cap_setuid,cap_setgid=i
+SecureBits=keep-caps
index c08bfb2..c1cbae5 100644 (file)
@@ -5,6 +5,7 @@ Release:       2
 Source:        %{name}-%{version}.tar.gz
 Source1:       dbus-1/org.tizen.clatd.service
 Source2:       dbus-1/org.tizen.clatd.conf
+Source3:       dbus-1/clat.service
 License:       Apache-2.0
 Group:         System/Network
 BuildRequires: cmake
@@ -14,6 +15,8 @@ BuildRequires: pkgconfig(gio-2.0)
 BuildRequires: pkgconfig(glib-2.0)
 BuildRequires: pkgconfig(libcares)
 BuildRequires: libcap-devel
+Requires:      systemd
+Requires:      security-config
 
 %description
 This package provides CLAT Daemon, which provides the nat 4->6 translation needed
@@ -57,10 +60,14 @@ cp %{SOURCE1} %{buildroot}%{_datadir}/dbus-1/system-services/org.tizen.clatd.ser
 mkdir -p %{buildroot}%{_sysconfdir}/dbus-1/system.d/
 cp -v %{SOURCE2} %{buildroot}%{_sysconfdir}/dbus-1/system.d/org.tizen.clatd.conf
 
+mkdir -p %{buildroot}%{_libdir}/systemd/system/
+cp -v %{SOURCE3} %{buildroot}%{_libdir}/systemd/system/
+
 %files
 %manifest clatd.manifest
 %attr(644,-,-) %{_sysconfdir}/*.conf
 %attr(644,root,root) %{_datadir}/dbus-1/system-services/*
 %attr(644,root,root) %{_sysconfdir}/dbus-1/system.d/org.tizen.clatd.conf
+%attr(644,root,root) %{_libdir}/systemd/system/clat.service
 %{_bindir}/clatd
 %license LICENSE
index 6ccd599..6bae659 100644 (file)
@@ -1,4 +1,4 @@
 [D-BUS Service]
 Name=org.tizen.clatd
-Exec=/usr/bin/clatd
-User=root
+Exec=/bin/false
+SystemdService=clat.service