summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_main.c
blob: ea2061d6c9df37209cec331bba1b3b263a295f22 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) NGINX, Inc.
 */

#include <nxt_main.h>
#include <nxt_cycle.h>


extern char  **environ;


int nxt_cdecl
main(int argc, char **argv)
{
    nxt_int_t     ret;
    nxt_thread_t  *thr;

    static nxt_str_t   nxt_config_name = nxt_string_zero("nginx.conf");

    if (nxt_lib_start("nginman", argv, &environ) != NXT_OK) {
        return 1;
    }

//    nxt_main_log.level = NXT_LOG_INFO;

    thr = nxt_thread();
    nxt_thread_time_update(thr);

    nxt_main_log.handler = nxt_log_time_handler;

    nxt_log_error(NXT_LOG_INFO, thr->log, "nginman started");

    ret = nxt_cycle_create(thr, NULL, NULL, &nxt_config_name, 0);

    if (ret != NXT_OK) {
        return 1;
    }

    nxt_event_engine_start(thr->engine);

    nxt_unreachable();
    return 0;
}