common: use systemd-tmpfiles to create /run/buxton2 23/48323/1
authorSuchang Woo <suchang.woo@samsung.com>
Fri, 18 Sep 2015 05:49:17 +0000 (14:49 +0900)
committerSuchang Woo <suchang.woo@samsung.com>
Fri, 18 Sep 2015 06:02:14 +0000 (15:02 +0900)
Change-Id: I6dc30788be3c00748f1594ff0fb8d8a89e6c860f
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
packaging/buxton2-pre.service [deleted file]
packaging/buxton2.service
packaging/buxton2.socket
packaging/buxton2.spec
packaging/buxton2.tmpfiles.conf [new file with mode: 0644]

diff --git a/packaging/buxton2-pre.service b/packaging/buxton2-pre.service
deleted file mode 100644 (file)
index 5099ec5..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Setup for Buxton2 service
-
-[Service]
-Type=oneshot
-ExecStart=/bin/sh -c 'mkdir -p /run/buxton2 && chmod 700 /run/buxton2 && chown buxton:buxton /run/buxton2'
-RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
index 377908a..8b23d93 100644 (file)
@@ -1,7 +1,6 @@
 [Unit]
 Description=Buxton2 Configuration Service
-Requires=buxton2-pre.service
-After=buxton2-pre.service
+After=systemd-tmpfiles-setup.service
 
 [Service]
 Environment=BUXTON_CYNARA_PERMISSIVE_MODE=1
index ecb0ddd..8bc662c 100644 (file)
@@ -1,5 +1,5 @@
 [Unit]
-Description=Buxton Configuration Service
+Description=Buxton2 Configuration Service
 
 [Socket]
 ListenStream=/run/buxton2-0
index 950d130..c1aa9e1 100644 (file)
@@ -8,7 +8,7 @@ Source0:        %{name}-%{version}.tar.gz
 Source1:        %{name}.conf
 Source2:        %{name}.service
 Source3:        %{name}.socket
-Source4:        %{name}-pre.service
+Source4:        %{name}.tmpfiles.conf
 Source1001:     %{name}.manifest
 BuildRequires:  cmake
 BuildRequires:  gdbm-devel
@@ -116,7 +116,8 @@ install -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}.conf
 install -m 755 -d %{buildroot}%{_unitdir}
 install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
 install -m 644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.socket
-install -m 644 %{SOURCE4} %{buildroot}%{_unitdir}/%{name}-pre.service
+install -m 755 -d %{buildroot}%{_tmpfilesdir}
+install -m 644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/%{name}.conf
 
 # enable socket activation
 install -m 755 -d %{buildroot}%{_unitdir}/sockets.target.wants
@@ -153,7 +154,7 @@ chsmack -a System "${dbdir}"
 %{_libdir}/libbuxton2.so.*
 %{_unitdir}/%{name}.service
 %{_unitdir}/%{name}.socket
-%{_unitdir}/%{name}-pre.service
+%{_tmpfilesdir}/%{name}.conf
 %{_unitdir}/sockets.target.wants/%{name}.socket
 %attr(0700,buxton,buxton) %dir %{_localstatedir}/lib/%{name}
 
diff --git a/packaging/buxton2.tmpfiles.conf b/packaging/buxton2.tmpfiles.conf
new file mode 100644 (file)
index 0000000..fbc36a8
--- /dev/null
@@ -0,0 +1,2 @@
+# Buxton2 volatile storage directory
+d /run/buxton2 0770 buxton buxton -