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
1bf4292e
Commit
1bf4292e
authored
Apr 25, 2016
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #978 from evgeni/lsb-init-scripts
don't make sysv init scripts dependant on distribution specifics
parents
a14574ba
3083782c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
32 deletions
+24
-32
lxc-containers.in
config/init/sysvinit/lxc-containers.in
+12
-16
lxc-net.in
config/init/sysvinit/lxc-net.in
+12
-16
No files found.
config/init/sysvinit/lxc-containers.in
View file @
1bf4292e
...
...
@@ -17,30 +17,26 @@
# Description: Bring up/down LXC autostart containers
### END INIT INFO
sysconfdir
=
"@SYSCONFDIR@"
# Source function library.
test
!
-r
"
$sysconfdir
"
/rc.d/init.d/functions
||
.
"
$sysconfdir
"
/rc.d/init.d/functions
# To be replaced by LSB functions, if they can be found
# Defined here for distributions that don't have log_daemon_msg
log_daemon_msg
()
{
echo
$@
}
# provide action() fallback
if
!
type
action
>
/dev/null 2>&1
;
then
# Real basic fallback for sysvinit "action" verbage.
action
()
{
echo
-n
"
$1
"
shift
"
$@
"
&&
echo
"OK"
||
echo
"Failed"
}
fi
# Try to source LSB init functions to define LSB log_* functions.
test
!
-r
/lib/lsb/init-functions
||
.
/lib/lsb/init-functions
start
()
{
# Setup host /dev for autodev containers.
@LIBEXECDIR@/lxc/lxc-devsetup
action
$"Starting LXC autoboot containers: "
@LIBEXECDIR@/lxc/lxc-containers start
log_daemon_msg
"Starting LXC autoboot containers: "
@LIBEXECDIR@/lxc/lxc-containers start
}
stop
()
{
action
$"Stopping LXC containers: "
@LIBEXECDIR@/lxc/lxc-containers stop
log_daemon_msg
"Stopping LXC containers: "
@LIBEXECDIR@/lxc/lxc-containers stop
}
# See how we were called.
...
...
config/init/sysvinit/lxc-net.in
View file @
1bf4292e
...
...
@@ -17,28 +17,24 @@
# Description: Bring up/down LXC Network Bridge
### END INIT INFO
sysconfdir
=
"@SYSCONFDIR@"
# Source function library.
test
!
-r
"
$sysconfdir
"
/rc.d/init.d/functions
||
.
"
$sysconfdir
"
/rc.d/init.d/functions
# To be replaced by LSB functions, if they can be found
# Defined here for distributions that don't have log_daemon_msg
log_daemon_msg
()
{
echo
$@
}
# provide action() fallback
if
!
type
action
>
/dev/null 2>&1
;
then
# Real basic fallback for sysvinit "action" verbage.
action
()
{
echo
-n
"
$1
"
shift
"
$@
"
&&
echo
"OK"
||
echo
"Failed"
}
fi
# Try to source LSB init functions to define LSB log_* functions.
test
!
-r
/lib/lsb/init-functions
||
.
/lib/lsb/init-functions
start
()
{
action
$"Starting LXC network bridge: "
@LIBEXECDIR@/lxc/lxc-net start
log_daemon_msg
"Starting LXC network bridge: "
@LIBEXECDIR@/lxc/lxc-net start
}
stop
()
{
action
$"Stopping LXC network bridge: "
@LIBEXECDIR@/lxc/lxc-net stop
log_daemon_msg
"Stopping LXC network bridge: "
@LIBEXECDIR@/lxc/lxc-net stop
}
# See how we were called.
...
...
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