Use tmpfiles to create volatile directory, cleanup 03/42803/1
authorMaciej Wereski <m.wereski@partner.samsung.com>
Wed, 1 Jul 2015 13:34:06 +0000 (15:34 +0200)
committerMaciej Wereski <m.wereski@partner.samsung.com>
Wed, 1 Jul 2015 15:03:33 +0000 (17:03 +0200)
Since v218 of systemd tmpfiles have ability to set extended attributes.
It can be used to set SMACK labels.

Cleanup: remove obsolete SysV init script.

Change-Id: Ie4e20ee383380fa08d33d3c9a05d47d919b9de8b
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
launchpad_run [deleted file]
packaging/ac.conf [new file with mode: 0644]
packaging/ac.service
packaging/aul.spec

diff --git a/launchpad_run b/launchpad_run
deleted file mode 100755 (executable)
index 1ae8878..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-mkdir /tmp/alaunch
-chmod 1777 /tmp/alaunch
-
-
-/usr/bin/amd &
-/usr/bin/launchpad_preloading_preinitializing_daemon "                                                                                                                                                                                                         " &
diff --git a/packaging/ac.conf b/packaging/ac.conf
new file mode 100644 (file)
index 0000000..72b0804
--- /dev/null
@@ -0,0 +1,2 @@
+d      /tmp/alaunch    1777    root    root
+t      /tmp/alaunch    -       -       -       -       security.SMACK64=*
index 058f345..ef5ad7c 100644 (file)
@@ -7,8 +7,6 @@ Description=Start the Access Control server
 
 [Service]
 EnvironmentFile=-/run/tizen-system-env
-ExecStartPre=/usr/bin/mkdir -p -m 1777 /tmp/alaunch
-ExecStartPre=/usr/bin/chsmack -a * /tmp/alaunch
 ExecStart=/usr/bin/amd
 
 OOMScoreAdjust=-100
index 2115822..f417ec3 100644 (file)
@@ -8,6 +8,7 @@ Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
+Source100:  ac.conf
 Source101:  ac.service
 Source102:  ac.socket
 Source103:  amd_session_agent.service
@@ -87,21 +88,15 @@ CFLAGS="%{optflags} -D__emul__"; export CFLAGS
 rm -rf %{buildroot}
 %make_install
 
-mkdir -p %{buildroot}%{_sysconfdir}/init.d
-install -m 755 launchpad_run %{buildroot}%{_sysconfdir}/init.d
-
-mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc3.d
-mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc4.d
-ln -sf ../../init.d/launchpad_run %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S34launchpad_run
-ln -sf ../../init.d/launchpad_run %{buildroot}/%{_sysconfdir}/rc.d/rc4.d/S80launchpad_run
-
 mkdir -p %{buildroot}%{TZ_SYS_DB}
 sqlite3 %{buildroot}%{TZ_SYS_DB}/.mida.db < %{buildroot}%{_datadir}/aul/mida_db.sql
 rm -rf %{buildroot}%{_datadir}/aul/mida_db.sql
 
+mkdir -p %{buildroot}%{_tmpfilesdir}
 mkdir -p %{buildroot}%{_unitdir}/default.target.wants
 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
 mkdir -p %{buildroot}%{_unitdir_user}/sockets.target.wants
+install -m 0644 %SOURCE100 %{buildroot}%{_tmpfilesdir}/ac.conf
 install -m 0644 %SOURCE101 %{buildroot}%{_unitdir}/ac.service
 install -m 0644 %SOURCE102 %{buildroot}%{_unitdir}/ac.socket
 install -m 0644 %SOURCE103 %{buildroot}%{_unitdir_user}/amd_session_agent.service
@@ -133,9 +128,6 @@ systemctl daemon-reload
 %manifest %{name}.manifest
 %attr(0644,root,root) %{_libdir}/libaul.so.0
 %attr(0644,root,root) %{_libdir}/libaul.so.0.1.0
-%{_sysconfdir}/init.d/launchpad_run
-%attr(0755,root,root) %{_sysconfdir}/rc.d/rc3.d/S34launchpad_run
-%attr(0755,root,root) %{_sysconfdir}/rc.d/rc4.d/S80launchpad_run
 %config(noreplace) %attr(0644,root,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_DB}/.mida.db
 %config(noreplace) %attr(0644,root,%{TZ_SYS_USER_GROUP}) %{TZ_SYS_DB}/.mida.db-journal
 %attr(0755,root,root) %{_bindir}/aul_mime.sh
@@ -146,6 +138,7 @@ systemctl daemon-reload
 %{_datadir}/aul/service/*
 %{_datadir}/aul/preload_list.txt
 %{_datadir}/aul/preexec_list.txt
+%{_tmpfilesdir}/ac.conf
 %{_unitdir}/ac.service
 %{_unitdir}/default.target.wants/ac.service
 %{_unitdir}/ac.socket