@@ -114,8 +114,10 @@ int hyperiond_start(service_t* service)
114
114
{
115
115
int res = 0 ;
116
116
if (!is_elevated ()) {
117
+ ERR ("hyperiond_start: Not elevated" );
117
118
return 1 ;
118
119
} else if (is_running (service -> daemon_pid )) {
120
+ ERR ("hyperiond_start: Daemon already running" );
119
121
return 2 ;
120
122
}
121
123
@@ -141,8 +143,10 @@ int hyperiond_stop(service_t* service)
141
143
int res = 0 ;
142
144
143
145
if (!is_elevated ()) {
146
+ ERR ("hyperiond_stop: Not elevated" );
144
147
return 1 ;
145
148
} else if (!is_running (service -> daemon_pid )) {
149
+ ERR ("hyperiond_stop: Daemon not running" );
146
150
return 2 ;
147
151
}
148
152
@@ -169,20 +173,20 @@ int hyperiond_version(service_t* service)
169
173
if (service -> hyperiond_version == NULL ) {
170
174
service -> hyperiond_version = (char * )calloc (FILENAME_MAX , 1 );
171
175
if (service -> hyperiond_version == NULL ) {
172
- // Buffer allocation failed
176
+ ERR ( "hyperiond_version: Failed version buf allocation" );
173
177
return 1 ;
174
178
}
175
179
176
180
char * command = hyperiond_version_cmdline ();
177
181
// Spawn process with read-only pipe
178
182
FILE * fp = popen (command , "r" );
179
183
if (fp == NULL ) {
180
- // Opening process failed
184
+ ERR ( "hyperiond_version: popen failed" );
181
185
res = 2 ;
182
186
} else {
183
187
int bytes_read = fread (service -> hyperiond_version , 1 , FILENAME_MAX , fp );
184
188
if (bytes_read == 0 ) {
185
- // Reading process' stdout failed
189
+ ERR ( "hyperiond_version: Reading process' stdout failed" );
186
190
res = 3 ;
187
191
}
188
192
@@ -306,6 +310,8 @@ bool service_method_terminate(LSHandle* sh, LSMessage* msg, void* data __attribu
306
310
LSError lserror ;
307
311
LSErrorInit (& lserror );
308
312
313
+ WARN ("service_method_terminate: Terminating" );
314
+
309
315
jvalue_ref jobj = jobject_create ();
310
316
jobject_set (jobj , j_cstr_to_buffer ("returnValue" ), jboolean_create (true));
311
317
@@ -352,6 +358,7 @@ int main()
352
358
}
353
359
354
360
if (!registered ) {
361
+ ERR ("Failed luna-service registration!" );
355
362
LSErrorFree (& lserror );
356
363
return -1 ;
357
364
}
0 commit comments