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
71634eb3
Commit
71634eb3
authored
Aug 05, 2016
by
Christian Brauner
Committed by
GitHub
Aug 05, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1114 from Blub/lxc-attach-f
lxc-attach: add -f option & cleanup
parents
1e7990d7
b609774d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
lxc_attach.c
src/lxc/tools/lxc_attach.c
+16
-2
No files found.
src/lxc/tools/lxc_attach.c
View file @
71634eb3
...
@@ -65,6 +65,7 @@ static const struct option my_longopts[] = {
...
@@ -65,6 +65,7 @@ static const struct option my_longopts[] = {
{
"keep-var"
,
required_argument
,
0
,
502
},
{
"keep-var"
,
required_argument
,
0
,
502
},
{
"set-var"
,
required_argument
,
0
,
'v'
},
{
"set-var"
,
required_argument
,
0
,
'v'
},
{
"pty-log"
,
required_argument
,
0
,
'L'
},
{
"pty-log"
,
required_argument
,
0
,
'L'
},
{
"rcfile"
,
required_argument
,
0
,
'f'
},
LXC_COMMON_OPTIONS
LXC_COMMON_OPTIONS
};
};
...
@@ -153,6 +154,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
...
@@ -153,6 +154,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
case
'L'
:
case
'L'
:
args
->
console_log
=
arg
;
args
->
console_log
=
arg
;
break
;
break
;
case
'f'
:
args
->
rcfile
=
arg
;
break
;
}
}
return
0
;
return
0
;
...
@@ -196,13 +198,16 @@ Options :\n\
...
@@ -196,13 +198,16 @@ Options :\n\
is the current default behaviour, but is likely to
\n
\
is the current default behaviour, but is likely to
\n
\
change in the future.
\n
\
change in the future.
\n
\
-L, --pty-log=FILE
\n
\
-L, --pty-log=FILE
\n
\
Log pty output to FILE
\n
\
Log pty output to FILE
\n
\
-v, --set-var Set an additional variable that is seen by the
\n
\
-v, --set-var Set an additional variable that is seen by the
\n
\
attached program in the container. May be specified
\n
\
attached program in the container. May be specified
\n
\
multiple times.
\n
\
multiple times.
\n
\
--keep-var Keep an additional environment variable. Only
\n
\
--keep-var Keep an additional environment variable. Only
\n
\
applicable if --clear-env is specified. May be used
\n
\
applicable if --clear-env is specified. May be used
\n
\
multiple times.
\n
"
,
multiple times.
\n
\
-f, --rcfile=FILE
\n
\
Load configuration file FILE
\n
\
"
,
.
options
=
my_longopts
,
.
options
=
my_longopts
,
.
parser
=
my_parser
,
.
parser
=
my_parser
,
.
checker
=
NULL
,
.
checker
=
NULL
,
...
@@ -373,6 +378,15 @@ int main(int argc, char *argv[])
...
@@ -373,6 +378,15 @@ int main(int argc, char *argv[])
if
(
!
c
)
if
(
!
c
)
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
if
(
my_args
.
rcfile
)
{
c
->
clear_config
(
c
);
if
(
!
c
->
load_config
(
c
,
my_args
.
rcfile
))
{
ERROR
(
"Failed to load rcfile"
);
lxc_container_put
(
c
);
exit
(
EXIT_FAILURE
);
}
}
if
(
!
c
->
may_control
(
c
))
{
if
(
!
c
->
may_control
(
c
))
{
fprintf
(
stderr
,
"Insufficent privileges to control %s
\n
"
,
c
->
name
);
fprintf
(
stderr
,
"Insufficent privileges to control %s
\n
"
,
c
->
name
);
lxc_container_put
(
c
);
lxc_container_put
(
c
);
...
...
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