LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 05-31-2011, 02:27 PM   #1
veeruk101
Member
 
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
Code:
svnserve -d -r /var/www/svn --pid-file /var/run/svnserve.pid
Trying to run as apache user doesn't work
Code:
su apache -c "svnserve -d -r /var/www/svn --pid-file /var/run/svnserve.pid"
And neither does the following, with or without quotation marks
Code:
source /etc/rc.d/init.d/functions && daemon --user=apache "svnserve -d -r /var/www/svn --pid-file /var/run/svnserve.pid"
At first I thought it was that the apache user doesn't have write permissions to /var/run (for svnserve.pid), 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 http://www.mygeekproject.com/?p=152, 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
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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:
Code:
/etc/inetd.conf
svn stream tcp nowait svnadmin /usr/bin/svnserve svnserve -i -r /usr/local/svn
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:43 PM.

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