LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-02-2009, 04:21 PM   #1
s2cuts
Member
 
Registered: Mar 2007
Posts: 61

Rep: Reputation: 18
init script, centos/rhel, lighttpd, specify user


Hello all, I'm trying to write a simple init script for lighttpd on CentOS4. Not that I've done this before, I'm just reverse engineering another init script. However, and I can't seem to figure out how to get lighttpd to run under any user but root. Can someone give me a clue, or point me in the right direction?

Thanks.

Last edited by s2cuts; 10-02-2009 at 07:35 PM. Reason: solved
 
Old 10-02-2009, 05:57 PM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 697

Rep: Reputation: 93
Just use su to make the executable run as a different user.
For example, if the command to run is:
Quote:
command -o option --whatever &
You can run:
Quote:
su - otheruser -c "command -o option --whatever &"
 
Old 10-02-2009, 07:31 PM   #3
s2cuts
Member
 
Registered: Mar 2007
Posts: 61

Original Poster
Rep: Reputation: 18
Ok, I got to answering my own question.

The config file for lighttpd (lighttpd.conf) has parameters "server.username" and "server.groupname". When launching lighttpd in the init script with the daemon() function (or whatever your distro uses), these parameter values are used. Remember to make sure the the designated lighttpd user has permissions to all the places it needs to go, namely: root html directory, log files, etc...
 
  


Reply

Tags
daemon, init, lighttpd, script


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User access restriction in centOS 5 to run single script only. farhanzahidi Linux - Newbie 1 06-20-2009 11:38 AM
init logs differently in RHEL 3 and RHEL 5 Jayasimha Linux - Enterprise 3 07-12-2008 06:23 AM
Centos 5 Init 5 not loading GUI silcf Red Hat 1 09-29-2007 11:47 AM
CentOS 4 (Fedora Core) init script - create PID file cejennings_cr Linux - Newbie 1 07-10-2006 08:22 AM
Is CentOS RHEL or RHEL Server? mikes63737 Linux - Distributions 1 02-28-2006 04:35 PM


All times are GMT -5. The time now is 04:03 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration