LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 03-16-2012, 12:37 AM   #1
dos_killer
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Rep: Reputation: Disabled
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
 
Old 03-16-2012, 03:21 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
Old 03-16-2012, 03:32 AM   #3
dos_killer
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
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 ?
 
Old 03-16-2012, 03:45 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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 &"
 
Old 03-18-2012, 11:27 PM   #5
dos_killer
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
thanks. It worked
 
  


Reply

Tags
startup



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
What should I add into my xorg.conf file to add a resolution? gannggstaz Linux - Desktop 2 09-30-2009 06:06 PM
Add programs to startup an_sush Linux - Newbie 6 07-05-2009 03:08 AM
how to add startup application ankitp LinuxQuestions.org Member Intro 1 08-05-2008 08:32 AM
Mandriva startup scripts (need to add something to startup before X starts) thunderweasel Mandriva 3 01-01-2006 12:55 AM
how to add this to startup? bahadur Linux - Networking 8 10-15-2005 04:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

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

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