Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 04-08-2006, 12:35 AM   #1
LQ Newbie
Registered: Apr 2006
Posts: 8

Rep: Reputation: 0
How do I run a startup script as a user other than root?

Running Slackware 10, I'm needing to run a startup script as a user other than root. Unfortunately I'm a n00b and I don't know how. Can anyone help me out here? Thanks.
Old 04-08-2006, 12:52 AM   #2
Registered: Sep 2004
Location: CA, USA
Distribution: Slackware 10.2
Posts: 132

Rep: Reputation: 15
What does your startup script do? Most of the major pieces of software have configuration files that start the main program as a non-priviledged user.
Old 04-08-2006, 12:52 AM   #3
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
You might try running it from rc.local with the command "su <user> -c '<script to run>'. In general you need to run it while su'ed to the user you want it to run as.
Old 04-08-2006, 10:05 AM   #4
LQ Newbie
Registered: Apr 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Thanks, I used the su syntax in rc.local. I never dreamed of the -c, that's cool.

I'm starting samba. Unfortunately, despite everything appearing to start normally, samba is clearly not in the process list.

/etc/rc.d/rc.samba, the /etc/samba (and all subdirectories and files), and /usr/sbin/smbd and /usr/sbin/nmbd are all have the correct permissions.

Any ideas?
Old 04-08-2006, 11:51 AM   #5
LQ Newbie
Registered: Apr 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I had the su command backwards. Thanks!


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
How to run startup script/daemon as a user other than root? Akhran Debian 2 02-04-2006 01:20 AM
allow sudo for www user to run root shell script cccc *BSD 12 07-23-2005 03:48 PM
How to run a Script as root, after Login as User, in GDM MHOOO Red Hat 14 03-08-2005 08:41 AM
how do I make sure that the user that is going to run the script is a root user??? nikold01 Linux - General 3 09-10-2004 07:54 AM
Startup service run by user other than root? WeNdeL Linux - Newbie 5 03-20-2003 02:57 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:18 AM.

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
Open Source Consulting | Domain Registration