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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
slapos
Commits
019306b4
Commit
019306b4
authored
Oct 06, 2011
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basic working cubrid, currently listening to all interfaces
parent
fa268821
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
13 deletions
+28
-13
slapos/recipe/cubrid/__init__.py
slapos/recipe/cubrid/__init__.py
+23
-11
slapos/recipe/cubrid/template/cubrid.in
slapos/recipe/cubrid/template/cubrid.in
+2
-2
software/cubrid/instance.cfg
software/cubrid/instance.cfg
+3
-0
No files found.
slapos/recipe/cubrid/__init__.py
View file @
019306b4
...
...
@@ -37,6 +37,15 @@ class Recipe(BaseSlapRecipe):
def
getTemplateFilename
(
self
,
template_name
):
return
pkg_resources
.
resource_filename
(
__name__
,
'template/%s'
%
template_name
)
def
_createSimlink
(
self
,
source
,
destination
):
if
os
.
path
.
exists
(
destination
):
if
os
.
path
.
islink
(
destination
):
os
.
remove
(
destination
)
else
:
raise
OSError
(
"Trying to create a simlink, but real file "
\
"already exists at destination %s"
%
destination
)
os
.
symlink
(
source
,
destination
)
def
_install
(
self
):
self
.
path_list
=
[]
...
...
@@ -69,15 +78,17 @@ class Recipe(BaseSlapRecipe):
config_dict
.
update
(
self
.
options
)
config_dict
.
update
(
self
.
parameter_dict
)
config_dict
[
'cubrid_home'
]
=
self
.
work_directory
cubrid_home_path
=
os
.
path
.
join
(
self
.
data_root_directory
,
"cubrid"
)
config_dict
[
'cubrid_home'
]
=
cubrid_home_path
config_dict
[
'cubrid_ip'
]
=
ip
config_dict
[
'cubrid_port'
]
=
port
config_dict
[
'cubrid_database'
]
=
os
.
path
.
join
(
self
.
var_directory
,
'cubrid.db'
)
config_dict
[
'cubrid_database'
]
=
os
.
path
.
join
(
'cubrid'
)
# Create configuration
cubrid_configuration_template_path
=
self
.
getTemplateFilename
(
'cubrid.conf.in'
)
cubrid_configuration_path
=
self
.
createConfigurationFile
(
"cubrid.conf"
,
self
.
substituteTemplate
(
'template'
,
'cubrid.conf.in'
))
self
.
substituteTemplate
(
cubrid_configuration_template_path
,
config_dict
))
# Create wrapper
cubrid_wrapper_template_location
=
pkg_resources
.
resource_filename
(
...
...
@@ -86,17 +97,18 @@ class Recipe(BaseSlapRecipe):
self
.
substituteTemplate
(
cubrid_wrapper_template_location
,
config_dict
))
# Create cubrid configuration directory and link config file here.
cubrid_conf_directory
=
os
.
path
.
join
(
self
.
work_directory
,
'conf'
)
self
.
_createDirectory
(
cubrid_home_path
)
cubrid_conf_directory
=
os
.
path
.
join
(
cubrid_home_path
,
'conf'
)
self
.
_createDirectory
(
cubrid_conf_directory
)
os
.
sy
mlink
(
cubrid_configuration_path
,
self
.
_createSi
mlink
(
cubrid_configuration_path
,
os
.
path
.
join
(
cubrid_conf_directory
,
'cubrid.conf'
))
# Create links to cubrid files, otherzise it will whine.
os
.
sy
mlink
(
os
.
path
.
join
(
self
.
options
[
'cubrid_location'
],
'bin'
),
os
.
path
.
join
(
self
.
work_directory
,
'bin'
))
os
.
sy
mlink
(
os
.
path
.
join
(
self
.
options
[
'cubrid_location'
],
'msg'
),
os
.
path
.
join
(
self
.
work_directory
,
'msg'
))
self
.
_createSi
mlink
(
os
.
path
.
join
(
self
.
options
[
'cubrid_location'
],
'bin'
),
os
.
path
.
join
(
cubrid_home_path
,
'bin'
))
self
.
_createSi
mlink
(
os
.
path
.
join
(
self
.
options
[
'cubrid_location'
],
'msg'
),
os
.
path
.
join
(
cubrid_home_path
,
'msg'
))
self
.
path_list
.
append
(
cubrid_runner_path
)
self
.
path_list
.
extend
([
cubrid_runner_path
,
cubrid_configuration_path
]
)
return
config_dict
def
installCrond
(
self
):
...
...
slapos/recipe/cubrid/template/cubrid.in
View file @
019306b4
...
...
@@ -5,7 +5,7 @@ export JAVA_HOME=%(java_home)s
if
[
!
-f
%
(
cubrid_database
)
s
]
;
then
exec
%
(
cubrid_binary
)
s createdb %
(
cubrid_database
)
s
%
(
cubrid_binary
)
s createdb %
(
cubrid_database
)
s
fi
exec
%
(
cubrid
_binary
)
s server start %
(
cubrid_database
)
s
%
(
cubrid_server
_binary
)
s server start %
(
cubrid_database
)
s
software/cubrid/instance.cfg
View file @
019306b4
...
...
@@ -8,6 +8,9 @@ develop-eggs-directory = ${buildout:develop-eggs-directory}
[instance]
recipe = ${instance-recipe:egg}:${instance-recipe:module}
cubrid_binary = ${cubrid:location}/bin/cubrid
cubrid_broker_binary = ${cubrid:location}/bin/cub_broker
cubrid_master_binary = ${cubrid:location}/bin/cub_master
cubrid_server_binary = ${cubrid:location}/bin/cub_server
cubrid_location = ${cubrid:location}
dcrond_binary = ${dcron:location}/sbin/crond
java_home = ${java-sdk:location}
...
...
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