Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Kirill Smelkov
Zope
Commits
0871e361
Commit
0871e361
authored
May 23, 2004
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge from 2.7 branch:
Collector 1304: zopectl doesn't allow specification of zdrun effective user.
parent
93439e6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
lib/python/Zope/Startup/zopectl.py
lib/python/Zope/Startup/zopectl.py
+23
-1
lib/python/Zope/Startup/zopeschema.xml
lib/python/Zope/Startup/zopeschema.xml
+21
-0
No files found.
lib/python/Zope/Startup/zopectl.py
View file @
0871e361
...
...
@@ -24,6 +24,7 @@ Options:
-h/--help -- print this usage message and exit
-i/--interactive -- start an interactive shell after executing commands
-l/--logfile -- log file to be read by logtail command
-u/--user -- run the daemon manager program as this user (or numeric id)
-m/--umask -- provide octal umask for files created by the managed process
action [arguments] -- see below
...
...
@@ -61,6 +62,7 @@ class ZopeCtlOptions(ZDOptions):
program
=
"zopectl"
schemadir
=
os
.
path
.
dirname
(
Zope
.
Startup
.
__file__
)
schemafile
=
"zopeschema.xml"
uid
=
gid
=
None
# XXX Suppress using Zope's <eventlog> section to avoid using the
# same logging for zdctl as for the Zope appserver. There still
...
...
@@ -81,11 +83,32 @@ class ZopeCtlOptions(ZDOptions):
self
.
add
(
"default_to_interactive"
,
"runner.default_to_interactive"
,
default
=
1
)
self
.
add
(
"logfile"
,
None
,
"l:"
,
"logfile="
)
self
.
add
(
"user"
,
"runner.user"
,
"u:"
,
"user="
)
self
.
add
(
"prompt"
,
"runner.prompt"
,
default
=
"zopectl>"
)
self
.
add
(
"umask"
,
"runner.umask"
,
"m:"
,
"umask="
)
def
realize
(
self
,
*
args
,
**
kw
):
ZDOptions
.
realize
(
self
,
*
args
,
**
kw
)
# Additional checking of user option; set uid and gid
if
self
.
user
is
not
None
:
import
pwd
try
:
uid
=
int
(
self
.
user
)
except
ValueError
:
try
:
pwrec
=
pwd
.
getpwnam
(
self
.
user
)
except
KeyError
:
self
.
usage
(
"username %r not found"
%
self
.
user
)
uid
=
pwrec
[
2
]
else
:
try
:
pwrec
=
pwd
.
getpwuid
(
uid
)
except
KeyError
:
self
.
usage
(
"uid %r not found"
%
self
.
user
)
gid
=
pwrec
[
3
]
self
.
uid
=
uid
self
.
gid
=
gid
config
=
self
.
configroot
self
.
directory
=
config
.
instancehome
self
.
clienthome
=
config
.
clienthome
...
...
@@ -94,7 +117,6 @@ class ZopeCtlOptions(ZDOptions):
else
:
self
.
program
=
[
os
.
path
.
join
(
self
.
directory
,
"bin"
,
"runzope"
)]
self
.
sockname
=
os
.
path
.
join
(
self
.
clienthome
,
"zopectlsock"
)
self
.
user
=
None
self
.
python
=
sys
.
executable
self
.
zdrun
=
os
.
path
.
join
(
os
.
path
.
dirname
(
zdaemon
.
__file__
),
"zdrun.py"
)
...
...
lib/python/Zope/Startup/zopeschema.xml
View file @
0871e361
...
...
@@ -127,6 +127,27 @@
</description>
</key>
<key
name=
"user"
datatype=
"string"
required=
"no"
>
<description>
Command-line option: -u or --user.
When zdrun.py is started by root, this option specifies the
user as who the the zdrun.py process (and hence the daemon
subprocess) will run. This can be a user name or a numeric
user id. Both the user and the group are set from the
corresponding password entry, using setuid() and setgid().
This is done before zdrun.py does anything else besides
parsing its command line arguments.
NOTE: when zdrun.py is not started by root, specifying this
option is an error. (XXX This may be a mistake.)
XXX The zdrun.py event log file may be opened *before*
setuid() is called. Is this good or bad?
</description>
</key>
<key
name=
"hang-around"
datatype=
"boolean"
required=
"no"
default=
"false"
>
<description>
...
...
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