replace module log saving path
authorJiwoong Im <jiwoong.im@samsung.com>
Mon, 28 Nov 2016 05:18:34 +0000 (14:18 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Tue, 6 Dec 2016 22:59:51 +0000 (07:59 +0900)
- Because of permission, replace /var/log to /run/alarmmgr_log

Change-Id: I239663fa965aab7b49efc74766a0743b2d13baad
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
alarm-manager.c
alarmmgr_log_dump.sh
packaging/alarm-agent.conf [deleted file]
packaging/alarm-manager.conf [new file with mode: 0644]
packaging/alarm-manager.spec

index b97b6c2..efa6356 100644 (file)
@@ -93,7 +93,7 @@ static int gfd = -1;
 #define ALARMMGR_LOG_BUFFER_STRING_SIZE        200
 #define ALARMMGR_LOG_TAG_SIZE          20
 #define ALARMMGR_LOG_MESSAGE_SIZE      120
-#define ALARMMGR_LOG_FILE_PATH "/var/log/alarmmgr.log"
+#define ALARMMGR_LOG_FILE_PATH "/run/alarmmgr_log/alarmmgr.log"
 static int log_index = 0;
 static int log_fd = 0;
 #endif
@@ -277,6 +277,9 @@ static void __rtc_set()
                                ALARM_MGR_EXCEPTION_PRINT("Alarm IRQs is not supported.");
 
                        ALARM_MGR_EXCEPTION_PRINT("RTC_WKALM_SET disabled ioctl is failed. errno = %s", strerror_r(errno, buf, sizeof(buf)));
+#ifdef _APPFW_FEATURE_ALARM_MANAGER_MODULE_LOG
+                       __save_module_log("FAIL: SET RTC", log_message);
+#endif
                        return;
                }
                ALARM_MGR_LOG_PRINT("[alarm-server]RTC_WKALM_SET disabled ioctl is successfully done.");
@@ -3400,7 +3403,7 @@ gboolean alarm_manager_alarm_get_all_info(AlarmManager *pObject, GDBusMethodInvo
        int index = 0;
        for (gs_iter = alarm_context.alarms; gs_iter != NULL; gs_iter = g_slist_next(gs_iter)) {
                entry = gs_iter->data;
-               if (entry->uid != uid)
+               if (uid >= REGULAR_UID_MIN && entry->uid != uid)
                        continue;
                ++index;
                SECURE_LOGD("#%d alarm id[%d] app_name[%s] duetime[%d]",
index 9851f1a..985e5ac 100644 (file)
@@ -3,7 +3,7 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin
 
 ALARMMGR_DUMP=$1/alarmmgr
 mkdir -p $ALARMMGR_DUMP
-cp -f /var/log/alarmmgr.log $ALARMMGR_DUMP
+cp -f /run/alarmmgr_log/alarmmgr.log $ALARMMGR_DUMP
 
 alarmmgr_get_all_info
 mv -f /tmp/alarmmgr_* $ALARMMGR_DUMP
diff --git a/packaging/alarm-agent.conf b/packaging/alarm-agent.conf
deleted file mode 100644 (file)
index eae0124..0000000
+++ /dev/null
@@ -1 +0,0 @@
-d /run/alarm_agent 0777 root users -
diff --git a/packaging/alarm-manager.conf b/packaging/alarm-manager.conf
new file mode 100644 (file)
index 0000000..e4d6a58
--- /dev/null
@@ -0,0 +1,2 @@
+d /run/alarm_agent 0777 root users -
+d /run/alarmmgr_log 0775 app_fw app_fw -
index 8d53662..6d54be0 100644 (file)
@@ -8,7 +8,7 @@ Source0:    %{name}-%{version}.tar.gz
 Source1:    alarm-server.service
 Source2:    alarm-session-agent.service
 Source3:    alarm-session-agent.socket
-Source4:    alarm-agent.conf
+Source4:    alarm-manager.conf
 Source5:    99-rtc.rules
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
@@ -112,7 +112,7 @@ install -m 0644 %SOURCE3 %{buildroot}%{_unitdir_user}/alarm-session-agent.socket
 ln -s ../alarm-server.service %{buildroot}%{_unitdir}/multi-user.target.wants/alarm-server.service
 ln -sf ../alarm_session_agent.socket %{buildroot}%{_unitdir_user}/sockets.target.wants/alarm-session-agent.socket
 mkdir -p %{buildroot}%{_tmpfilesdir}
-install -m 0644 %SOURCE4 %{buildroot}%{_tmpfilesdir}/alarm-agent.conf
+install -m 0644 %SOURCE4 %{buildroot}%{_tmpfilesdir}/alarm-manager.conf
 %if 0%{?appfw_feature_wakeup_using_rtc}
 mkdir -p %{buildroot}%{_libdir}/udev/rules.d
 install -m 0644 %SOURCE5 %{buildroot}%{_libdir}/udev/rules.d
@@ -146,7 +146,7 @@ cp -f scripts/108.alarmmgr_upgrade.sh %{buildroot}%{upgrade_script_path}
 %attr(0644,root,root) %{_datadir}/dbus-1/system-services/org.tizen.alarm.manager.service
 %license LICENSE
 %config %{_sysconfdir}/dbus-1/system.d/alarm-service.conf
-%{_tmpfilesdir}/alarm-agent.conf
+%{_tmpfilesdir}/alarm-manager.conf
 %if 0%{?appfw_feature_wakeup_using_rtc}
 %{_libdir}/udev/rules.d/99-rtc.rules
 %endif