Convert launchpad-preload systemd service to instantiated unit
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 14 Aug 2012 01:13:33 +0000 (10:13 +0900)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 16 Oct 2012 19:33:07 +0000 (21:33 +0200)
Applications launched from lauchpad (aul_ utility functions) expect
to see the same environment as in user-session@app.service.

This commit brings launchpad's environment in line with user-session@.

Change-Id: Idc928505aff139fc664b8209c53ad51ddadc67b4

packaging/aul.spec
packaging/launchpad-preload@.service [moved from packaging/launchpad-preload.service with 65% similarity]

index 402fce2..647ccd1 100644 (file)
@@ -5,7 +5,7 @@ Release:    1
 Group:      System/Libraries
 License:    Apache License, Version 2.0
 Source0:    %{name}-%{version}.tar.gz
-Source101:  launchpad-preload.service
+Source101:  launchpad-preload@.service
 Source102:  ac.service
 
 Requires(post): /sbin/ldconfig
@@ -69,15 +69,15 @@ sqlite3 %{buildroot}/opt/dbspace/.mida.db < %{buildroot}/usr/share/aul/mida_db.s
 rm -rf %{buildroot}/usr/share/aul/mida_db.sql
 
 mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
-install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/system/launchpad-preload.service
+install -m 0644 %SOURCE101 %{buildroot}%{_libdir}/systemd/system/launchpad-preload@.service
 install -m 0644 %SOURCE102 %{buildroot}%{_libdir}/systemd/system/ac.service
-ln -s ../launchpad-preload.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/launchpad-preload.service
+ln -s ../launchpad-preload@.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/launchpad-preload@app.service
 ln -s ../ac.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/ac.service
 
 
 %preun
 if [ $1 == 0 ]; then
-    systemctl stop launchpad-preload.service
+    systemctl stop launchpad-preload@app.service
     systemctl stop ac.service
 fi
 
@@ -85,7 +85,7 @@ fi
 /sbin/ldconfig
 systemctl daemon-reload
 if [ $1 == 1 ]; then
-    systemctl restart launchpad-preload.service
+    systemctl restart launchpad-preload@app.service
     systemctl restart ac.service
 fi
 
@@ -111,9 +111,9 @@ systemctl daemon-reload
 /usr/share/aul/preexec_list.txt
 %{_bindir}/launchpad_preloading_preinitializing_daemon
 %{_bindir}/ac_daemon
-%{_libdir}/systemd/system/multi-user.target.wants/launchpad-preload.service
+%{_libdir}/systemd/system/multi-user.target.wants/launchpad-preload@app.service
 %{_libdir}/systemd/system/multi-user.target.wants/ac.service
-%{_libdir}/systemd/system/launchpad-preload.service
+%{_libdir}/systemd/system/launchpad-preload@.service
 %{_libdir}/systemd/system/ac.service
 
 %files devel
similarity index 65%
rename from packaging/launchpad-preload.service
rename to packaging/launchpad-preload@.service
index d463788..3ce1144 100644 (file)
@@ -3,7 +3,9 @@ Description=Start the preload/preinit daemon
 
 [Service]
 EnvironmentFile=/etc/sysconfig/tizen-mobile-ui
+Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket
 Environment=DISPLAY=:0
+Environment=XDG_RUNTIME_DIR=/run/user/%I
 ExecStart=/usr/bin/launchpad_preloading_preinitializing_daemon
 
 [Install]