From 13f695d83627143a6a0040852daddcdbf12fa092 Mon Sep 17 00:00:00 2001 From: "gs86.lee" Date: Fri, 26 Jun 2015 10:57:22 +0900 Subject: [PATCH] Add path file to launch starter Change-Id: I67c6dde712a84170f7024665311406222d78bab6 --- packaging/starter-pre.path | 5 +++++ packaging/starter-pre.service | 1 + packaging/starter.path | 5 +++++ packaging/starter.service | 1 + packaging/starter.spec | 47 ++++++++++++++++++++++++--------------- packaging/wait-lock.service | 15 ------------- rd3starter | 2 +- src/mobile/lock_mgr.c | 51 ------------------------------------------- 8 files changed, 42 insertions(+), 85 deletions(-) create mode 100644 packaging/starter-pre.path create mode 100644 packaging/starter.path delete mode 100644 packaging/wait-lock.service diff --git a/packaging/starter-pre.path b/packaging/starter-pre.path new file mode 100644 index 0000000..5abc563 --- /dev/null +++ b/packaging/starter-pre.path @@ -0,0 +1,5 @@ +[Unit] +Description=Start the "starter" program + +[Path] +PathExists=/run/.wm_ready diff --git a/packaging/starter-pre.service b/packaging/starter-pre.service index bbbf95b..2329ba9 100644 --- a/packaging/starter-pre.service +++ b/packaging/starter-pre.service @@ -2,6 +2,7 @@ Description=Pre actions for "starter" [Service] +EnvironmentFile=/run/tizen-system-env Type=oneshot ExecStart=/etc/init.d/rd3starter SmackProcessLabel=starter diff --git a/packaging/starter.path b/packaging/starter.path new file mode 100644 index 0000000..5abc563 --- /dev/null +++ b/packaging/starter.path @@ -0,0 +1,5 @@ +[Unit] +Description=Start the "starter" program + +[Path] +PathExists=/run/.wm_ready diff --git a/packaging/starter.service b/packaging/starter.service index 08e4873..2a8bc63 100644 --- a/packaging/starter.service +++ b/packaging/starter.service @@ -4,6 +4,7 @@ Requires=starter-pre.service After=starter-pre.service wm_ready.service ac.service deviced.service launchpad-preload.service [Service] +EnvironmentFile=/run/tizen-system-env ExecStart=/usr/bin/starter Restart=always RestartSec=0 diff --git a/packaging/starter.spec b/packaging/starter.spec index 0a4736d..4daed74 100644 --- a/packaging/starter.spec +++ b/packaging/starter.spec @@ -1,4 +1,5 @@ %bcond_with wayland +%define __libdir /usr/lib Name: starter Summary: starter @@ -8,8 +9,9 @@ Group: TO_BE/FILLED_IN License: Apache-2.0 Source0: starter-%{version}.tar.gz Source1: starter.service -Source2: wait-lock.service +Source2: starter.path Source3: starter-pre.service +Source4: starter-pre.path %if "%{?tizen_profile_name}"=="tv" ExcludeArch: %{arm} %ix86 x86_64 @@ -105,21 +107,28 @@ make -j1 rm -rf %{buildroot} %make_install -mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants -install -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/starter.service -install -m 0644 %SOURCE3 %{buildroot}%{_libdir}/systemd/system/starter-pre.service -ln -s ../starter.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/starter.service -mkdir -p %{buildroot}%{_libdir}/systemd/system/tizen-system.target.wants -install -m 0644 %SOURCE2 %{buildroot}%{_libdir}/systemd/system/wait-lock.service -ln -s ../wait-lock.service %{buildroot}%{_libdir}/systemd/system/tizen-system.target.wants/ +mkdir -p %{buildroot}%{__libdir}/systemd/system/multi-user.target.wants +mkdir -p %{buildroot}%{__libdir}/systemd/system/tizen-system.target.wants +mkdir -p %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ + +install -m 0644 %SOURCE1 %{buildroot}%{__libdir}/systemd/system/starter.service +ln -s ../starter.service %{buildroot}%{__libdir}/systemd/system/multi-user.target.wants/starter.service +ln -s %{__libdir}/systemd/system/starter.service %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ + +install -m 0644 %SOURCE2 %{buildroot}%{__libdir}/systemd/system/starter.path +ln -s ../starter.path %{buildroot}%{__libdir}/systemd/system/multi-user.target.wants/starter.path + +install -m 0644 %SOURCE3 %{buildroot}%{__libdir}/systemd/system/starter-pre.service +ln -s ../starter-pre.service %{buildroot}%{__libdir}/systemd/system/multi-user.target.wants/starter-pre.service +ln -s %{__libdir}/systemd/system/starter-pre.service %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ + +install -m 0644 %SOURCE4 %{buildroot}%{__libdir}/systemd/system/starter-pre.path +ln -s ../starter-pre.path %{buildroot}%{__libdir}/systemd/system/multi-user.target.wants/starter-pre.path + mkdir -p %{buildroot}/usr/share/license cp -f LICENSE %{buildroot}/usr/share/license/%{name} mkdir -p %{buildroot}/opt/data/home-daemon -mkdir -p %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ -ln -s %{_libdir}/systemd/system/starter.service %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ -ln -s %{_libdir}/systemd/system/starter-pre.service %{buildroot}%{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ - %post change_file_executable() { @@ -139,7 +148,6 @@ vconftool set -t string db/private/starter/fallback_pkg "org.tizen.homescreen" $ mkdir -p %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ -ln -s %{_libdir}/systemd/system/wait-lock.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/ #ln -sf /etc/init.d/rd4starter /etc/rc.d/rc4.d/S81starter #ln -sf /etc/init.d/rd4starter /etc/rc.d/rc3.d/S81starter @@ -152,13 +160,16 @@ sync %{_sysconfdir}/init.d/rd4starter %{_sysconfdir}/init.d/rd3starter %{_bindir}/starter -%{_libdir}/systemd/system/starter.service -%{_libdir}/systemd/system/multi-user.target.wants/starter.service +%{__libdir}/systemd/system/starter.service +%{__libdir}/systemd/system/starter.path +%{__libdir}/systemd/system/starter-pre.service +%{__libdir}/systemd/system/starter-pre.path +%{__libdir}/systemd/system/multi-user.target.wants/starter.service +%{__libdir}/systemd/system/multi-user.target.wants/starter.path +%{__libdir}/systemd/system/multi-user.target.wants/starter-pre.service +%{__libdir}/systemd/system/multi-user.target.wants/starter-pre.path %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/starter.service -%{_libdir}/systemd/system/starter-pre.service %{_sysconfdir}/systemd/default-extra-dependencies/ignore-units.d/starter-pre.service -%{_libdir}/systemd/system/wait-lock.service -%{_libdir}/systemd/system/tizen-system.target.wants/wait-lock.service /usr/share/license/%{name} /opt/data/home-daemon /usr/share/locale/*/LC_MESSAGES/* diff --git a/packaging/wait-lock.service b/packaging/wait-lock.service deleted file mode 100644 index 607434a..0000000 --- a/packaging/wait-lock.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=wait lockscreen -After=tizen-boot.target boot-animation.service -Requires=tizen-boot.target -Before=tizen-system.target -ConditionPathExists=|/tmp/.passwordlock - -[Service] -Type=oneshot -ExecStart=/bin/sh -c 'while [ -e /tmp/.passwordlock ]; do sleep 0.5 ; done' -TimeoutSec=7s -SmackProcessLabel=starter - -[Install] -WantedBy=tizen-system.target diff --git a/rd3starter b/rd3starter index b9762ab..ce80d71 100644 --- a/rd3starter +++ b/rd3starter @@ -6,7 +6,7 @@ # sleep 0.1 #done -while [ ! -f /tmp/amd_ready ]; +while [ ! -f /run/amd_ready ]; do /bin/sleep 0.1 done diff --git a/src/mobile/lock_mgr.c b/src/mobile/lock_mgr.c index 3d81ed1..7dc0a3f 100644 --- a/src/mobile/lock_mgr.c +++ b/src/mobile/lock_mgr.c @@ -559,48 +559,6 @@ ERROR: -static void _check_ongoing(bool ongoing) -{ - if (ongoing) { - /* check previous process */ - if (s_lock_mgr.checkfd) { - _E("checkfd fail"); - return; - } - - if (access(PASSWORD_LOCK_PROGRESS, F_OK) == 0) { - _E("file(%s) is exist", PASSWORD_LOCK_PROGRESS); - return; - } - - /* make tmp file */ - s_lock_mgr.checkfd = creat(PASSWORD_LOCK_PROGRESS, 0640); - - if (s_lock_mgr.checkfd < 0) { - _E("Failed to make %s file", PASSWORD_LOCK_PROGRESS); - s_lock_mgr.checkfd = 0; - } - - _W("make %s file", PASSWORD_LOCK_PROGRESS); - s_lock_mgr.checkfd = 1; - } else { - if (!s_lock_mgr.checkfd) { - _E("checkfd is NULL"); - return; - } - - if (unlink(PASSWORD_LOCK_PROGRESS) < 0) { - _E("Failed to remove %s file", PASSWORD_LOCK_PROGRESS); - } - - close(s_lock_mgr.checkfd); - s_lock_mgr.checkfd = 0; - _W("delete %s file", PASSWORD_LOCK_PROGRESS); - } -} - - - static void _lock_daemon_init(void) { _SECURE_D("default lock screen pkg name is %s", status_passive_get()->setappl_3rd_lock_pkg_name_str); @@ -648,15 +606,6 @@ int lock_mgr_daemon_start(void) lock_type = status_active_get()->setappl_screen_lock_type_int; _D("lock type : %d", lock_type); - if (lock_type == SETTING_SCREEN_LOCK_TYPE_SIMPLE_PASSWORD || - lock_type == SETTING_SCREEN_LOCK_TYPE_PASSWORD) { - if (s_lock_mgr.checkfd) { - _check_ongoing(EINA_FALSE); - } else { - _check_ongoing(EINA_TRUE); - } - } - ret = lock_mgr_lockscreen_launch(); _D("ret : %d", ret); -- 2.7.4