Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-31-2011, 02:27 PM   #1
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Rep: Reputation: 16
Can't seem to start daemon as another user

I want to start a daemon as another user, but it doesn't seem to work. What I'm trying to do is run svnserve (subversion server) as the apache user.

The following works, but it's run as the root user in this case
svnserve -d -r /var/www/svn --pid-file /var/run/
Trying to run as apache user doesn't work
su apache -c "svnserve -d -r /var/www/svn --pid-file /var/run/"
And neither does the following, with or without quotation marks
source /etc/rc.d/init.d/functions && daemon --user=apache "svnserve -d -r /var/www/svn --pid-file /var/run/"
At first I thought it was that the apache user doesn't have write permissions to /var/run (for, but that doesn't seem to be the problem because changing it to another directory also doesn't work.

(I'm trying to write my own init.d service script for svnserve, as in, because surprisingly svn server doesn't seem to come with its own.)

Any ideas on how I can make this work? Thanks.
Old 05-31-2011, 06:52 PM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 167Reputation: 167
I run svnserve out of inetd as the svnadmin user on Slackware. I think CentOS uses xinetd but you could adapt this if running that way suits:
svn stream tcp nowait svnadmin /usr/bin/svnserve svnserve -i -r /usr/local/svn


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suse init script: start daemon as different user. possible? BrianK SUSE / openSUSE 1 02-28-2011 02:34 PM
Start a daemon as general user bret1234 Linux - Newbie 2 09-09-2010 11:26 AM
start daemon as domain user jatrn Linux - Newbie 0 02-12-2010 12:21 PM
Bash script to verify the daemon is working if not, start the daemon kishoreru Linux - Newbie 7 09-23-2009 04:29 AM
start-stop-daemon: user `man' not found cccc Debian 4 03-06-2007 04:03 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration