本文整理汇总了C++中service_start函数的典型用法代码示例。如果您正苦于以下问题:C++ service_start函数的具体用法?C++ service_start怎么用?C++ service_start使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了service_start函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: do_exec
int do_exec(int nargs, char** args) {
service* svc = make_exec_oneshot_service(nargs, args);
if (svc == NULL) {
return -1;
}
service_start(svc, NULL);
return 0;
}
开发者ID:HexagonRom,项目名称:android_system_core,代码行数:8,代码来源:builtins.cpp
示例2: service_start_if_not_disabled
static void service_start_if_not_disabled(struct service *svc)
{
if (!(svc->flags & SVC_DISABLED)) {
service_start(svc, NULL);
} else {
svc->flags |= SVC_DISABLED_START;
}
}
开发者ID:Bliss-Elite,项目名称:platform_system_core,代码行数:8,代码来源:builtins.cpp
示例3: console_service
static void
console_service (int argc, char ** argv)
{
log_printf ("%s %s: starting in console mode",
application_name, application_version);
SetConsoleCtrlHandler (control_handler, TRUE);
service_start (argc, argv);
control_break = FALSE;
}
开发者ID:cookrn,项目名称:openamq,代码行数:9,代码来源:smtserv.c
示例4: do_start
int do_start(int nargs, char **args)
{
struct service *svc;
svc = service_find_by_name(args[1]);
if (svc) {
service_start(svc, NULL);
}
return 0;
}
开发者ID:output,项目名称:platform_system_core,代码行数:9,代码来源:builtins.c
示例5: test_jsonrpc_main
static void
test_jsonrpc_main(int argc, char *argv[])
{
proctitle_init(argc, argv);
set_program_name(argv[0]);
service_start(&argc, &argv);
parse_options(argc, argv);
run_command(argc - optind, argv + optind, get_all_commands());
}
开发者ID:relaxdiego,项目名称:ovs,代码行数:9,代码来源:test-jsonrpc.c
示例6: service_restart
void service_restart(struct service *svc)
{
if (svc->flags & SVC_RUNNING) {
/* Stop, wait, then start the service. */
service_stop_or_reset(svc, SVC_RESTART);
} else if (!(svc->flags & SVC_RESTARTING)) {
/* Just start the service since it's not running. */
service_start(svc, NULL);
} /* else: Service is restarting anyways. */
}
开发者ID:chambejp,项目名称:system,代码行数:10,代码来源:init.c
示例7: main
int main(int argc, char **argv)
{
errval_t err;
debug_printf("Xeon Phi Manager started.\n");
err = service_start();
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "could not start the service\n");
}
}
开发者ID:MichaelFQuigley,项目名称:barrelfish,代码行数:11,代码来源:main.c
示例8: scmdatabase_autostart_services
static void scmdatabase_autostart_services(struct scmdatabase *db)
{
struct service_entry **services_list;
unsigned int i = 0;
unsigned int size = 32;
struct service_entry *service;
services_list = HeapAlloc(GetProcessHeap(), 0, size * sizeof(services_list[0]));
if (!services_list)
return;
scmdatabase_lock_shared(db);
LIST_FOR_EACH_ENTRY(service, &db->services, struct service_entry, entry)
{
if (service->config.dwStartType == SERVICE_BOOT_START ||
service->config.dwStartType == SERVICE_SYSTEM_START ||
service->config.dwStartType == SERVICE_AUTO_START)
{
if (i+1 >= size)
{
struct service_entry **slist_new;
size *= 2;
slist_new = HeapReAlloc(GetProcessHeap(), 0, services_list, size * sizeof(services_list[0]));
if (!slist_new)
break;
services_list = slist_new;
}
services_list[i] = service;
service->ref_count++;
i++;
}
}
scmdatabase_unlock(db);
size = i;
for (i = 0; i < size; i++)
{
DWORD err;
const WCHAR *argv[2];
service = services_list[i];
argv[0] = service->name;
argv[1] = NULL;
err = service_start(service, 1, argv);
if (err != ERROR_SUCCESS)
WINE_FIXME("Auto-start service %s failed to start: %d\n",
wine_dbgstr_w(service->name), err);
release_service(service);
}
HeapFree(GetProcessHeap(), 0, services_list);
}
开发者ID:Sunmonds,项目名称:wine,代码行数:53,代码来源:services.c
示例9: service_start
void CL_Service_Unix::service_thread_main(std::vector<CL_String> args)
{
service_start(args);
while (true)
{
int wakeup_reason = CL_Event::wait(stop_event, reload_event);
if (wakeup_reason == 1)
service_reload();
else
break;
}
service_stop();
}
开发者ID:Boerlam001,项目名称:proton_sdk_source,代码行数:13,代码来源:service_unix.cpp
示例10: service_restart
/* stop + start
*
* XXX: This should be refactored into a background job AND marked such
* so that the service monitor doesn't attempt to restart it!
*/
int service_restart(svc_t *svc)
{
int result = 0;
if (!svc)
return 1;
result += service_stop(svc);
sleep(1);
result += service_start(svc);
return result;
}
开发者ID:rrogers96,项目名称:finit,代码行数:18,代码来源:service.c
示例11: svc_dance
/* Singing and dancing ... */
static void svc_dance(svc_t *svc)
{
svc_cmd_t cmd = service_enabled(svc, 0, NULL);
if (svc->pid) {
if (SVC_STOP == cmd)
service_stop(svc);
else if (SVC_RELOAD == cmd)
service_reload(svc);
} else {
if (SVC_START == cmd || SVC_RELOAD == cmd)
service_start(svc);
}
}
开发者ID:rrogers96,项目名称:finit,代码行数:15,代码来源:service.c
示例12: do_enable
int do_enable(int nargs, char **args)
{
struct service *svc;
svc = service_find_by_name(args[1]);
if (svc) {
svc->flags &= ~(SVC_DISABLED | SVC_RC_DISABLED);
if (svc->flags & SVC_DISABLED_START) {
service_start(svc, NULL);
}
} else {
return -1;
}
return 0;
}
开发者ID:BlueLeen,项目名称:platform_system_core,代码行数:14,代码来源:builtins.c
示例13: restart_service_if_needed
static void restart_service_if_needed(struct service *svc)
{
time_t next_start_time = svc->time_started + 5;
if (next_start_time <= gettime()) {
svc->flags &= (~SVC_RESTARTING);
service_start(svc, NULL);
return;
}
if ((next_start_time < process_needs_restart) ||
(process_needs_restart == 0)) {
process_needs_restart = next_start_time;
}
}
开发者ID:qubir,项目名称:PhoenixA20_android_system_sourcecode,代码行数:15,代码来源:init.c
示例14: service_start
void Service_Unix::service_thread_main(std::vector<std::string> args)
{
service_start(args);
while (true)
{
std::unique_lock<std::mutex> lock(mutex);
event_condition.wait(lock, [&]() { return stop_flag || reload_flag; });
if (stop_flag)
break;
reload_flag = false;
service_reload();
}
service_stop();
}
开发者ID:rombust,项目名称:UICore,代码行数:16,代码来源:service_unix.cpp
示例15: wsvc_command_option
void
wsvc_command_option(const char* wopt, const char* cfgfile, int v, int c)
{
if(strcmp(wopt, "install") == 0)
wsvc_install(stdout, NULL);
else if(strcmp(wopt, "remove") == 0)
wsvc_remove(stdout);
else if(strcmp(wopt, "service") == 0)
service_start(cfgfile, v, c);
else if(strcmp(wopt, "start") == 0)
wsvc_rc_start(stdout);
else if(strcmp(wopt, "stop") == 0)
wsvc_rc_stop(stdout);
else fatal_exit("unknown option: %s", wopt);
exit(0);
}
开发者ID:stasic,项目名称:debian-unbound,代码行数:16,代码来源:win_svc.c
示例16: service_bootstrap
/**
* service_bootstrap - Start bootstrap services and tasks
*
* System startup, runlevel S, where only services, tasks and
* run commands absolutely essential to bootstrap are located.
*/
void service_bootstrap(void)
{
svc_t *svc;
_d("Bootstrapping all services in runlevel S from %s", FINIT_CONF);
for (svc = svc_iterator(1); svc; svc = svc_iterator(0)) {
svc_cmd_t cmd;
/* Inetd services cannot be part of bootstrap currently. */
if (svc_is_inetd(svc))
continue;
cmd = service_enabled(svc, 0, NULL);
if (SVC_START == cmd || (SVC_RELOAD == cmd))
service_start(svc);
}
}
开发者ID:rrogers96,项目名称:finit,代码行数:23,代码来源:service.c
示例17: restart_lost_procs
static void restart_lost_procs(void)
{
svc_t *svc;
for (svc = svc_iterator(1); svc; svc = svc_iterator(0)) {
if (svc->pid > 0 && pid_alive(svc->pid))
continue;
/* Only restart lost daemons, not task/run/inetd services */
if (SVC_TYPE_SERVICE != svc->type) {
svc->pid = 0;
continue;
}
service_start(svc);
}
}
开发者ID:rrogers96,项目名称:finit,代码行数:17,代码来源:service.c
示例18: SetConsoleCtrlHandler
int Service_Win32::run_debug(std::vector<std::string> args)
{
debug_mode = true;
SetConsoleCtrlHandler(&Service_Win32::control_handler, TRUE);
service_start(args);
while (true)
{
std::unique_lock<std::mutex> lock(mutex);
event_condition.wait(lock, [&]() { return stop_flag || reload_flag; });
if (stop_flag)
break;
reload_flag = false;
service_reload();
}
service_stop();
return 0;
}
开发者ID:ARMCoderCHS,项目名称:ClanLib,代码行数:20,代码来源:service_win32.cpp
示例19: service_main
void WINAPI
service_main (int argc, char **argv)
{
/* Register our service control handler: */
service_status_handle
= RegisterServiceCtrlHandler (service_name, service_control);
if (!service_status_handle)
return;
service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
service_status.dwServiceSpecificExitCode = 0;
/* report the status to the service control manager. */
if (report_status (
SERVICE_START_PENDING, /* Service state */
NO_ERROR, /* Exit code */
3000)) /* Wait Hint */
service_start (argc, argv);
/* Try to report the stopped status to the service control manager. */
if (service_status_handle)
report_status (SERVICE_STOPPED, error_code, 0);
}
开发者ID:cookrn,项目名称:openamq,代码行数:23,代码来源:smtserv.c
示例20: main
int
main(int argc, char *argv[])
{
const struct ovsdb_client_command *command;
char *database;
struct jsonrpc *rpc;
ovs_cmdl_proctitle_init(argc, argv);
set_program_name(argv[0]);
service_start(&argc, &argv);
parse_options(argc, argv);
fatal_ignore_sigpipe();
daemon_become_new_user(false);
if (optind >= argc) {
ovs_fatal(0, "missing command name; use --help for help");
}
for (command = get_all_commands(); ; command++) {
if (!command->name) {
VLOG_FATAL("unknown command '%s'; use --help for help",
argv[optind]);
} else if (!strcmp(command->name, argv[optind])) {
break;
}
}
optind++;
if (command->need != NEED_NONE) {
if (argc - optind > command->min_args
&& (isalpha((unsigned char) argv[optind][0])
&& strchr(argv[optind], ':'))) {
rpc = open_jsonrpc(argv[optind++]);
} else {
char *sock = xasprintf("unix:%s/db.sock", ovs_rundir());
rpc = open_jsonrpc(sock);
free(sock);
}
} else {
rpc = NULL;
}
if (command->need == NEED_DATABASE) {
struct svec dbs;
svec_init(&dbs);
fetch_dbs(rpc, &dbs);
if (argc - optind > command->min_args
&& svec_contains(&dbs, argv[optind])) {
database = xstrdup(argv[optind++]);
} else if (dbs.n == 1) {
database = xstrdup(dbs.names[0]);
} else if (svec_contains(&dbs, "Open_vSwitch")) {
database = xstrdup("Open_vSwitch");
} else {
jsonrpc_close(rpc);
ovs_fatal(0, "no default database for `%s' command, please "
"specify a database name", command->name);
}
svec_destroy(&dbs);
} else {
database = NULL;
}
if (argc - optind < command->min_args ||
argc - optind > command->max_args) {
free(database);
VLOG_FATAL("invalid syntax for '%s' (use --help for help)",
command->name);
}
command->handler(rpc, database, argc - optind, argv + optind);
free(database);
jsonrpc_close(rpc);
if (ferror(stdout)) {
VLOG_FATAL("write to stdout failed");
}
if (ferror(stderr)) {
VLOG_FATAL("write to stderr failed");
}
return 0;
}
开发者ID:exuuwen,项目名称:study,代码行数:85,代码来源:ovsdb-client.c
注:本文中的service_start函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论