sigact.sa_sigaction = sighandler;
if (sigaction(SIGRTMIN, &sigact, 0) == 1) {
- printf("signal error\n");
+ printf("result: %s\n", "failed");
return -1;
}
} else {
// create service
ret = service_create(&serviceHandle);
if (SERVICE_ERROR_NONE != ret && NULL == serviceHandle) {
- LogError("Fail to create service");
- return FALSE;
+ printf("result: %s\n", "failed");
+ return -1;
}
}
group_list[0] = LOGGING_DEFAULT_GID;
if(setgroups(sizeof(group_list), group_list) < 0) {
- printf("can't set groups(%d)\n", LOGGING_DEFAULT_GID);
+ printf("result: %s\n", "failed");
return -1;
}
if(setreuid(WEBAPP_DEFAULT_UID, WEBAPP_DEFAULT_GID) < 0) {
- printf("can't set uid(%d)\n", WEBAPP_DEFAULT_UID);
+ printf("result: %s\n", "failed");
return -1;
}
// set package
ret = service_set_package(serviceHandle, pkgname);
if (SERVICE_ERROR_NONE != ret) {
- LogError("Fail to set package [" << ret << "]");
+ printf("result: %s\n", "failed");
service_destroy(serviceHandle);
return -1;
}
//launch service
ret = service_send_launch_request(serviceHandle, NULL, NULL);
if (SERVICE_ERROR_NONE != ret) {
- LogError("Fail to launch service [" << ret << "]");
+ printf("result: %s\n", "failed");
service_destroy(serviceHandle);
return -1;
}
printf("result: %s\n", "failed");
return -1;
}
+ // This text should be showed for IDE
+ printf("result: %s\n", "launched");
+ return 0;
} else if (op == 'k') {
bool isRunning = false;