LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 02-23-2011, 04:59 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
Suse init script: start daemon as different user. possible?


Redhat supplies /etc/init.d/functions. In that file, many shell script functions are provided, one of which is "daemon" which has an option of "--user" which allows a daemon to be started by a user other than root. daemon --user foo /path/to/program.

Is there an equivilent provided by Suse? I see /lib/lsb/init-functions which includes "start_daemon". start_daemon is a symlink to startproc, but the man page(s) shows that start_daemon only takes an argument of -p, whereas startproc takes, among others, a -u <uid> option, which is close to what I'm after, though not exactly.

At the end of the day, I'm trying to write an init script that will work on both RH and Suse. One of the features of the init script is the ability to run a daemon as a given username. Is start_daemon the best way to go for Suse? Is it acceptable use -u with it? Is there another way I can go about this so that I can provide a username rather than UID?

Suggestions? Thanks.
 
Old 02-28-2011, 02:34 PM   #2
SL00b
Member
 
Registered: Feb 2011
Location: LA, US
Distribution: SLES
Posts: 375

Rep: Reputation: 112Reputation: 112
We do this with sudo. The start command in your init script would look something like this:

/usr/bin/sudo -u userid /path/to/daemon_executable

Last edited by SL00b; 02-28-2011 at 02:43 PM.
 
  


Reply


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
start an user script at boot: Shall we prefer the INITTAB or /etc/init.d method ? frenchn00b Debian 1 01-21-2010 06:01 AM
Init script in /etc/init.d does not start at boot tdnnash25 Linux - Server 4 12-18-2009 04:40 PM
Bash script to verify the daemon is working if not, start the daemon kishoreru Linux - Newbie 7 09-23-2009 04:29 AM
Starting a daemon in an init.d bootup script without root being the owner BobTheSlob Linux - General 1 09-19-2007 11:19 AM
Run init script as daemon isuck@linux Linux - Software 5 02-12-2007 01:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 01:14 AM.

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