LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   startup stuff (https://www.linuxquestions.org/questions/linux-newbie-8/startup-stuff-260190/)

st3reo 11-28-2004 12:57 PM

startup stuff
 
Hey,

How do I add to startup things that I want to run from a shell.
Cause what I add in rc.local is run as root. and I want some programs to run from a shell, and I want them to automaticly start in case of reboot.

Can anyone help?
Thanks

peacebwitchu 11-28-2004 01:17 PM

Use su user -c "script start"

st3reo 11-28-2004 01:30 PM

what do you mean by "script start"

could you detail a bit please?

peacebwitchu 11-28-2004 03:18 PM

If you want a script to be run as a different user at boot time make a script that executes a script. Here is how I execute vncserver as my user in Debian. Put this script in rc.local

vi vncscript

#! bin/bash
su myuser -c "vncserver -localhost"


:wq

chmod 755 vncscript

st3reo 11-28-2004 03:53 PM

I'm still not sure I understand :(

So I have an IRC server on a user and in case of reboot I want it to auto start
Usualy to start the server I have to go to /home/user/ircu2.10.11.07/ircd and there execute ./ircd

So how would a script that does that look..ot what do I have to do?

peacebwitchu 11-28-2004 05:08 PM

You could just add that line to rc.local

/home/user/ircu2.10.11.07/ircd/ircd

Or if this daemon can run as a different user you could make a simple script.
vi ircd.sh

#! /bin/bash

su user -c /home/user/ircu2.10.11.07/ircd/ircd


Then place this in /etc/rc.local
This is the most basic script. You can get as complex as you want.

st3reo 11-30-2004 06:07 AM

ok so I did that but it tells me this :

bash: /root/.bashrc: Permission denied

what did I do wrong? :/


All times are GMT -5. The time now is 03:13 AM.