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
703d065d
Commit
703d065d
authored
Nov 14, 2013
by
Guilhem Lettron
Committed by
Stéphane Graber
Nov 25, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxc-ubuntu: Factorize @LOCALSTATEDIR@ variable
Signed-off-by:
Guilhem Lettron
<
guilhem.lettron@optiflows.com
>
Acked-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
5eb28ae4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
lxc-ubuntu.in
templates/lxc-ubuntu.in
+7
-5
No files found.
templates/lxc-ubuntu.in
View file @
703d065d
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
set
-e
set
-e
LOCALSTATEDIR
=
@LOCALSTATEDIR@
if
[
-r
/etc/default/lxc
]
;
then
if
[
-r
/etc/default/lxc
]
;
then
.
/etc/default/lxc
.
/etc/default/lxc
fi
fi
...
@@ -92,7 +94,7 @@ EOF
...
@@ -92,7 +94,7 @@ EOF
fi
fi
# generate new SSH keys
# generate new SSH keys
if
[
-x
$rootfs
@LOCALSTATEDIR@
/lib/dpkg/info/openssh-server.postinst
]
;
then
if
[
-x
$rootfs
$LOCALSTATEDIR
/lib/dpkg/info/openssh-server.postinst
]
;
then
cat
>
$rootfs
/usr/sbin/policy-rc.d
<<
EOF
cat
>
$rootfs
/usr/sbin/policy-rc.d
<<
EOF
#!/bin/sh
#!/bin/sh
exit 101
exit 101
...
@@ -101,7 +103,7 @@ EOF
...
@@ -101,7 +103,7 @@ EOF
rm
-f
$rootfs
/etc/ssh/ssh_host_
*
key
*
rm
-f
$rootfs
/etc/ssh/ssh_host_
*
key
*
mv
$rootfs
/etc/init/ssh.conf
$rootfs
/etc/init/ssh.conf.disabled
mv
$rootfs
/etc/init/ssh.conf
$rootfs
/etc/init/ssh.conf.disabled
DPKG_MAINTSCRIPT_PACKAGE
=
openssh
DPKG_MAINTSCRIPT_NAME
=
postinst
chroot
$rootfs
@LOCALSTATEDIR@
/lib/dpkg/info/openssh-server.postinst configure
DPKG_MAINTSCRIPT_PACKAGE
=
openssh
DPKG_MAINTSCRIPT_NAME
=
postinst
chroot
$rootfs
$LOCALSTATEDIR
/lib/dpkg/info/openssh-server.postinst configure
mv
$rootfs
/etc/init/ssh.conf.disabled
$rootfs
/etc/init/ssh.conf
mv
$rootfs
/etc/init/ssh.conf.disabled
$rootfs
/etc/init/ssh.conf
rm
-f
$rootfs
/usr/sbin/policy-rc.d
rm
-f
$rootfs
/usr/sbin/policy-rc.d
...
@@ -329,8 +331,8 @@ install_ubuntu()
...
@@ -329,8 +331,8 @@ install_ubuntu()
rootfs
=
$1
rootfs
=
$1
release
=
$2
release
=
$2
flushcache
=
$3
flushcache
=
$3
cache
=
"
@LOCALSTATEDIR@
/cache/lxc/
$release
"
cache
=
"
$LOCALSTATEDIR
/cache/lxc/
$release
"
mkdir
-p
@LOCALSTATEDIR@
/lock/subsys/
mkdir
-p
$LOCALSTATEDIR
/lock/subsys/
(
(
flock
-x
200
flock
-x
200
...
@@ -364,7 +366,7 @@ install_ubuntu()
...
@@ -364,7 +366,7 @@ install_ubuntu()
return
0
return
0
)
200>
@LOCALSTATEDIR@
/lock/subsys/lxc-ubuntu
)
200>
$LOCALSTATEDIR
/lock/subsys/lxc-ubuntu
return
$?
return
$?
}
}
...
...
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