Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
metadata-collect-agent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
metadata-collect-agent
Commits
3d4df09b
Commit
3d4df09b
authored
Feb 08, 2022
by
Ophélie Gagnard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src/main.*: Improve arguments handling.
parent
87d20032
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
230 additions
and
122 deletions
+230
-122
src/main.cpp
src/main.cpp
+220
-119
src/main.pyx
src/main.pyx
+10
-3
No files found.
src/main.cpp
View file @
3d4df09b
...
...
@@ -6234,8 +6234,8 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
* #cdef char ip_address[100]
* #cdef FILE *address_path = fopen("/sys/class/net/ens3/address", "r")
* if child_pid == 0: # CHILD # <<<<<<<<<<<<<<
*
err = execlp(fb_exec_path, program_name, <char*>"-e", fb_lib_path, <char*>"-c", fb_conf_path, 0
)
* fprintf(std
err, "ERROR with execlp() in CHILD: %d\n", err
)
*
fprintf(stdout, "path_to_scan: %s\n", path_to_scan
)
* fprintf(std
out, "fb_exec_path: %s\n", fb_exec_path
)
*/
__pyx_t_1
=
((
__pyx_v_child_pid
==
0
)
!=
0
);
if
(
__pyx_t_1
)
{
...
...
@@ -6243,14 +6243,59 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
/* "main.pyx":284
* #cdef FILE *address_path = fopen("/sys/class/net/ens3/address", "r")
* if child_pid == 0: # CHILD
* fprintf(stdout, "path_to_scan: %s\n", path_to_scan) # <<<<<<<<<<<<<<
* fprintf(stdout, "fb_exec_path: %s\n", fb_exec_path)
* fprintf(stdout, "fb_lib_path: %s\n", fb_lib_path)
*/
(
void
)(
fprintf
(
stdout
,
((
char
const
*
)
"path_to_scan: %s
\n
"
),
__pyx_v_path_to_scan
));
/* "main.pyx":285
* if child_pid == 0: # CHILD
* fprintf(stdout, "path_to_scan: %s\n", path_to_scan)
* fprintf(stdout, "fb_exec_path: %s\n", fb_exec_path) # <<<<<<<<<<<<<<
* fprintf(stdout, "fb_lib_path: %s\n", fb_lib_path)
* fprintf(stdout, "fb_conf_path: %s\n", fb_conf_path)
*/
(
void
)(
fprintf
(
stdout
,
((
char
const
*
)
"fb_exec_path: %s
\n
"
),
__pyx_v_fb_exec_path
));
/* "main.pyx":286
* fprintf(stdout, "path_to_scan: %s\n", path_to_scan)
* fprintf(stdout, "fb_exec_path: %s\n", fb_exec_path)
* fprintf(stdout, "fb_lib_path: %s\n", fb_lib_path) # <<<<<<<<<<<<<<
* fprintf(stdout, "fb_conf_path: %s\n", fb_conf_path)
* fprintf(stdout, "log_path: %s\n", log_path)
*/
(
void
)(
fprintf
(
stdout
,
((
char
const
*
)
"fb_lib_path: %s
\n
"
),
__pyx_v_fb_lib_path
));
/* "main.pyx":287
* fprintf(stdout, "fb_exec_path: %s\n", fb_exec_path)
* fprintf(stdout, "fb_lib_path: %s\n", fb_lib_path)
* fprintf(stdout, "fb_conf_path: %s\n", fb_conf_path) # <<<<<<<<<<<<<<
* fprintf(stdout, "log_path: %s\n", log_path)
* err = execlp(fb_exec_path, program_name, <char*>"-e", fb_lib_path, <char*>"-c", fb_conf_path, 0)
*/
(
void
)(
fprintf
(
stdout
,
((
char
const
*
)
"fb_conf_path: %s
\n
"
),
__pyx_v_fb_conf_path
));
/* "main.pyx":288
* fprintf(stdout, "fb_lib_path: %s\n", fb_lib_path)
* fprintf(stdout, "fb_conf_path: %s\n", fb_conf_path)
* fprintf(stdout, "log_path: %s\n", log_path) # <<<<<<<<<<<<<<
* err = execlp(fb_exec_path, program_name, <char*>"-e", fb_lib_path, <char*>"-c", fb_conf_path, 0)
* fprintf(stderr, "ERROR with execlp() in CHILD: %d\n", err)
*/
(
void
)(
fprintf
(
stdout
,
((
char
const
*
)
"log_path: %s
\n
"
),
__pyx_v_log_path
));
/* "main.pyx":289
* fprintf(stdout, "fb_conf_path: %s\n", fb_conf_path)
* fprintf(stdout, "log_path: %s\n", log_path)
* err = execlp(fb_exec_path, program_name, <char*>"-e", fb_lib_path, <char*>"-c", fb_conf_path, 0) # <<<<<<<<<<<<<<
* fprintf(stderr, "ERROR with execlp() in CHILD: %d\n", err)
* else: # PARENT
*/
__pyx_v_err
=
execlp
(
__pyx_v_fb_exec_path
,
__pyx_v_program_name
,
((
char
*
)((
char
*
)
"-e"
)),
__pyx_v_fb_lib_path
,
((
char
*
)((
char
*
)
"-c"
)),
__pyx_v_fb_conf_path
,
0
);
/* "main.pyx":2
85
*
if child_pid == 0: # CHILD
/* "main.pyx":2
90
*
fprintf(stdout, "log_path: %s\n", log_path)
* err = execlp(fb_exec_path, program_name, <char*>"-e", fb_lib_path, <char*>"-c", fb_conf_path, 0)
* fprintf(stderr, "ERROR with execlp() in CHILD: %d\n", err) # <<<<<<<<<<<<<<
* else: # PARENT
...
...
@@ -6262,13 +6307,13 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
* #cdef char ip_address[100]
* #cdef FILE *address_path = fopen("/sys/class/net/ens3/address", "r")
* if child_pid == 0: # CHILD # <<<<<<<<<<<<<<
*
err = execlp(fb_exec_path, program_name, <char*>"-e", fb_lib_path, <char*>"-c", fb_conf_path, 0
)
* fprintf(std
err, "ERROR with execlp() in CHILD: %d\n", err
)
*
fprintf(stdout, "path_to_scan: %s\n", path_to_scan
)
* fprintf(std
out, "fb_exec_path: %s\n", fb_exec_path
)
*/
goto
__pyx_L3
;
}
/* "main.pyx":2
87
/* "main.pyx":2
92
* fprintf(stderr, "ERROR with execlp() in CHILD: %d\n", err)
* else: # PARENT
* printf("WELCOME TO PARENT\n\n") # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6278,7 +6323,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
/*else*/
{
(
void
)(
printf
(((
char
const
*
)
"WELCOME TO PARENT
\n\n
"
)));
/* "main.pyx":2
89
/* "main.pyx":2
94
* printf("WELCOME TO PARENT\n\n") # DEBUG
*
* sleep(2) # TODO error handling ; check if a wait can be made to wait for the child to perform execlp() (instead of the sleep) # <<<<<<<<<<<<<<
...
...
@@ -6287,7 +6332,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
sleep
(
2
));
/* "main.pyx":29
2
/* "main.pyx":29
7
*
* global scheduler
* scheduler = Scheduler() # <<<<<<<<<<<<<<
...
...
@@ -6300,7 +6345,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_v_4main_scheduler
=
__pyx_t_2
;
__pyx_t_2
=
0
;
/* "main.pyx":29
4
/* "main.pyx":29
9
* scheduler = Scheduler()
*
* ignore_paths = cyplist[string]() # <<<<<<<<<<<<<<
...
...
@@ -6313,7 +6358,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_v_ignore_paths
=
__pyx_t_3
;
__pyx_t_3
=
0
;
/* "main.pyx":
295
/* "main.pyx":
300
*
* ignore_paths = cyplist[string]()
* ignore_paths.append(b'/opt/slapgrid') # <<<<<<<<<<<<<<
...
...
@@ -6321,9 +6366,9 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*
*/
Cy_GOTREF
(
__pyx_v_ignore_paths
);
__pyx_t_4
=
__pyx_v_ignore_paths
->
append
(
__pyx_k_opt_slapgrid
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
295
,
__pyx_L1_error
)
__pyx_t_4
=
__pyx_v_ignore_paths
->
append
(
__pyx_k_opt_slapgrid
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
300
,
__pyx_L1_error
)
/* "main.pyx":
296
/* "main.pyx":
301
* ignore_paths = cyplist[string]()
* ignore_paths.append(b'/opt/slapgrid')
* ignore_paths.append(b'/srv/slapgrid') # <<<<<<<<<<<<<<
...
...
@@ -6331,9 +6376,9 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
* dev_whitelist_paths = cyplist[string]()
*/
Cy_GOTREF
(
__pyx_v_ignore_paths
);
__pyx_t_4
=
__pyx_v_ignore_paths
->
append
(
__pyx_k_srv_slapgrid
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
296
,
__pyx_L1_error
)
__pyx_t_4
=
__pyx_v_ignore_paths
->
append
(
__pyx_k_srv_slapgrid
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
301
,
__pyx_L1_error
)
/* "main.pyx":
298
/* "main.pyx":
303
* ignore_paths.append(b'/srv/slapgrid')
*
* dev_whitelist_paths = cyplist[string]() # <<<<<<<<<<<<<<
...
...
@@ -6346,7 +6391,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_v_dev_whitelist_paths
=
__pyx_t_3
;
__pyx_t_3
=
0
;
/* "main.pyx":
299
/* "main.pyx":
304
*
* dev_whitelist_paths = cyplist[string]()
* dev_whitelist_paths.append(b'.') # <<<<<<<<<<<<<<
...
...
@@ -6354,9 +6399,9 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
* dev_whitelist_paths.append(b'/boot/efi')
*/
Cy_GOTREF
(
__pyx_v_dev_whitelist_paths
);
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_k_
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
299
,
__pyx_L1_error
)
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_k_
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
304
,
__pyx_L1_error
)
/* "main.pyx":30
0
/* "main.pyx":30
5
* dev_whitelist_paths = cyplist[string]()
* dev_whitelist_paths.append(b'.')
* dev_whitelist_paths.append(b'/') # <<<<<<<<<<<<<<
...
...
@@ -6364,9 +6409,9 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
* dev_whitelist_paths.append(b'/root')
*/
Cy_GOTREF
(
__pyx_v_dev_whitelist_paths
);
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_k__2
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
30
0
,
__pyx_L1_error
)
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_k__2
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
30
5
,
__pyx_L1_error
)
/* "main.pyx":30
1
/* "main.pyx":30
6
* dev_whitelist_paths.append(b'.')
* dev_whitelist_paths.append(b'/')
* dev_whitelist_paths.append(b'/boot/efi') # <<<<<<<<<<<<<<
...
...
@@ -6374,9 +6419,9 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
* dev_whitelist_paths.append(b'/sysroot')
*/
Cy_GOTREF
(
__pyx_v_dev_whitelist_paths
);
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_k_boot_efi
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
30
1
,
__pyx_L1_error
)
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_k_boot_efi
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
30
6
,
__pyx_L1_error
)
/* "main.pyx":30
2
/* "main.pyx":30
7
* dev_whitelist_paths.append(b'/')
* dev_whitelist_paths.append(b'/boot/efi')
* dev_whitelist_paths.append(b'/root') # <<<<<<<<<<<<<<
...
...
@@ -6384,9 +6429,9 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
* dev_whitelist_paths.append(path_to_scan)
*/
Cy_GOTREF
(
__pyx_v_dev_whitelist_paths
);
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_k_root
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
30
2
,
__pyx_L1_error
)
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_k_root
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
30
7
,
__pyx_L1_error
)
/* "main.pyx":30
3
/* "main.pyx":30
8
* dev_whitelist_paths.append(b'/boot/efi')
* dev_whitelist_paths.append(b'/root')
* dev_whitelist_paths.append(b'/sysroot') # <<<<<<<<<<<<<<
...
...
@@ -6394,9 +6439,9 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*
*/
Cy_GOTREF
(
__pyx_v_dev_whitelist_paths
);
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_k_sysroot
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
30
3
,
__pyx_L1_error
)
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_k_sysroot
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
30
8
,
__pyx_L1_error
)
/* "main.pyx":30
4
/* "main.pyx":30
9
* dev_whitelist_paths.append(b'/root')
* dev_whitelist_paths.append(b'/sysroot')
* dev_whitelist_paths.append(path_to_scan) # <<<<<<<<<<<<<<
...
...
@@ -6404,9 +6449,9 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
* dev_whitelist = cyplist[dev_t]()
*/
Cy_GOTREF
(
__pyx_v_dev_whitelist_paths
);
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_v_path_to_scan
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
30
4
,
__pyx_L1_error
)
__pyx_t_4
=
__pyx_v_dev_whitelist_paths
->
append
(
__pyx_v_path_to_scan
);
if
(
unlikely
(
__pyx_t_4
.
is_error
()))
__PYX_ERR
(
0
,
30
9
,
__pyx_L1_error
)
/* "main.pyx":3
06
/* "main.pyx":3
11
* dev_whitelist_paths.append(path_to_scan)
*
* dev_whitelist = cyplist[dev_t]() # <<<<<<<<<<<<<<
...
...
@@ -6419,7 +6464,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_v_dev_whitelist
=
__pyx_t_5
;
__pyx_t_5
=
0
;
/* "main.pyx":3
07
/* "main.pyx":3
12
*
* dev_whitelist = cyplist[dev_t]()
* for p in dev_whitelist_paths: # <<<<<<<<<<<<<<
...
...
@@ -6434,7 +6479,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
++
__pyx_t_6
;
__pyx_v_p
=
__PYX_STD_MOVE_IF_SUPPORTED
(
__pyx_t_7
);
/* "main.pyx":3
08
/* "main.pyx":3
13
* dev_whitelist = cyplist[dev_t]()
* for p in dev_whitelist_paths:
* p_stat = Stat(p) # <<<<<<<<<<<<<<
...
...
@@ -6447,7 +6492,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_v_p_stat
=
__pyx_t_8
;
__pyx_t_8
=
0
;
/* "main.pyx":3
09
/* "main.pyx":3
14
* for p in dev_whitelist_paths:
* p_stat = Stat(p)
* if p_stat is not NULL: # <<<<<<<<<<<<<<
...
...
@@ -6458,7 +6503,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_t_1
=
((
__pyx_v_p_stat
!=
NULL
)
!=
0
);
if
(
__pyx_t_1
)
{
/* "main.pyx":31
0
/* "main.pyx":31
5
* p_stat = Stat(p)
* if p_stat is not NULL:
* p_dev = p_stat.st_data.st_dev # <<<<<<<<<<<<<<
...
...
@@ -6469,7 +6514,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_t_9
=
__pyx_v_p_stat
->
st_data
.
st_dev
;
__pyx_v_p_dev
=
__pyx_t_9
;
/* "main.pyx":31
1
/* "main.pyx":31
6
* if p_stat is not NULL:
* p_dev = p_stat.st_data.st_dev
* dev_whitelist.append(p_dev) # <<<<<<<<<<<<<<
...
...
@@ -6477,9 +6522,9 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
* realpath(path_to_scan, resolved_scan_path)
*/
Cy_GOTREF
(
__pyx_v_dev_whitelist
);
__pyx_t_10
=
__pyx_v_dev_whitelist
->
append
(
__pyx_v_p_dev
);
if
(
unlikely
(
__pyx_t_10
.
is_error
()))
__PYX_ERR
(
0
,
31
1
,
__pyx_L1_error
)
__pyx_t_10
=
__pyx_v_dev_whitelist
->
append
(
__pyx_v_p_dev
);
if
(
unlikely
(
__pyx_t_10
.
is_error
()))
__PYX_ERR
(
0
,
31
6
,
__pyx_L1_error
)
/* "main.pyx":3
09
/* "main.pyx":3
14
* for p in dev_whitelist_paths:
* p_stat = Stat(p)
* if p_stat is not NULL: # <<<<<<<<<<<<<<
...
...
@@ -6488,7 +6533,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
}
/* "main.pyx":3
07
/* "main.pyx":3
12
*
* dev_whitelist = cyplist[dev_t]()
* for p in dev_whitelist_paths: # <<<<<<<<<<<<<<
...
...
@@ -6498,7 +6543,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
}
__pyx_t_6
=
__pyx_v_dev_whitelist_paths
->
end
();
/* "main.pyx":31
3
/* "main.pyx":31
8
* dev_whitelist.append(p_dev)
*
* realpath(path_to_scan, resolved_scan_path) # <<<<<<<<<<<<<<
...
...
@@ -6507,7 +6552,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
realpath
(
__pyx_v_path_to_scan
,
__pyx_v_resolved_scan_path
));
/* "main.pyx":31
4
/* "main.pyx":31
9
*
* realpath(path_to_scan, resolved_scan_path)
* fprintf(stderr, resolved_scan_path) # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6516,7 +6561,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
stderr
,
__pyx_v_resolved_scan_path
));
/* "main.pyx":3
15
/* "main.pyx":3
20
* realpath(path_to_scan, resolved_scan_path)
* fprintf(stderr, resolved_scan_path) # DEBUG
* fprintf(stderr, "\n") # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6525,7 +6570,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
stderr
,
((
char
const
*
)
"
\n
"
)));
/* "main.pyx":3
16
/* "main.pyx":3
21
* fprintf(stderr, resolved_scan_path) # DEBUG
* fprintf(stderr, "\n") # DEBUG
* fflush(stderr) # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6534,7 +6579,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fflush
(
stderr
));
/* "main.pyx":3
17
/* "main.pyx":3
22
* fprintf(stderr, "\n") # DEBUG
* fflush(stderr) # DEBUG
* node = make_node(resolved_scan_path, resolved_scan_path) # <<<<<<<<<<<<<<
...
...
@@ -6547,7 +6592,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_v_node
=
__pyx_t_11
;
__pyx_t_11
=
0
;
/* "main.pyx":3
18
/* "main.pyx":3
23
* fflush(stderr) # DEBUG
* node = make_node(resolved_scan_path, resolved_scan_path)
* if node is NULL: # <<<<<<<<<<<<<<
...
...
@@ -6558,7 +6603,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_t_1
=
((
__pyx_v_node
==
NULL
)
!=
0
);
if
(
__pyx_t_1
)
{
/* "main.pyx":3
19
/* "main.pyx":3
24
* node = make_node(resolved_scan_path, resolved_scan_path)
* if node is NULL:
* return -1 # <<<<<<<<<<<<<<
...
...
@@ -6568,7 +6613,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_r
=
-
1
;
goto
__pyx_L0
;
/* "main.pyx":3
18
/* "main.pyx":3
23
* fflush(stderr) # DEBUG
* node = make_node(resolved_scan_path, resolved_scan_path)
* if node is NULL: # <<<<<<<<<<<<<<
...
...
@@ -6577,7 +6622,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
}
/* "main.pyx":32
1
/* "main.pyx":32
6
* return -1
*
* active_node = activate(consume node) # <<<<<<<<<<<<<<
...
...
@@ -6594,7 +6639,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_v_active_node
=
__pyx_t_12
;
__pyx_t_12
=
0
;
/* "main.pyx":32
2
/* "main.pyx":32
7
*
* active_node = activate(consume node)
* active_node.build_node(NULL, consume dev_whitelist, consume ignore_paths) # <<<<<<<<<<<<<<
...
...
@@ -6612,7 +6657,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
#ifdef WITH_THREAD
PyGILState_Release
(
_save
);
#endif
__PYX_ERR
(
0
,
32
2
,
__pyx_L1_error
)
__PYX_ERR
(
0
,
32
7
,
__pyx_L1_error
)
}
__pyx_v_dev_whitelist
=
NULL
;
Cy_GOTREF
(
__pyx_v_ignore_paths
);
...
...
@@ -6625,7 +6670,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
#ifdef WITH_THREAD
PyGILState_Release
(
_save
);
#endif
__PYX_ERR
(
0
,
32
2
,
__pyx_L1_error
)
__PYX_ERR
(
0
,
32
7
,
__pyx_L1_error
)
}
__pyx_v_ignore_paths
=
NULL
;
__pyx_t_15
=
__pyx_v_active_node
->
__pyx_f_active_build_node
(
NULL
,
__pyx_t_13
,
__pyx_t_14
);
...
...
@@ -6634,7 +6679,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_t_14
=
0
;
Cy_XDECREF
(
__pyx_t_15
);
__pyx_t_15
=
NULL
;
/* "main.pyx":32
3
/* "main.pyx":32
8
* active_node = activate(consume node)
* active_node.build_node(NULL, consume dev_whitelist, consume ignore_paths)
* scheduler.finish() # <<<<<<<<<<<<<<
...
...
@@ -6644,7 +6689,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
Cy_GOTREF
(
__pyx_v_4main_scheduler
);
__pyx_v_4main_scheduler
->
finish
();
/* "main.pyx":32
4
/* "main.pyx":32
9
* active_node.build_node(NULL, consume dev_whitelist, consume ignore_paths)
* scheduler.finish()
* node = consume active_node # <<<<<<<<<<<<<<
...
...
@@ -6661,14 +6706,14 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
#ifdef WITH_THREAD
PyGILState_Release
(
_save
);
#endif
__PYX_ERR
(
0
,
32
4
,
__pyx_L1_error
)
__PYX_ERR
(
0
,
32
9
,
__pyx_L1_error
)
}
__pyx_v_active_node
=
NULL
;
Cy_XDECREF
(
__pyx_v_node
);
__pyx_v_node
=
__pyx_t_11
;
__pyx_t_11
=
0
;
/* "main.pyx":3
27
/* "main.pyx":3
32
*
* #""" # DEBUG
* realpath(log_path, resolved_log_path) # <<<<<<<<<<<<<<
...
...
@@ -6677,7 +6722,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
realpath
(
__pyx_v_log_path
,
__pyx_v_resolved_log_path
));
/* "main.pyx":3
28
/* "main.pyx":3
33
* #""" # DEBUG
* realpath(log_path, resolved_log_path)
* fprintf(stderr, resolved_log_path) # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6686,7 +6731,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
stderr
,
__pyx_v_resolved_log_path
));
/* "main.pyx":3
29
/* "main.pyx":3
34
* realpath(log_path, resolved_log_path)
* fprintf(stderr, resolved_log_path) # DEBUG
* fprintf(stderr, "\n") # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6695,7 +6740,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
stderr
,
((
char
const
*
)
"
\n
"
)));
/* "main.pyx":33
0
/* "main.pyx":33
5
* fprintf(stderr, resolved_log_path) # DEBUG
* fprintf(stderr, "\n") # DEBUG
* fflush(stderr) # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6704,7 +6749,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fflush
(
stderr
));
/* "main.pyx":33
1
/* "main.pyx":33
6
* fprintf(stderr, "\n") # DEBUG
* fflush(stderr) # DEBUG
* result = fopen(resolved_log_path, 'w') # <<<<<<<<<<<<<<
...
...
@@ -6713,7 +6758,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
__pyx_v_result
=
fopen
(
__pyx_v_resolved_log_path
,
((
char
const
*
)
"w"
));
/* "main.pyx":33
2
/* "main.pyx":33
7
* fflush(stderr) # DEBUG
* result = fopen(resolved_log_path, 'w')
* if result is NULL: # <<<<<<<<<<<<<<
...
...
@@ -6723,7 +6768,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_t_1
=
((
__pyx_v_result
==
NULL
)
!=
0
);
if
(
__pyx_t_1
)
{
/* "main.pyx":33
3
/* "main.pyx":33
8
* result = fopen(resolved_log_path, 'w')
* if result is NULL:
* fprintf(stderr, 'Error creating the log file.\n') # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6732,7 +6777,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
stderr
,
((
char
const
*
)
"Error creating the log file.
\n
"
)));
/* "main.pyx":33
4
/* "main.pyx":33
9
* if result is NULL:
* fprintf(stderr, 'Error creating the log file.\n') # DEBUG
* fflush(stderr) # <<<<<<<<<<<<<<
...
...
@@ -6741,7 +6786,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fflush
(
stderr
));
/* "main.pyx":3
35
/* "main.pyx":3
40
* fprintf(stderr, 'Error creating the log file.\n') # DEBUG
* fflush(stderr)
* return -1 # <<<<<<<<<<<<<<
...
...
@@ -6751,7 +6796,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
__pyx_r
=
-
1
;
goto
__pyx_L0
;
/* "main.pyx":33
2
/* "main.pyx":33
7
* fflush(stderr) # DEBUG
* result = fopen(resolved_log_path, 'w')
* if result is NULL: # <<<<<<<<<<<<<<
...
...
@@ -6760,7 +6805,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
}
/* "main.pyx":3
37
/* "main.pyx":3
42
* return -1
*
* fprintf(stderr, 'Log opened successfully.\n') # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6769,7 +6814,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
stderr
,
((
char
const
*
)
"Log opened successfully.
\n
"
)));
/* "main.pyx":3
39
/* "main.pyx":3
44
* fprintf(stderr, 'Log opened successfully.\n') # DEBUG
*
* fprintf(stderr, "WRITE_NOTE STAGE\n\n") # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6778,7 +6823,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
stderr
,
((
char
const
*
)
"WRITE_NOTE STAGE
\n\n
"
)));
/* "main.pyx":34
4
/* "main.pyx":34
9
* #fclose(address_path)
* #fprintf(result, '{"mac_address": "%s"}\n', ip_address)
* node.write_node(result) # <<<<<<<<<<<<<<
...
...
@@ -6788,7 +6833,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
Cy_GOTREF
(
__pyx_v_node
);
__pyx_v_node
->
write_node
(
__pyx_v_result
);
/* "main.pyx":3
45
/* "main.pyx":3
50
* #fprintf(result, '{"mac_address": "%s"}\n', ip_address)
* node.write_node(result)
* fprintf(result, '{}\n') # <<<<<<<<<<<<<<
...
...
@@ -6797,7 +6842,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
__pyx_v_result
,
((
char
const
*
)
"{}
\n
"
)));
/* "main.pyx":3
46
/* "main.pyx":3
51
* node.write_node(result)
* fprintf(result, '{}\n')
* fprintf(result, 'fluentbit_end\n') # <<<<<<<<<<<<<<
...
...
@@ -6806,7 +6851,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
__pyx_v_result
,
((
char
const
*
)
"fluentbit_end
\n
"
)));
/* "main.pyx":3
48
/* "main.pyx":3
53
* fprintf(result, 'fluentbit_end\n')
*
* fclose(result) # <<<<<<<<<<<<<<
...
...
@@ -6815,7 +6860,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fclose
(
__pyx_v_result
));
/* "main.pyx":35
0
/* "main.pyx":35
5
* fclose(result)
* #""" # DEBUG
* del scheduler # <<<<<<<<<<<<<<
...
...
@@ -6825,7 +6870,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
Cy_GOTREF
(
__pyx_v_4main_scheduler
);
Cy_XDECREF
(
__pyx_v_4main_scheduler
);
__pyx_v_4main_scheduler
=
NULL
;
/* "main.pyx":35
2
/* "main.pyx":35
7
* del scheduler
*
* fprintf(stderr, "WAITING for fluent-bit to end\n\n") # <<<<<<<<<<<<<<
...
...
@@ -6834,7 +6879,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
stderr
,
((
char
const
*
)
"WAITING for fluent-bit to end
\n\n
"
)));
/* "main.pyx":35
3
/* "main.pyx":35
8
*
* fprintf(stderr, "WAITING for fluent-bit to end\n\n")
* wait_error = wait(NULL) # TODO improve this call (error handling, etc.) # <<<<<<<<<<<<<<
...
...
@@ -6843,7 +6888,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
__pyx_v_wait_error
=
wait
(
NULL
);
/* "main.pyx":3
55
/* "main.pyx":3
60
* wait_error = wait(NULL) # TODO improve this call (error handling, etc.)
* #wait_error = waitpid(child_pid, NULL, 1) # TODO improve this call (error handling, etc.)
* fprintf(stderr, "WAITING ENDS\n\n") # <<<<<<<<<<<<<<
...
...
@@ -6852,7 +6897,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fprintf
(
stderr
,
((
char
const
*
)
"WAITING ENDS
\n\n
"
)));
/* "main.pyx":3
56
/* "main.pyx":3
61
* #wait_error = waitpid(child_pid, NULL, 1) # TODO improve this call (error handling, etc.)
* fprintf(stderr, "WAITING ENDS\n\n")
* fflush(stderr) # DEBUG # <<<<<<<<<<<<<<
...
...
@@ -6861,7 +6906,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
*/
(
void
)(
fflush
(
stderr
));
/* "main.pyx":3
58
/* "main.pyx":3
63
* fflush(stderr) # DEBUG
*
* return 0 # <<<<<<<<<<<<<<
...
...
@@ -6903,7 +6948,7 @@ static int __pyx_f_4main_start(char const *__pyx_v_path_to_scan, char const *__p
return
__pyx_r
;
}
/* "main.pyx":36
0
/* "main.pyx":36
5
* return 0
*
* cdef public int main(int argc, char* argv[]) nogil: # <<<<<<<<<<<<<<
...
...
@@ -6918,8 +6963,9 @@ int main(int __pyx_v_argc, char **__pyx_v_argv) {
char
*
__pyx_v_fb_conf_path
;
char
*
__pyx_v_log_path
;
int
__pyx_r
;
int
__pyx_t_1
;
/* "main.pyx":36
1
/* "main.pyx":36
6
*
* cdef public int main(int argc, char* argv[]) nogil:
* cdef char* path_to_scan = "/" # <<<<<<<<<<<<<<
...
...
@@ -6928,7 +6974,7 @@ int main(int __pyx_v_argc, char **__pyx_v_argv) {
*/
__pyx_v_path_to_scan
=
((
char
*
)
"/"
);
/* "main.pyx":36
2
/* "main.pyx":36
7
* cdef public int main(int argc, char* argv[]) nogil:
* cdef char* path_to_scan = "/"
* cdef char* fb_exec_path = "/sbin/fluent-bit" # <<<<<<<<<<<<<<
...
...
@@ -6937,7 +6983,7 @@ int main(int __pyx_v_argc, char **__pyx_v_argv) {
*/
__pyx_v_fb_exec_path
=
((
char
*
)
"/sbin/fluent-bit"
);
/* "main.pyx":36
3
/* "main.pyx":36
8
* cdef char* path_to_scan = "/"
* cdef char* fb_exec_path = "/sbin/fluent-bit"
* cdef char* fb_lib_path = "/etc/fluentbit_wendelin.so" # <<<<<<<<<<<<<<
...
...
@@ -6946,111 +6992,166 @@ int main(int __pyx_v_argc, char **__pyx_v_argv) {
*/
__pyx_v_fb_lib_path
=
((
char
*
)
"/etc/fluentbit_wendelin.so"
);
/* "main.pyx":36
4
/* "main.pyx":36
9
* cdef char* fb_exec_path = "/sbin/fluent-bit"
* cdef char* fb_lib_path = "/etc/fluentbit_wendelin.so"
* cdef char* fb_conf_path = "/etc/flb.conf" # <<<<<<<<<<<<<<
* cdef char* log_path = "/var/log/metadata_collect.log"
* if argc
=
= 2:
* if argc
>
= 2:
*/
__pyx_v_fb_conf_path
=
((
char
*
)
"/etc/flb.conf"
);
/* "main.pyx":3
65
/* "main.pyx":3
70
* cdef char* fb_lib_path = "/etc/fluentbit_wendelin.so"
* cdef char* fb_conf_path = "/etc/flb.conf"
* cdef char* log_path = "/var/log/metadata_collect.log" # <<<<<<<<<<<<<<
* if argc
=
= 2:
* if argc
>
= 2:
* path_to_scan = <char*>argv[1]
*/
__pyx_v_log_path
=
((
char
*
)
"/var/log/metadata_collect.log"
);
/* "main.pyx":3
66
/* "main.pyx":3
71
* cdef char* fb_conf_path = "/etc/flb.conf"
* cdef char* log_path = "/var/log/metadata_collect.log"
* if argc
=
= 2: # <<<<<<<<<<<<<<
* if argc
>
= 2: # <<<<<<<<<<<<<<
* path_to_scan = <char*>argv[1]
*
elif argc == 6
:
*
if argc >= 3
:
*/
switch
(
__pyx_v_argc
)
{
case
2
:
__pyx_t_1
=
((
__pyx_v_argc
>=
2
)
!=
0
);
if
(
__pyx_t_1
)
{
/* "main.pyx":3
67
/* "main.pyx":3
72
* cdef char* log_path = "/var/log/metadata_collect.log"
* if argc
=
= 2:
* if argc
>
= 2:
* path_to_scan = <char*>argv[1] # <<<<<<<<<<<<<<
*
elif argc == 6
:
*
path_to_scan = <char*>argv[1
]
*
if argc >= 3
:
*
fb_exec_path = <char*>argv[2
]
*/
__pyx_v_path_to_scan
=
((
char
*
)(
__pyx_v_argv
[
1
]));
/* "main.pyx":3
66
/* "main.pyx":3
71
* cdef char* fb_conf_path = "/etc/flb.conf"
* cdef char* log_path = "/var/log/metadata_collect.log"
* if argc
=
= 2: # <<<<<<<<<<<<<<
* if argc
>
= 2: # <<<<<<<<<<<<<<
* path_to_scan = <char*>argv[1]
*
elif argc == 6
:
*
if argc >= 3
:
*/
break
;
case
6
:
}
/* "main.pyx":369
/* "main.pyx":373
* if argc >= 2:
* path_to_scan = <char*>argv[1]
* elif argc == 6:
* path_to_scan = <char*>argv[1] # <<<<<<<<<<<<<<
* if argc >= 3: # <<<<<<<<<<<<<<
* fb_exec_path = <char*>argv[2]
*
fb_lib_path = <char*>argv[3]
*
if argc >= 4:
*/
__pyx_v_path_to_scan
=
((
char
*
)(
__pyx_v_argv
[
1
]));
__pyx_t_1
=
((
__pyx_v_argc
>=
3
)
!=
0
);
if
(
__pyx_t_1
)
{
/* "main.pyx":370
* elif argc == 6:
/* "main.pyx":374
* path_to_scan = <char*>argv[1]
* if argc >= 3:
* fb_exec_path = <char*>argv[2] # <<<<<<<<<<<<<<
* if argc >= 4:
* fb_lib_path = <char*>argv[3]
* fb_conf_path = <char*>argv[4]
*/
__pyx_v_fb_exec_path
=
((
char
*
)(
__pyx_v_argv
[
2
]));
/* "main.pyx":371
/* "main.pyx":373
* if argc >= 2:
* path_to_scan = <char*>argv[1]
* if argc >= 3: # <<<<<<<<<<<<<<
* fb_exec_path = <char*>argv[2]
* if argc >= 4:
*/
}
/* "main.pyx":375
* if argc >= 3:
* fb_exec_path = <char*>argv[2]
* if argc >= 4: # <<<<<<<<<<<<<<
* fb_lib_path = <char*>argv[3]
* if argc >= 5:
*/
__pyx_t_1
=
((
__pyx_v_argc
>=
4
)
!=
0
);
if
(
__pyx_t_1
)
{
/* "main.pyx":376
* fb_exec_path = <char*>argv[2]
* if argc >= 4:
* fb_lib_path = <char*>argv[3] # <<<<<<<<<<<<<<
* if argc >= 5:
* fb_conf_path = <char*>argv[4]
* log_path = <char*>argv[5]
*/
__pyx_v_fb_lib_path
=
((
char
*
)(
__pyx_v_argv
[
3
]));
/* "main.pyx":372
/* "main.pyx":375
* if argc >= 3:
* fb_exec_path = <char*>argv[2]
* if argc >= 4: # <<<<<<<<<<<<<<
* fb_lib_path = <char*>argv[3]
* if argc >= 5:
*/
}
/* "main.pyx":377
* if argc >= 4:
* fb_lib_path = <char*>argv[3]
* if argc >= 5: # <<<<<<<<<<<<<<
* fb_conf_path = <char*>argv[4]
* if argc >=6:
*/
__pyx_t_1
=
((
__pyx_v_argc
>=
5
)
!=
0
);
if
(
__pyx_t_1
)
{
/* "main.pyx":378
* fb_lib_path = <char*>argv[3]
* if argc >= 5:
* fb_conf_path = <char*>argv[4] # <<<<<<<<<<<<<<
* if argc >=6:
* log_path = <char*>argv[5]
* return start(<char*>path_to_scan, <char*>fb_exec_path, <char*>fb_lib_path, <char*>fb_conf_path, <char*>log_path)
*/
__pyx_v_fb_conf_path
=
((
char
*
)(
__pyx_v_argv
[
4
]));
/* "main.pyx":373
/* "main.pyx":377
* if argc >= 4:
* fb_lib_path = <char*>argv[3]
* if argc >= 5: # <<<<<<<<<<<<<<
* fb_conf_path = <char*>argv[4]
* if argc >=6:
*/
}
/* "main.pyx":379
* if argc >= 5:
* fb_conf_path = <char*>argv[4]
* if argc >=6: # <<<<<<<<<<<<<<
* log_path = <char*>argv[5]
* return start(<char*>path_to_scan, <char*>fb_exec_path, <char*>fb_lib_path, <char*>fb_conf_path, <char*>log_path)
*/
__pyx_t_1
=
((
__pyx_v_argc
>=
6
)
!=
0
);
if
(
__pyx_t_1
)
{
/* "main.pyx":380
* fb_conf_path = <char*>argv[4]
* if argc >=6:
* log_path = <char*>argv[5] # <<<<<<<<<<<<<<
* return start(<char*>path_to_scan, <char*>fb_exec_path, <char*>fb_lib_path, <char*>fb_conf_path, <char*>log_path)
*
*/
__pyx_v_log_path
=
((
char
*
)(
__pyx_v_argv
[
5
]));
/* "main.pyx":3
68
* if argc
== 2
:
*
path_to_scan = <char*>argv[1
]
*
elif argc ==
6: # <<<<<<<<<<<<<<
*
path_to_scan = <char*>argv[1
]
*
fb_exec_path = <char*>argv[2]
/* "main.pyx":3
79
* if argc
>= 5
:
*
fb_conf_path = <char*>argv[4
]
*
if argc >=
6: # <<<<<<<<<<<<<<
*
log_path = <char*>argv[5
]
*
return start(<char*>path_to_scan, <char*>fb_exec_path, <char*>fb_lib_path, <char*>fb_conf_path, <char*>log_path)
*/
break
;
default:
break
;
}
/* "main.pyx":3
74
*
fb_conf_path = <char*>argv[4]
/* "main.pyx":3
81
*
if argc >=6:
* log_path = <char*>argv[5]
* return start(<char*>path_to_scan, <char*>fb_exec_path, <char*>fb_lib_path, <char*>fb_conf_path, <char*>log_path) # <<<<<<<<<<<<<<
*
...
...
@@ -7059,7 +7160,7 @@ int main(int __pyx_v_argc, char **__pyx_v_argv) {
__pyx_r
=
__pyx_f_4main_start
(((
char
*
)
__pyx_v_path_to_scan
),
((
char
*
)
__pyx_v_fb_exec_path
),
((
char
*
)
__pyx_v_fb_lib_path
),
((
char
*
)
__pyx_v_fb_conf_path
),
((
char
*
)
__pyx_v_log_path
));
goto
__pyx_L0
;
/* "main.pyx":36
0
/* "main.pyx":36
5
* return 0
*
* cdef public int main(int argc, char* argv[]) nogil: # <<<<<<<<<<<<<<
...
...
src/main.pyx
View file @
3d4df09b
...
...
@@ -281,6 +281,11 @@ cdef int start(const char *path_to_scan, const char *fb_exec_path, const char *f
#cdef char ip_address[100]
#cdef FILE *address_path = fopen("/sys/class/net/ens3/address", "r")
if
child_pid
==
0
:
# CHILD
fprintf
(
stdout
,
"path_to_scan: %s
\
n
"
,
path_to_scan
)
fprintf
(
stdout
,
"fb_exec_path: %s
\
n
"
,
fb_exec_path
)
fprintf
(
stdout
,
"fb_lib_path: %s
\
n
"
,
fb_lib_path
)
fprintf
(
stdout
,
"fb_conf_path: %s
\
n
"
,
fb_conf_path
)
fprintf
(
stdout
,
"log_path: %s
\
n
"
,
log_path
)
err
=
execlp
(
fb_exec_path
,
program_name
,
<
char
*>
"-e"
,
fb_lib_path
,
<
char
*>
"-c"
,
fb_conf_path
,
0
)
fprintf
(
stderr
,
"ERROR with execlp() in CHILD: %d
\
n
"
,
err
)
else
:
# PARENT
...
...
@@ -363,13 +368,15 @@ cdef public int main(int argc, char* argv[]) nogil:
cdef
char
*
fb_lib_path
=
"/etc/fluentbit_wendelin.so"
cdef
char
*
fb_conf_path
=
"/etc/flb.conf"
cdef
char
*
log_path
=
"/var/log/metadata_collect.log"
if
argc
==
2
:
path_to_scan
=
<
char
*>
argv
[
1
]
elif
argc
==
6
:
if
argc
>=
2
:
path_to_scan
=
<
char
*>
argv
[
1
]
if
argc
>=
3
:
fb_exec_path
=
<
char
*>
argv
[
2
]
if
argc
>=
4
:
fb_lib_path
=
<
char
*>
argv
[
3
]
if
argc
>=
5
:
fb_conf_path
=
<
char
*>
argv
[
4
]
if
argc
>=
6
:
log_path
=
<
char
*>
argv
[
5
]
return
start
(
<
char
*>
path_to_scan
,
<
char
*>
fb_exec_path
,
<
char
*>
fb_lib_path
,
<
char
*>
fb_conf_path
,
<
char
*>
log_path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment