Yay. a question I can answer.
You don't need to be root as much as you need to have r/w permissions to all the directories that Trac will be working with. I'm sure there's plenty of contradictory evidence out there, but one of the better policies I've seen out there to deal with both subversion and trac is to create a special trac/svn user on the Linux box and have your Apache (or tracd) run as that user.
I ended up doing something similar to what you are doing, but I had the ability to add my account to the .sudoers list and was able to change the ownership of the appropriate directories so the user has the right permissions.
So you have 2 choices.
1) Either put your initial environment (and subversion repository) in a place where you (as the user running trac-admin initenv) have r/w permissions.
2) You get
your sysadmin/root user to set things up for you (i.e. create a group called trac-svn, give that group r/w permissions to the appropriate directories, and then add your user to that group). If you can get sudo privilege, root access, and/or know how to edit the /etc/group file to set up groups, use chown (to change file access privileges)
Good luck,
Vincent
"Yeu-Wen.Mak" <[EMAIL PROTECTED]> wrote:
Anyone can help me out here?
---------- Forwarded message ----------
From: Yeu-Wen. Mak <[EMAIL PROTECTED]>
Date: May 10, 2006 1:18 PM
Subject: Unable to initenv as a non-root user
To: [email protected]
Hi,
The error encountered is as follows.
---
[EMAIL PROTECTED] home]$ sudo -u trac trac-admin trac/environments/test initenv
Creating a new Trac environment at /home/trac/environments/test
Trac will first ask a few questions about your environment
in order to initalize and prepare the project database.
Please enter the name of your project.
This name will be used in page titles and descriptions.
Project Name [My Project]> Test
Please specify the connection string for the database to use.
By default, a local SQLite database is created in the environment
directory. It is also possible to use an already existing
PostgreSQL database (check the Trac documentation for the exact
connection string syntax).
Database connection string [sqlite:db/trac.db]> sqlite:db/test_trac.db
Please specify the absolute path to the project Subversion repository.
Repository must be local, and trac-admin requires read+write
permission to initialize the Trac database.
Path to repository [/var/svn/test]> /home/svn/repos
Please enter location of Trac page templates.
Default is the location of the site-wide templates installed with Trac.
Templates directory [/usr/local/share/trac/templates]>
Creating and Initializing Project
Configuring Project
trac.repository_dir
trac.database
trac.templates_dir
project.name
Installing default wiki pages
/usr/local/share/trac/wiki-default/CamelCase => CamelCase
/usr/local/share/trac/wiki-default/RecentChanges => RecentChanges
/usr/local/share/trac/wiki-default/SandBox => SandBox
/usr/local/share/trac/wiki-default/TitleIndex => TitleIndex
/usr/local/share/trac/wiki-default/TracAccessibility => TracAccessibility
/usr/local/share/trac/wiki-default/TracAdmin => TracAdmin
/usr/local/share/trac/wiki-default/TracBackup => TracBackup
/usr/local/share/trac/wiki-default/TracBrowser => TracBrowser
/usr/local/share/trac/wiki-default/TracCgi => TracCgi
/usr/local/share/trac/wiki-default/TracChangeset => TracChangeset
/usr/local/share/trac/wiki-default/TracEnvironment => TracEnvironment
/usr/local/share/trac/wiki-default/TracFastCgi => TracFastCgi
/usr/local/share/trac/wiki-default/TracGuide => TracGuide
/usr/local/share/trac/wiki-default/TracImport => TracImport
/usr/local/share/trac/wiki-default/TracIni => TracIni
/usr/local/share/trac/wiki-default/TracInstall => TracInstall
/usr/local/share/trac/wiki-default/TracInterfaceCustomization => TracInterfaceCustomization
/usr/local/share/trac/wiki-default/TracLinks => TracLinks
/usr/local/share/trac/wiki-default/TracLogging => TracLogging
/usr/local/share/trac/wiki-default/TracModPython => TracModPython
/usr/local/share/trac/wiki-default/TracNotification => TracNotification
/usr/local/share/trac/wiki-default/TracPermissions => TracPermissions
/usr/local/share/trac/wiki-default/TracPlugins => TracPlugins
/usr/local/share/trac/wiki-default/TracQuery => TracQuery
/usr/local/share/trac/wiki-default/TracReports => TracReports
/usr/local/share/trac/wiki-default/TracRoadmap => TracRoadmap
/usr/local/share/trac/wiki-default/TracRss => TracRss
/usr/local/share/trac/wiki-default/TracSearch => TracSearch
/usr/local/share/trac/wiki-default/TracStandalone => TracStandalone
/usr/local/share/trac/wiki-default/TracSupport => TracSupport
/usr/local/share/trac/wiki-default/TracSyntaxColoring => TracSyntaxColoring
/usr/local/share/trac/wiki-default/TracTickets => TracTickets
/usr/local/share/trac/wiki-default/TracTicketsCustomFields => TracTicketsCustomFields
/usr/local/share/trac/wiki-default/TracTimeline => TracTimeline
/usr/local/share/trac/wiki-default/TracUnicode => TracUnicode
/usr/local/share/trac/wiki-default/TracUpgrade => TracUpgrade
/usr/local/share/trac/wiki-default/TracWiki => TracWiki
/usr/local/share/trac/wiki-default/WikiDeletePage => WikiDeletePage
/usr/local/share/trac/wiki-default/WikiFormatting => WikiFormatting
/usr/local/share/trac/wiki-default/WikiHtml => WikiHtml
/usr/local/share/trac/wiki-default/WikiMacros => WikiMacros
/usr/local/share/trac/wiki-default/WikiNewPage => WikiNewPage
/usr/local/share/trac/wiki-default/WikiPageNames => WikiPageNames
/usr/local/share/trac/wiki-default/WikiProcessors => WikiProcessors
/usr/local/share/trac/wiki-default/WikiRestructuredText => WikiRestructuredText
/usr/local/share/trac/wiki-default/WikiRestructuredTextLinks => WikiRestructuredTextLinks
/usr/local/share/trac/wiki-default/WikiStart => WikiStart
Indexing repository
Failed to initialize environment. ("Can't open file '/home/svn/repos/format': Permission denied", 13)
Traceback (most recent call last):
File "/usr/local/lib/python2.3/site-packages/trac/scripts/admin.py", line 616, in do_initenv
repos = self.__env.get_repository()
File "/usr/local/lib/python2.3/site-packages/trac/env.py", line 162, in get_repository
repos = SubversionRepository(repos_dir, authz, self.log)
File "/usr/local/lib/python2.3/site-packages/trac/versioncontrol/svn_fs.py", line 192, in __init__
self.repos = repos.svn_repos_open( self.path , self.pool())
File "/usr/local/lib/svn-python/libsvn/repos.py", line 47, in svn_repos_open
return apply(_repos.svn_repos_open, args)
SubversionException: ("Can't open file '/home/svn/repos/format': Permission denied", 13)
Exception exceptions.AttributeError: "'SubversionRepository' object has no attribute 'log'" in <bound method SubversionRepository.__del__ of <trac.versioncontrol.svn_fs.SubversionRepository object at 0x4048862c>> ignored
[EMAIL PROTECTED] home]$
[EMAIL PROTECTED] home]$ sudo -u svn ls -al /home/svn/repos/
total 36
drwxr-xr-x 7 svn svn 4096 May 8 19:53 .
drwx------ 4 svn svn 4096 May 8 19:53 ..
drwxr-xr-x 2 svn svn 4096 May 8 20:23 conf
drwxr-xr-x 2 svn svn 4096 May 8 19:53 dav
drwxr-sr-x 5 svn svn 4096 May 8 22:59 db
-rwxrwxrwx 1 svn svn 2 May 8 19:53 format
drwxr-xr-x 2 svn svn 4096 May 8 19:53 hooks
drwxr-xr-x 2 svn svn 4096 May 8 19:53 locks
-rw-r--r-- 1 svn svn 229 May 8 19:53 README.txt
[EMAIL PROTECTED] rkendle]$ sudo -u trac groups
trac svn
---
So trac is a user in group svn who owns the fle "format". Have I missed something?
Thanks.
yeuwen
--
YeuWen
Mobile # +61418379261
http://blog.360.yahoo.com/makyw
The greatest use of life is to spend it for something that will outlast it.
- William James _______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac
Yahoo! Messenger with Voice. PC-to-Phone calls for ridiculously low rates.
_______________________________________________ Trac mailing list [email protected] http://lists.edgewall.com/mailman/listinfo/trac
