From 7b68dc8b23bf30a7d86764df9bf7a1a09141a64f Mon Sep 17 00:00:00 2001 From: Suchang Woo Date: Fri, 18 Sep 2015 14:49:17 +0900 Subject: [PATCH] common: use systemd-tmpfiles to create /run/buxton2 Change-Id: I6dc30788be3c00748f1594ff0fb8d8a89e6c860f Signed-off-by: Suchang Woo --- packaging/buxton2-pre.service | 10 ---------- packaging/buxton2.service | 3 +-- packaging/buxton2.socket | 2 +- packaging/buxton2.spec | 7 ++++--- packaging/buxton2.tmpfiles.conf | 2 ++ 5 files changed, 8 insertions(+), 16 deletions(-) delete mode 100644 packaging/buxton2-pre.service create mode 100644 packaging/buxton2.tmpfiles.conf diff --git a/packaging/buxton2-pre.service b/packaging/buxton2-pre.service deleted file mode 100644 index 5099ec5..0000000 --- a/packaging/buxton2-pre.service +++ /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 diff --git a/packaging/buxton2.service b/packaging/buxton2.service index 377908a..8b23d93 100644 --- a/packaging/buxton2.service +++ b/packaging/buxton2.service @@ -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 diff --git a/packaging/buxton2.socket b/packaging/buxton2.socket index ecb0ddd..8bc662c 100644 --- a/packaging/buxton2.socket +++ b/packaging/buxton2.socket @@ -1,5 +1,5 @@ [Unit] -Description=Buxton Configuration Service +Description=Buxton2 Configuration Service [Socket] ListenStream=/run/buxton2-0 diff --git a/packaging/buxton2.spec b/packaging/buxton2.spec index 950d130..c1aa9e1 100644 --- a/packaging/buxton2.spec +++ b/packaging/buxton2.spec @@ -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 index 0000000..fbc36a8 --- /dev/null +++ b/packaging/buxton2.tmpfiles.conf @@ -0,0 +1,2 @@ +# Buxton2 volatile storage directory +d /run/buxton2 0770 buxton buxton - -- 2.7.4