Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
1871e646
Unverified
Commit
1871e646
authored
Jul 02, 2019
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start: expose LXC_PID to network hooks too
Closes #3066. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
e389f2af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
start.c
src/lxc/start.c
+8
-8
No files found.
src/lxc/start.c
View file @
1871e646
...
...
@@ -1756,6 +1756,14 @@ static int lxc_spawn(struct lxc_handler *handler)
goto
out_delete_net
;
}
ret
=
snprintf
(
pidstr
,
20
,
"%d"
,
handler
->
pid
);
if
(
ret
<
0
||
ret
>=
20
)
goto
out_delete_net
;
ret
=
setenv
(
"LXC_PID"
,
pidstr
,
1
);
if
(
ret
<
0
)
SYSERROR
(
"Failed to set environment variable: LXC_PID=%s"
,
pidstr
);
for
(
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
if
(
handler
->
ns_on_clone_flags
&
ns_info
[
i
].
clone_flag
)
INFO
(
"Cloned %s"
,
ns_info
[
i
].
flag_name
);
...
...
@@ -1882,14 +1890,6 @@ static int lxc_spawn(struct lxc_handler *handler)
}
}
ret
=
snprintf
(
pidstr
,
20
,
"%d"
,
handler
->
pid
);
if
(
ret
<
0
||
ret
>=
20
)
goto
out_delete_net
;
ret
=
setenv
(
"LXC_PID"
,
pidstr
,
1
);
if
(
ret
<
0
)
SYSERROR
(
"Failed to set environment variable: LXC_PID=%s"
,
pidstr
);
/* Run any host-side start hooks */
ret
=
run_lxc_hooks
(
name
,
"start-host"
,
conf
,
NULL
);
if
(
ret
<
0
)
{
...
...
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