Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
slapos
Commits
10b2e4c2
Commit
10b2e4c2
authored
Sep 02, 2013
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade Openstack configure script
parent
d1f8f87e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
149 additions
and
64 deletions
+149
-64
software/openstack/software.cfg
software/openstack/software.cfg
+1
-1
software/openstack/templates/configure.sh.in
software/openstack/templates/configure.sh.in
+148
-63
No files found.
software/openstack/software.cfg
View file @
10b2e4c2
...
@@ -63,7 +63,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
...
@@ -63,7 +63,7 @@ location = ${buildout:parts-directory}/${:_buildout_section_name_}
[compute-script]
[compute-script]
<= template-download
<= template-download
filename = configure.sh.in
filename = configure.sh.in
md5sum =
73e5a796b8d27e20167f36732a1c9fad
md5sum =
2b0b0be2738ed07716a34ccc7c7135ff
[compute-script-run]
[compute-script-run]
<= template-download
<= template-download
...
...
software/openstack/templates/configure.sh.in
View file @
10b2e4c2
...
@@ -3,9 +3,7 @@
...
@@ -3,9 +3,7 @@
#configure.sh: Should install and configure all needed openstack packages.
#configure.sh: Should install and configure all needed openstack packages.
NETWORK_CONFIG
=
"/etc/network/interfaces"
NETWORK_CONFIG
=
"/etc/network/interfaces"
BRCTL_EXEC
=
`
which brctl
`
GCC_EXEC
=
`
which gcc
`
GCC_EXEC
=
`
which gcc
`
GIT_EXEC
=
`
which git
`
NOV_URL
=
"
${
:nova-url
}
"
NOV_URL
=
"
${
:nova-url
}
"
NOVA_CONFIG
=
"/etc/nova/nova.conf"
NOVA_CONFIG
=
"/etc/nova/nova.conf"
BASE_DIR
=
$HOME
BASE_DIR
=
$HOME
...
@@ -54,6 +52,7 @@ EOF
...
@@ -54,6 +52,7 @@ EOF
if
[
-z
"
$BRCTL_EXEC
"
-o
!
-x
"
$BRCTL_EXEC
"
]
;
then
if
[
-z
"
$BRCTL_EXEC
"
-o
!
-x
"
$BRCTL_EXEC
"
]
;
then
apt-get
install
-y
bridge-utils
;
apt-get
install
-y
bridge-utils
;
fi
fi
BRCTL_EXEC
=
`
which brctl
`
$BRCTL_EXEC
addbr br100
$BRCTL_EXEC
addbr br100
...
@@ -76,6 +75,7 @@ apt-get install -y python-lxml
...
@@ -76,6 +75,7 @@ apt-get install -y python-lxml
if
[
-z
"
$GIT_EXEC
"
-o
!
-x
"
$GIT_EXEC
"
]
;
then
if
[
-z
"
$GIT_EXEC
"
-o
!
-x
"
$GIT_EXEC
"
]
;
then
apt-get
install
-y
git
;
apt-get
install
-y
git
;
fi
fi
GIT_EXEC
=
`
which git
`
#Remove all pip tmp cache is to prevent installation failure
#Remove all pip tmp cache is to prevent installation failure
rm
-rf
/tmp/pip_build_root/
*
rm
-rf
/tmp/pip_build_root/
*
...
@@ -100,6 +100,12 @@ mkdir -p /opt/stack/data/nova
...
@@ -100,6 +100,12 @@ mkdir -p /opt/stack/data/nova
mkdir
-p
/opt/stack/data/nova/instances
mkdir
-p
/opt/stack/data/nova/instances
mkdir
-p
/opt/stack/log
mkdir
-p
/opt/stack/log
NOVA_COMPUTE_EXEX
=
`
which nova-compute
`
if
[
-z
"
$NOVA_COMPUTE_EXEX
"
-o
!
-x
"
$NOVA_COMPUTE_EXEX
"
]
;
then
echo
"ERROR: can't find nova-compute executable file!!!!"
exit
1
fi
cp
-rf
$BASE_DIR
/nova/etc/nova /etc/
cp
-rf
$BASE_DIR
/nova/etc/nova /etc/
cat
>
$NOVA_CONFIG
<<
EOF
cat
>
$NOVA_CONFIG
<<
EOF
...
@@ -165,73 +171,152 @@ enabled = false
...
@@ -165,73 +171,152 @@ enabled = false
html5proxy_base_url = http://
$IPv4
:6082/spice_auto.html
html5proxy_base_url = http://
$IPv4
:6082/spice_auto.html
EOF
EOF
NOVA_COMPUTE_EXEX
=
`
which nova-compute
`
if
[
-z
"
$EASY_INSTALL
"
-o
!
-x
"
$EASY_INSTALL
"
]
;
then
echo
"ERROR: can't find nova-compute executable file!!!!"
exit
1
fi
#Add Nova-compute in init.d If file not exist now
#Add Nova-compute in init.d If file not exist now
cat
>
/etc/init.d/nova-compute
<<
EOF
cat
>
/etc/init.d/nova-compute
<<
EOF
#!/bin/sh
#! /bin/sh
### BEGIN INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin
# Provides: skeleton
DAEMON=
$NOVA_COMPUTE_EXEX
# Required-Start:
\$
remote_fs
\$
syslog
NAME=nova-compute
# Required-Stop:
\$
remote_fs
\$
syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="OpenStack Conpute Node"
DESC="OpenStack Conpute Node"
NAME=nova-compute
pid=
\`
ps ax | egrep nova-compute | egrep nova.conf | cut -d ' ' -f1
\`
DAEMON=
$NOVA_COMPUTE_EXEX
DAEMON_ARGS="--config-file
$NOVA_CONFIG
"
PIDFILE=/var/run/
\$
NAME.pid
SCRIPTNAME=/etc/init.d/
\$
NAME
# Exit if the package is not installed
[ -x "
\$
DAEMON" ] || exit 0
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --background -m --oknodo --pidfile
\$
PIDFILE --exec
\$
DAEMON --test > /dev/null
\\
|| return 1
start-stop-daemon --start --quiet --background -m --oknodo --pidfile
\$
PIDFILE --exec
\$
DAEMON --
\\
\$
DAEMON_ARGS
\\
|| return 2
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile
\$
PIDFILE --name
\$
NAME
RETVAL="
\$
?"
[ "
\$
RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec
\$
DAEMON
[ "
\$
?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f
\$
PIDFILE
return "
\$
RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet --pidfile
\$
PIDFILE --name
\$
NAME
return 0
}
case "
\$
1" in
case "
\$
1" in
start)
start)
if [ -z "
\$
pid" ]; then
[ "
\$
VERBOSE" != no ] && log_daemon_msg "Starting
\$
DESC" "
\$
NAME"
echo -n "Starting
\$
DESC:
\$
NAME"
do_start
$NOVA_COMPUTE_EXEX
--config-file
$NOVA_CONFIG
& > /dev/null
case "
\$
?" in
else
0|1) [ "
\$
VERBOSE" != no ] && log_end_msg 0 ;;
echo "
\$
DESC:
\$
NAME is curently under execution";
2) [ "
\$
VERBOSE" != no ] && log_end_msg 1 ;;
fi
esac
;;
echo "."
stop)
;;
[ "
\$
VERBOSE" != no ] && log_daemon_msg "Stopping
\$
DESC" "
\$
NAME"
do_stop
stop)
case "
\$
?" in
if [ -z "
\$
pid" ]; then
0|1) [ "
\$
VERBOSE" != no ] && log_end_msg 0 ;;
echo " nova-compute isn't running, so not killed" ;
2) [ "
\$
VERBOSE" != no ] && log_end_msg 1 ;;
else
esac
kill -TERM
\$
pid > /dev/null ;
;;
fi
status)
echo "."
status_of_proc "
\$
DAEMON" "
\$
NAME" && exit 0 || exit
\$
?
;;
;;
#reload|force-reload)
restart)
#
if [ -z "
\$
pid" ]; then
# If do_reload() is not implemented then leave this commented out
echo " nova-compute isn't running!!" ;
# and leave 'force-reload' as an alias for 'restart'.
else
#
kill -TERM
\$
pid > /dev/null ;
#log_daemon_msg "Reloading
\$
DESC" "
\$
NAME"
fi
#do_reload
# Attente d'une seconde avant de continuer le script
#log_end_msg
\$
?
sleep 1
#;;
restart|force-reload)
$NOVA_COMPUTE_EXEX
--config-file
$NOVA_CONFIG
& > /dev/null
#
echo "."
# If the "reload" option is implemented then remove the
;;
# 'force-reload' alias
#
status)
log_daemon_msg "Restarting
\$
DESC" "
\$
NAME"
if [ -z "
\$
pid" ]; then
do_stop
echo " nova-compute: STOPPED/EXITED" ;
case "
\$
?" in
else
0|1)
echo " nova-compute: RUNNING PID:
\$
pid" ;
do_start
fi
case "
\$
?" in
echo "."
0) log_end_msg 0 ;;
;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
*)
esac
echo "Usage: /etc/init.d/
\$
NAME start|stop|restart" >&2
;;
exit 1
*)
;;
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage:
\$
SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
esac
exit 0
:
EOF
EOF
chmod
+x /etc/init.d/nova-compute
chmod
+x /etc/init.d/nova-compute
...
...
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