[Zope-DB] Zope_Database_issue

Michele Marcionelli michele.marcionelli at math.ethz.ch
Fri Nov 19 08:17:45 EST 2010


Hi Smita

running Zope (or a generally a server) as "root" is newer a good idea (for several reasons; one of them: security). Zope probably avoid  this problem by producing the error message that you posted (I just tested it, and I also got the same message).

Create a news user, let say: "zope" with group "zope", change the ownerships as follow:

    chown -R zope:zope /opt/zope

and change the effective-user to zope and try again!!

Cheers,
Michele


On Nov 19, 2010, at 12:32 , smita kamdar wrote:

> 
> Hi,
> 
>  
> To make the permissions, owner & group of all the installables same, I changed the permissions to 777 & owner & group to root for all the installables.
> 
>  
> Now I am able to get the output of the following commands -
> 
> [root at test bin]# ls -l /home/postgres/7.4.13/lib/libpq.so.3
> 
> lrwxrwxrwx. 1 root root 12 2010-11-09 23:59 /home/postgres/7.4.13/lib/libpq.so.3 -> libpq.so.3.1
> 
>  
> [root at test bin]# export LD_LIBRARY_PATH=/home/postgres/7.4.13/lib
> 
> [root at test bin]# echo $LD_LIBRARY_PATH
> 
> /home/postgres/7.4.13/lib
> 
>  
> [root at test bin]# ldd /home/test/Python/2.4.4/lib/python2.4/site-packages/psycopgmodule.so | grep libpq.so
> 
>         libpq.so.3 => /home/postgres/7.4.13/lib/libpq.so.3 (0x005b1000)
> 
>  
> But when I start the zope as root user, I face the following error -
> 
>  
> [root at test bin]# ./zopectl fg
> 
> /opt/zope/bin/runzope -X debug-mode=on
> 
> 2010-11-19 21:10:21 INFO ZServer HTTP server started at Fri Nov 19 21:10:21 2010
> 
>         Hostname: 0.0.0.0
> 
>         Port: 8080
> 
> 2010-11-19 21:10:21 CRITICAL Zope A user was not specified to setuid to; fix this to start as root (change the effective-user directive in zope.conf)
> 
> Traceback (most recent call last):
> 
>   File "/opt/zope/lib/python/Zope2/Startup/run.py", line 56, in ?
> 
>     run()
> 
>   File "/opt/zope/lib/python/Zope2/Startup/run.py", line 21, in run
> 
>     starter.prepare()
> 
>   File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 105, in prepare
> 
>     self.dropPrivileges()
> 
>   File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 256, in dropPrivileges
> 
>     return dropPrivileges(self.cfg)
> 
>   File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 425, in dropPrivileges
> 
>     raise ZConfig.ConfigurationError(msg)
> 
> ZConfig.ConfigurationError: A user was not specified to setuid to; fix this to start as root (change the effective-user directive in zope.conf)
> 
>  
>  
> The effective user part in /etc/zope.conf file looks as shown below -  
> 
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
> 
> # Directive: effective-user
> 
> #
> 
> # Description:
> 
> #     If you intend to run Zope as the "root" user, you must supply this
> 
> #     directive with an effective username or userid number to which Zope
> 
> #     will 'suid' after the server ports are bound. This directive only
> 
> #     has effect under UNIX and if Zope is started as the root user.
> 
> #
> 
> # Default: unset
> 
> #
> 
> # Example:
> 
> #
> 
> # effective-user chrism
> 
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------
> 
>  
> As, they have said to change the effective-user directive in zope.conf, I changed the effective user part in the file as shown below –
> 
>  
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
> 
>  
> # Directive: effective-user
> 
> #
> 
> # Description:
> 
> #     If you intend to run Zope as the "root" user, you must supply this
> 
> #     directive with an effective username or userid number to which Zope
> 
> #     will 'suid' after the server ports are bound. This directive only
> 
> #     has effect under UNIX and if Zope is started as the root user.
> 
> #
> 
> # Default: unset
> 
> #
> 
> # Example:
> 
> #
> 
>     effective-user root
> 
>  
>  
> After changing the above file, When I started zope as root, it is showing the below error –
> 
>  
> [root at test bin]# ./zopectl fg
> 
> /opt/zope/bin/runzope -X debug-mode=on
> 
> 2010-11-19 21:19:47 INFO ZServer HTTP server started at Fri Nov 19 21:19:47 2010
> 
>         Hostname: 0.0.0.0
> 
>         Port: 8080
> 
> 2010-11-19 21:19:47 ERROR Zope Cannot start Zope with the effective user as the root user
> 
> Traceback (most recent call last):
> 
>   File "/opt/zope/lib/python/Zope2/Startup/run.py", line 56, in?
> 
>     run()
> 
>   File "/opt/zope/lib/python/Zope2/Startup/run.py", line 21, in run
> 
>     starter.prepare()
> 
>   File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 105, in prepare
> 
>     self.dropPrivileges()
> 
>   File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 256, in dropPrivileges
> 
>     return dropPrivileges(self.cfg)
> 
>   File "/opt/zope/lib/python/Zope2/Startup/__init__.py", line 449, in dropPrivileges
> 
>     raise ZConfig.ConfigurationError(msg)
> 
> ZConfig.ConfigurationError: Cannot start Zope with the effective user as the root user
> 
>  
>  
> Have I made any mistake in changing the effective user part in zope.conf ?
> 
>  
> Do you think I have done right? Or is this some other error?
> 
>  
> Also find attached the two files in which it is showing errors.  
> 
>  
> <run.zip><__init__.zip>_______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> https://mail.zope.org/mailman/listinfo/zope-db

-- 
ETH Zürich
Michele Marcionelli
IT Support Gruppe D-MATH
HG G 32.1
Rämistrasse 101
CH–8092 Zürich

michele.marcionelli at math.ethz.ch
http://www.math.ethz.ch/~michele

+41 44 632 6193 Telefon
+41 44 632 1354 Fax

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-db/attachments/20101119/02645bb1/attachment-0001.html 


More information about the Zope-DB mailing list