Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 10-02-2009, 05:21 PM   #1
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?


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

Rep: Reputation: 97
Just use su to make the executable run as a different user.
For example, if the command to run is:
command -o option --whatever &
You can run:
su - otheruser -c "command -o option --whatever &"
Old 10-02-2009, 08:31 PM   #3
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...


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 12:38 PM
init logs differently in RHEL 3 and RHEL 5 Jayasimha Linux - Enterprise 3 07-12-2008 07:23 AM
Centos 5 Init 5 not loading GUI silcf Red Hat 1 09-29-2007 12:47 PM
CentOS 4 (Fedora Core) init script - create PID file cejennings_cr Linux - Newbie 1 07-10-2006 09:22 AM
Is CentOS RHEL or RHEL Server? mikes63737 Linux - Distributions 1 02-28-2006 05:35 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:22 PM.

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