Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
Kirill Smelkov
ZODB
Commits
b595b063
Commit
b595b063
authored
Jan 22, 2003
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak docstring.
Add socket-name to runner conf template. Check that the port isn't in use already.
parent
0f22342c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
src/ZEO/mkzeoinst.py
src/ZEO/mkzeoinst.py
+22
-5
No files found.
src/ZEO/mkzeoinst.py
View file @
b595b063
...
...
@@ -16,18 +16,23 @@
Usage: mkzeoinst.py home [port]
Given an "instance home directory" <home> and some configuration
options (all
of which have default values), create the following:
Given an "instance home directory" <home> and some configuration
o
ptions (all o
f which have default values), create the following:
<home>/etc/zeo.conf -- ZEO config file
with default values filled in
<home>/etc/runner.conf --
ZEO config file with default values filled in
<home>/var/ -- Directory for
Data.fs
<home>/etc/zeo.conf -- ZEO config file
<home>/etc/runner.conf --
zdctl config file
<home>/var/ -- Directory for
data files: Data.fs etc.
<home>/log/ -- Directory for log files: zeo.log and runner.log
<home>/bin/zeoctl -- start/stop script (a shim for zdctl.py)
The script will not overwrite existing files; instead, it will issue a
warning if an existing file is found that differs from the file that
would be written if it didn't exist.
The script assumes that runzeo.py, zdrun.py, and zdctl.py can be found
on the shell's $PATH, and that their #! line names the right Python
interpreter. When you use the ZODB3 setup.py script to install the
ZODB3 software, this is taken care of.
"""
import
os
...
...
@@ -61,6 +66,7 @@ runner_conf_template = """# runner configuration file
<runner>
program %(runzeo)s -C %(home)s/etc/zeo.conf
socket-name %(home)s/etc/zeo.zdsock
</runner>
"""
...
...
@@ -83,6 +89,7 @@ def main():
port
=
int
(
sys
.
argv
[
2
])
else
:
port
=
9999
checkport
(
port
)
makedir
(
home
)
makedir
(
home
,
"etc"
)
makedir
(
home
,
"var"
)
...
...
@@ -95,6 +102,16 @@ def main():
home
=
home
,
python
=
sys
.
executable
,
zdctl
=
which
(
"zdctl.py"
))
print
"All done."
def
checkport
(
port
):
import
socket
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
try
:
s
.
bind
((
""
,
port
))
except
socket
.
error
:
print
"A process is already listening on port %d"
%
port
sys
.
exit
(
2
)
s
.
close
()
def
which
(
program
):
strpath
=
os
.
getenv
(
"PATH"
)
binpath
=
strpath
.
split
(
os
.
pathsep
)
...
...
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