LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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

Tags used in this thread
Popular LQ Tags , , ,

Reply
 
Thread Tools
Old 10-02-2009, 05:21 PM   #1
s2cuts
Member
 
Registered: Mar 2007
Posts: 47
Thanked: 0
init script, centos/rhel, lighttpd, specify user


[Log in to get rid of this advertisement]
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 08:35 PM.. Reason: solved
linuxpclinuxos s2cuts is offline  
Tag This Post , , ,
Reply With Quote
Old 10-02-2009, 06:57 PM   #2
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 204
Thanked: 14
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 &"
linuxcentos carltm is offline     Reply With Quote
Old 10-02-2009, 08:31 PM   #3
s2cuts
Member
 
Registered: Mar 2007
Posts: 47
Thanked: 0

Original Poster
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...
linuxpclinuxos s2cuts is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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
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


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

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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration