[Internal: dbus auto-activation patch]
authorJooHark Park <juhaki.park@samsung.com>
Wed, 3 Jul 2013 12:44:17 +0000 (21:44 +0900)
committerJooHark Park <juhaki.park@samsung.com>
Wed, 3 Jul 2013 12:44:17 +0000 (21:44 +0900)
=====================================
[Problem]
-
[Cause]
-
[Solution]
- dbus auto-activation patch
=====================================

Change-Id: Ie4bb6ab22b2b11d9cf016345f90cbdf09b0d206c

com.samsung.omadsagent.service
packaging/oma-ds-agent.service
src/agent/main/main.c

index 15ae0c5..3c5db30 100755 (executable)
@@ -1,3 +1,4 @@
 [D-BUS Service]
 Name=com.samsung.omadsagent
 Exec=/usr/bin/oma-ds-agent
+User=root
index 438d5c3..f2ddb4a 100755 (executable)
@@ -4,7 +4,7 @@ After=calendar.service contacts-service.service pushd.service msg-service.servic
 
 [Service]
 #Type=forking
-ExecStart=/usr/bin/oma-ds-agent
+ExecStart=/usr/bin/oma-ds-agent 'booting'
 
 [Install]
 WantedBy=graphical.target
\ No newline at end of file
index b6795de..2e3a730 100755 (executable)
@@ -232,10 +232,25 @@ static void _agent_daemon_signal_handler(int signo, siginfo_t * info, void *p_co
        _INNER_FUNC_EXIT;
 }
 
-int main()
+int main(int argc, char *argv[])
 {
        _EXTERN_FUNC_ENTER;
 
+       if( argc == 2  ) {
+               if(strncmp(argv[1], "booting", strlen("booting")) == 0) {
+                       FILE * pFile_ds_enabled = NULL;
+                       pFile_ds_enabled = fopen("/opt/usr/data/oma-ds/.oma-ds-agent-enabled", "r");
+                       if(pFile_ds_enabled == NULL) {
+                               exit(0);
+                       }
+
+                       if(pFile_ds_enabled != NULL) {
+                               fclose(pFile_ds_enabled);
+                               pFile_ds_enabled = NULL;
+                       }
+               }
+       }
+
        struct sigaction sig_act;
 
        sync_agent_event_error_e error = SYNC_AGENT_EVENT_SUCCESS;