Go Back   Defender Hosting Forums > PowerVPS Virtual Private Servers > Linux VPS - General

Linux VPS - General General Discussion for Linux Virtual Private Servers based on Virtuozzo by SWsoft

Reply
 
Thread Tools Display Modes

  #1  
Old 04-14-2006, 01:55 PM
KingPooky
Guest
 
Posts: n/a
Default add program to startup?

I have a few programs I would like to run on startup, but I don't know much about Linux. Could someone explain to me how I could add a program to startup?

Thanks.
Reply With Quote

  #2  
Old 04-16-2006, 10:05 PM
charles charles is offline
Senior Member
 
Join Date: May 2004
Location: Virginia
Posts: 1,327
charles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud of
Default Re: add program to startup?

You can add a call to start it in /etc/rc.d/rc.local. But first check there is no service script in /etc/init.d ofr it (which you'd enable start with 'chkconfig servicename on').

charles
Reply With Quote

  #3  
Old 04-17-2006, 09:03 PM
KingPooky
Guest
 
Posts: n/a
Default Re: add program to startup?

How to I write the command for this? Here is what my file looks like right now:
Code:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

cd /path/to/file
./appname paramater

cd /path/to/file
./appname
Reply With Quote

  #4  
Old 04-17-2006, 11:01 PM
KingPooky
Guest
 
Posts: n/a
Default Re: add program to startup?

I've been reading a bunch of docs on rc.local, but I can't seem to get any of the commands to work. Is there a place I can go to check boot logs? It's hard for me to troubleshoot the problem when I don't know what it is, or even if the file is being executed at startup.
Reply With Quote

  #5  
Old 04-17-2006, 11:06 PM
charles charles is offline
Senior Member
 
Join Date: May 2004
Location: Virginia
Posts: 1,327
charles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud of
Default Re: add program to startup?

You'd enter exactly what you'd run on the commandline to launch it (assuming it runs as root). If you need to put it in the background, add a '&' at the end.

If you want to see if it's going to work , run 'sh rc.local'

charles
Reply With Quote

  #6  
Old 04-17-2006, 11:20 PM
KingPooky
Guest
 
Posts: n/a
Default Re: add program to startup?

Thank you for your help. I'm 100% sure the path is correct, but it says 'no such file or directory' when I run the file. When I type the exact same command at the command line, it runs perfectly fine. I'm stumped.
Reply With Quote

  #7  
Old 04-17-2006, 11:54 PM
charles charles is offline
Senior Member
 
Join Date: May 2004
Location: Virginia
Posts: 1,327
charles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud of
Default Re: add program to startup?

Quote:
Originally Posted by KingPooky
Thank you for your help. I'm 100% sure the path is correct, but it says 'no such file or directory' when I run the file. When I type the exact same command at the command line, it runs perfectly fine. I'm stumped.
You are not giving details so it's tough to help you, but typically this just means the program is not in your path. For example, 'service httpd restart' might work on the commandline because /sbin is in your path, but in a cron job or rc.local say, you'd need to use '/sbin/service httpd restart'.

hth
charles
Reply With Quote

  #8  
Old 04-18-2006, 12:10 AM
KingPooky
Guest
 
Posts: n/a
Default Re: add program to startup?

I have these two lines in my file:
. /usr/local/Unreal3.2/unreal start
. /root/services/services

Each works from the command line, but neither work in rc.local. The first line says I am not including the word "start", and the second line says no such file or directory.
Reply With Quote

  #9  
Old 04-18-2006, 01:20 AM
charles charles is offline
Senior Member
 
Join Date: May 2004
Location: Virginia
Posts: 1,327
charles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud ofcharles has much to be proud of
Default Re: add program to startup?

Remove the leading '. ' . If the second line still doesn't work, what does 'ls -l /root/services/services' give you?
Reply With Quote

  #10  
Old 04-18-2006, 01:28 AM
KingPooky
Guest
 
Posts: n/a
Default Re: add program to startup?

I tried the file with and without the leading . Both resulted in the same outcome:
Usage: unreal start|stop|rehash|restart|mkpasswd|version
: No such file or directory /root/services/services

When I run "ls-l /root/services/services" I get:
-rwxr-xr-x 1 root root 1527161 Aug 18 2005 /root/services/services
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find out if it's possible to add new accounts, programatically? tomfra Linux VPS - HOWTOs and FAQs 2 11-23-2006 02:48 PM
Logwatch Error soidog Linux VPS - General 2 07-09-2006 01:34 PM
Add smtp port (26) ? hagmund Linux VPS - General 2 05-18-2006 05:57 AM
Add new domain soidog Linux VPS - General 0 04-21-2006 10:59 PM
Affiliate / Referral program? Lance Pre-Sales Questions 11 09-14-2005 07:15 AM



All times are GMT -4. The time now is 11:53 PM.


vBulletin skin developed by: eXtremepixels
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright Defender Technologies Group, LLC 2006