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
a31b2048
Commit
a31b2048
authored
Jan 14, 2010
by
Cedric Le Goater
Committed by
Daniel Lezcano
Jan 14, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add --define to restart
Signed-off-by:
Cedric Le Goater
<
clg@fr.ibm.com
>
Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
20117280
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
5 deletions
+38
-5
lxc_restart.c
src/lxc/lxc_restart.c
+38
-5
No files found.
src/lxc/lxc_restart.c
View file @
a31b2048
/*
* lxc: linux Container library
*
* (C) Copyright IBM Corp. 2007, 20
08
* (C) Copyright IBM Corp. 2007, 20
10
*
* Authors:
* Daniel Lezcano <dlezcano at fr.ibm.com>
...
...
@@ -25,11 +25,14 @@
#undef _GNU_SOURCE
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <lxc/lxc.h>
#include <lxc/log.h>
#include "log.h"
#include "lxc.h"
#include "conf.h"
#include "config.h"
#include "confile.h"
#include "arguments.h"
lxc_log_define
(
lxc_restart_ui
,
lxc_restart
);
...
...
@@ -81,6 +84,9 @@ Options :\n\
int
main
(
int
argc
,
char
*
argv
[])
{
char
*
rcfile
=
NULL
;
struct
lxc_conf
*
conf
;
if
(
lxc_arguments_parse
(
&
my_args
,
argc
,
argv
))
return
-
1
;
...
...
@@ -88,6 +94,33 @@ int main(int argc, char *argv[])
my_args
.
progname
,
my_args
.
quiet
))
return
-
1
;
return
lxc_restart
(
my_args
.
name
,
my_args
.
statefile
,
my_args
.
rcfile
,
/* rcfile is specified in the cli option */
if
(
my_args
.
rcfile
)
rcfile
=
(
char
*
)
my_args
.
rcfile
;
else
{
if
(
!
asprintf
(
&
rcfile
,
LXCPATH
"/%s/config"
,
my_args
.
name
))
{
SYSERROR
(
"failed to allocate memory"
);
return
-
1
;
}
/* container configuration does not exist */
if
(
access
(
rcfile
,
F_OK
))
{
free
(
rcfile
);
rcfile
=
NULL
;
}
}
conf
=
lxc_conf_init
();
if
(
!
conf
)
{
ERROR
(
"failed to initialize configuration"
);
return
-
1
;
}
if
(
rcfile
&&
lxc_config_read
(
rcfile
,
conf
))
{
ERROR
(
"failed to read configuration file"
);
return
-
1
;
}
return
lxc_restart
(
my_args
.
name
,
my_args
.
statefile
,
conf
,
my_args
.
flags
);
}
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