LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do I run a startup script as a user other than root? (https://www.linuxquestions.org/questions/linux-software-2/how-do-i-run-a-startup-script-as-a-user-other-than-root-432914/)

Questor21 04-08-2006 12:35 AM

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. :)

d0odman 04-08-2006 12:52 AM

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.

btmiller 04-08-2006 12:52 AM

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.

Questor21 04-08-2006 10:05 AM

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?

Questor21 04-08-2006 11:51 AM

I had the su command backwards. Thanks!


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