LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   add file to startup (http://www.linuxquestions.org/questions/linux-desktop-74/add-file-to-startup-934719/)

dos_killer 03-16-2012 01:37 AM

add file to startup
 
Hi,
im running cvstrac on my server as its own server.
I have a script runcvstrac which i have put in the init.d directory and i created its symbolic link in rc5.d for it run at startup and it works fine
but the problem since its a forever running process so during boot time it just gets stuck there saying starting cvstrac server .
so basically the cvstrac server starts but then gets stuck becvause it cannot run another process.
Should i add it into some other run level ?
also i dont want the script to run as root but a normal user. SO what can i do
i am using Oracle linux 5 and it is a simple shell script with these two commands
cd /cvs/CVSROOT
cvstrac server 8008 /somepath

bathory 03-16-2012 04:21 AM

Hi,

Add a "&" at the end of your command so it starts and runs in the background.
Note also that you could put your script in /etc/rc.local, so it executes last when your system boots

Regards

dos_killer 03-16-2012 04:32 AM

thanks a lot for you help bathory...that solves one of my problems...
but the script still runs as root
i want it to run as a normal user
would a su username in the script solve the problem ?

bathory 03-16-2012 04:45 AM

Quote:

i want it to run as a normal user
would a su username in the script solve the problem ?
Yes, you can use something like:
Code:

su username -c "/cvs/CVSROOT/cvstrac server 8008 /somepath &"

dos_killer 03-19-2012 12:27 AM

thanks. It worked


All times are GMT -5. The time now is 01:06 PM.