mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-10 09:51:38 +00:00
move script templates to an adequate place
At present the lxc-{template} scripts are installed in the $bindir. This is not the right place as specified by the FHS, so they go to $libdir/lxc/templates. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
d6b1784e1e
commit
c01d62f21b
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
ACLOCAL_AMFLAGS = -I config
|
ACLOCAL_AMFLAGS = -I config
|
||||||
|
|
||||||
SUBDIRS = src scripts doc
|
SUBDIRS = src templates doc
|
||||||
DIST_SUBDIRS = config src scripts doc
|
DIST_SUBDIRS = config src templates doc
|
||||||
EXTRA_DIST = autogen.sh lxc.spec CONTRIBUTING MAINTAINERS ChangeLog
|
EXTRA_DIST = autogen.sh lxc.spec CONTRIBUTING MAINTAINERS ChangeLog
|
||||||
|
|
||||||
pcdatadir = $(datadir)/pkgconfig
|
pcdatadir = $(datadir)/pkgconfig
|
||||||
|
13
configure.ac
13
configure.ac
@ -57,6 +57,7 @@ AS_AC_EXPAND(LXC_GENERATE_DATE, "$(date)")
|
|||||||
AS_AC_EXPAND(LXCPATH, "${with_config_path}")
|
AS_AC_EXPAND(LXCPATH, "${with_config_path}")
|
||||||
AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
|
AS_AC_EXPAND(LXCROOTFSMOUNT, "${with_rootfs_path}")
|
||||||
AS_AC_EXPAND(LXCINITDIR, $libdir/lxc)
|
AS_AC_EXPAND(LXCINITDIR, $libdir/lxc)
|
||||||
|
AS_AC_EXPAND(LXCTEMPLATEDIR, $libdir/lxc/templates)
|
||||||
AH_TEMPLATE([LXCPATH], [lxc configuration repository])
|
AH_TEMPLATE([LXCPATH], [lxc configuration repository])
|
||||||
AH_TEMPLATE([LXCINITDIR], [lxc-init directory location])
|
AH_TEMPLATE([LXCINITDIR], [lxc-init directory location])
|
||||||
AH_TEMPLATE([LXCROOTFSMOUNT], [lxc default rootfs mount point])
|
AH_TEMPLATE([LXCROOTFSMOUNT], [lxc default rootfs mount point])
|
||||||
@ -133,12 +134,12 @@ AC_CONFIG_FILES([
|
|||||||
doc/examples/lxc-veth.conf
|
doc/examples/lxc-veth.conf
|
||||||
doc/examples/lxc-complex.conf
|
doc/examples/lxc-complex.conf
|
||||||
|
|
||||||
scripts/Makefile
|
templates/Makefile
|
||||||
scripts/lxc-debian
|
templates/lxc-debian
|
||||||
scripts/lxc-ubuntu
|
templates/lxc-ubuntu
|
||||||
scripts/lxc-busybox
|
templates/lxc-busybox
|
||||||
scripts/lxc-fedora
|
templates/lxc-fedora
|
||||||
scripts/lxc-sshd
|
templates/lxc-sshd
|
||||||
|
|
||||||
src/Makefile
|
src/Makefile
|
||||||
src/lxc/Makefile
|
src/lxc/Makefile
|
||||||
|
@ -44,6 +44,7 @@ shortoptions='hn:f:t:'
|
|||||||
longoptions='help,name:,config:,template:'
|
longoptions='help,name:,config:,template:'
|
||||||
lxc_path=@LXCPATH@
|
lxc_path=@LXCPATH@
|
||||||
bindir=@BINDIR@
|
bindir=@BINDIR@
|
||||||
|
templatedir=@LXCTEMPLATEDIR@
|
||||||
|
|
||||||
getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@")
|
getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@")
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
@ -133,7 +134,7 @@ fi
|
|||||||
|
|
||||||
if [ ! -z $lxc_template ]; then
|
if [ ! -z $lxc_template ]; then
|
||||||
|
|
||||||
type ${bindir}/lxc-$lxc_template >/dev/null
|
type ${templatedir}/lxc-$lxc_template >/dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "unknown template '$lxc_template'"
|
echo "unknown template '$lxc_template'"
|
||||||
${bindir}/lxc-destroy -n $lxc_name
|
${bindir}/lxc-destroy -n $lxc_name
|
||||||
@ -166,7 +167,7 @@ if [ ! -z $lxc_template ]; then
|
|||||||
read dummy
|
read dummy
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${bindir}/lxc-$lxc_template --path=$lxc_path/$lxc_name --name=$lxc_name
|
${templatedir}/lxc-$lxc_template --path=$lxc_path/$lxc_name --name=$lxc_name
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "failed to execute template '$lxc_template'"
|
echo "failed to execute template '$lxc_template'"
|
||||||
${bindir}/lxc-destroy -n $lxc_name
|
${bindir}/lxc-destroy -n $lxc_name
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
bin_SCRIPTS = \
|
templatesdir=@LXCTEMPLATEDIR@
|
||||||
|
|
||||||
|
templates_SCRIPTS = \
|
||||||
lxc-debian \
|
lxc-debian \
|
||||||
lxc-ubuntu \
|
lxc-ubuntu \
|
||||||
lxc-fedora \
|
lxc-fedora \
|
@ -305,4 +305,3 @@ if [ $? -ne 0 ]; then
|
|||||||
echo "failed to write configuration file"
|
echo "failed to write configuration file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
4
scripts/lxc-debian.in → templates/lxc-debian.in
Executable file → Normal file
4
scripts/lxc-debian.in → templates/lxc-debian.in
Executable file → Normal file
@ -217,7 +217,7 @@ clean()
|
|||||||
|
|
||||||
# lock, so we won't purge while someone is creating a repository
|
# lock, so we won't purge while someone is creating a repository
|
||||||
(
|
(
|
||||||
flock -n -x 200
|
flock -n -x 200
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
echo "Cache repository is busy."
|
echo "Cache repository is busy."
|
||||||
exit 1
|
exit 1
|
||||||
@ -276,7 +276,7 @@ fi
|
|||||||
if [ "$(id -u)" != "0" ]; then
|
if [ "$(id -u)" != "0" ]; then
|
||||||
echo "This script should be run as 'root'"
|
echo "This script should be run as 'root'"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rootfs=$path/rootfs
|
rootfs=$path/rootfs
|
||||||
|
|
1
scripts/lxc-sshd.in → templates/lxc-sshd.in
Executable file → Normal file
1
scripts/lxc-sshd.in → templates/lxc-sshd.in
Executable file → Normal file
@ -189,4 +189,3 @@ if [ $? -ne 0 ]; then
|
|||||||
echo "failed to write configuration file"
|
echo "failed to write configuration file"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user