mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
Merge branch 'master' of git.opennebula.org:one
This commit is contained in:
commit
e4b198691c
@ -912,7 +912,7 @@ SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \
|
||||
# ACCT files
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
ACCT_BIN_FILES="src/acct/acctd"
|
||||
ACCT_BIN_FILES="src/acct/oneacctd"
|
||||
|
||||
ACCT_LIB_FILES="src/acct/monitoring.rb \
|
||||
src/acct/accounting.rb \
|
||||
|
@ -29,6 +29,35 @@ group :cloud do
|
||||
gem 'thin', '1.2.7'
|
||||
gem 'uuid'
|
||||
gem 'curb'
|
||||
gem 'sqlite3-ruby'
|
||||
end
|
||||
|
||||
group :ozones_client do
|
||||
gem 'json', '= 1.5.1'
|
||||
end
|
||||
|
||||
group :ozones_server do
|
||||
gem 'json', '= 1.5.1'
|
||||
gem 'datamapper'
|
||||
gem 'dm-sqlite-adapter'
|
||||
gem 'dm-mysql-adapter'
|
||||
end
|
||||
|
||||
group :ozones_server_mysql do
|
||||
gem 'json', '= 1.5.1'
|
||||
gem 'datamapper'
|
||||
gem 'dm-mysql-adapter'
|
||||
end
|
||||
|
||||
group :ozones_server_sqlite do
|
||||
gem 'json', '= 1.5.1'
|
||||
gem 'datamapper'
|
||||
gem 'dm-sqlite-adapter'
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
group :dummy do
|
||||
gem 'rake'
|
||||
end
|
||||
|
65
share/bundler/install_gems
Executable file
65
share/bundler/install_gems
Executable file
@ -0,0 +1,65 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
PACKAGES=%w{optional sunstone quota cloud ozones_client ozones_server
|
||||
ozones_server_mysql ozones_server_sqlite}
|
||||
|
||||
DEFAULT=%w{optional sunstone quota cloud ozones_server}
|
||||
|
||||
|
||||
class String
|
||||
def unindent(spaces=4)
|
||||
self.gsub!(/^ {#{spaces}}/, '')
|
||||
end
|
||||
end
|
||||
|
||||
def try_library(name, error_message)
|
||||
begin
|
||||
require name.to_s
|
||||
rescue LoadError
|
||||
STDERR.puts error_message
|
||||
exit -1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
try_library :rubygems, <<-EOT.unindent
|
||||
rubygems required to use this tool
|
||||
|
||||
Use one of these methods:
|
||||
|
||||
* Debian/Ubuntu
|
||||
apt-get install rubygems libopenssl-ruby
|
||||
|
||||
* RHEL/CENTOS
|
||||
yum install rubygems
|
||||
|
||||
* Specific rubygems package for your distro
|
||||
|
||||
* Follow the instructions from http://rubygems.org/pages/download
|
||||
EOT
|
||||
|
||||
try_library :bundler, <<-EOT.unindent
|
||||
bundler needed to install gems
|
||||
|
||||
execute this to install it:
|
||||
|
||||
[sudo] gem install bundler
|
||||
EOT
|
||||
|
||||
|
||||
if ARGV.length>0
|
||||
packages=ARGV
|
||||
else
|
||||
packages=DEFAULT
|
||||
end
|
||||
|
||||
no_packages=PACKAGES-packages
|
||||
no_packages<<'dummy'
|
||||
|
||||
without="--without #{no_packages.join(' ')}"
|
||||
|
||||
command_string = "bundle #{without}"
|
||||
|
||||
puts command_string
|
||||
|
||||
#system command_string
|
@ -15,7 +15,7 @@
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
# Database URI
|
||||
:DB: sqlite:///tmp/test_one_acct.db
|
||||
#:DB: sqlite:///var/one/oneacct.db
|
||||
|
||||
# Duration of each daemon loop in seconds
|
||||
:STEP: 300 # 5 minutes
|
||||
|
@ -60,7 +60,28 @@ start)
|
||||
|
||||
# acctd not running, safe to start
|
||||
$ACCTD_CMD &> $ACCTD_LOG &
|
||||
echo $! > $ACCTD_PID_FILE
|
||||
|
||||
LASTRC=$?
|
||||
LASTPID=$!
|
||||
|
||||
if [ $LASTRC -ne 0 ]; then
|
||||
echo "Error executing acctd."
|
||||
echo "Check $ACCTD_LOG for more information"
|
||||
exit 1
|
||||
else
|
||||
echo $LASTPID > $ACCTD_PID_FILE
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
ps $LASTPID > /dev/null 2>&1
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error executing acctd."
|
||||
echo "Check $ACCTD_LOG for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "acctd started"
|
||||
;;
|
||||
stop)
|
||||
# check if running
|
||||
@ -74,6 +95,8 @@ stop)
|
||||
ACCTD_PID=`cat $ACCTD_PID_FILE 2>/dev/null`
|
||||
kill $ACCTD_PID &> /dev/null
|
||||
rm -f $ACCTD_PID_FILE &> /dev/null
|
||||
|
||||
echo "acctd stop"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: acctd {start|stop}" >&2
|
@ -6,13 +6,20 @@ module WatchHelper
|
||||
|
||||
if !ONE_LOCATION
|
||||
ACCTD_CONF="/etc/one/acctd.conf"
|
||||
ACCT_DB="/var/one/oneacct.db"
|
||||
else
|
||||
ACCTD_CONF=ONE_LOCATION+"/etc/acctd.conf"
|
||||
ACCT_DB=ONE_LOCATION+"/var/oneacct.db"
|
||||
end
|
||||
|
||||
CONF = YAML.load_file(ACCTD_CONF)
|
||||
|
||||
DB = Sequel.connect(CONF[:DB])
|
||||
if CONF[:DB]
|
||||
DB = Sequel.connect(CONF[:DB])
|
||||
else
|
||||
DB = Sequel.connect("sqlite//#{ACCT_DB}")
|
||||
end
|
||||
|
||||
VM_DELTA = {
|
||||
:net_rx => {
|
||||
:type => Integer,
|
||||
|
4
src/cli/etc/group.default
Normal file
4
src/cli/etc/group.default
Normal file
@ -0,0 +1,4 @@
|
||||
# This rule allows users in the new group to create common resources
|
||||
VM+NET+IMAGE+TEMPLATE/* CREATE
|
||||
# This rule allows users in the group to deploy VMs in any host in the cloud
|
||||
HOST/* USE
|
Loading…
x
Reference in New Issue
Block a user