LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 07-01-2008, 09:12 AM   #1
Flybye
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Rep: Reputation: 0
Question Making a service/process startup by itself?


Hi all, I'm in a bit of bind and am seeking help!

I really don't know much about linux, and this is beyond my scope. I just got a virtual Linux server, and need a program to start up automatically during reboot. The program is a Ventrilo server. The file is Vent/ventsrv/ventrilo_srv

I have been told there are 3 ways to make this startup automatically. A script, a cron job, or chkconfig. My host is recommending either a cron job or chkconfig.

The only thing I've been able to try:
chkconfig
In the first SSH window, I would start up ventrilo_srv. In a 2nd SSH window, I would login as root in order to be able to use the chkconfig --list command, but ventilo_srv is not listed.

cron
The instructions I've found online seem simple enough. I figured the command line would be as simple as:
@reboot Vent/ventsrv/ventrilo_srv

But I can't find a detailed step by step guide to get out of the cron editor and have it saved. Help on the best way to do this would be greatly appreciated.
 
Old 07-01-2008, 09:19 AM   #2
vishnu_sreekumar
Member
 
Registered: Jan 2006
Location: India
Distribution: Ubuntu, RHEL, Debian
Posts: 49

Rep: Reputation: 20
Hi,
which command do you use to start the service?
 
Old 07-01-2008, 09:33 AM   #3
Flybye
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
When I'm in the program's folder, I type ./ventrilo_srv
 
Old 07-01-2008, 09:43 AM   #4
vishnu_sreekumar
Member
 
Registered: Jan 2006
Location: India
Distribution: Ubuntu, RHEL, Debian
Posts: 49

Rep: Reputation: 20
since there isn't any init script to start the service, you cannot use the chkconfig method. You need to stick on to the cron job method

To edit the crontab use
# crontab -e

Now add the following line
@reboot ~/Vent/ventsrv/ventrilo_srv

Note: I assume that the script you use to start the service is in the given location under you home directory. So either use the "~" symbol or replace it with the complete path.
 
Old 07-01-2008, 10:06 AM   #5
Flybye
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
This is where I am getting stuck at.

What do I do after typing @reboot ~/Vent/ventsrv/ventrilo_srv?

Pic of my SSH
 
Old 07-01-2008, 10:10 AM   #6
vishnu_sreekumar
Member
 
Registered: Jan 2006
Location: India
Distribution: Ubuntu, RHEL, Debian
Posts: 49

Rep: Reputation: 20
sorry about that. save the file, and quit the editor.
press Esc, type :wq ( Seems like it is a vi editor)

Then restart crond using this command
service crond restart
 
Old 07-01-2008, 11:06 AM   #7
Flybye
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks! Almost there.

Another pic of my SSH

Now I just need to verify the directory. I rebooted the server and it did not start, so I'm almost sure it is a problem with the directory.

When I first logged in via SSH, and I did a DIR, I saw NOTHING. I had to create the directory public_html, and everything there is viewable by the public. Currently, when I log in via SSH and I do a DIR, I have listed Vent and public_html.

In my server's control panel, it states that my root is: /home/[user name]/public_html

Should I be putting this line in the crontab?
@reboot /home/[user name]/Vent/ventsrv/ventrilo_srv
 
Old 07-01-2008, 11:08 AM   #8
vishnu_sreekumar
Member
 
Registered: Jan 2006
Location: India
Distribution: Ubuntu, RHEL, Debian
Posts: 49

Rep: Reputation: 20
you have to give the complete path to the script. please check the path using pwd command.

Last edited by vishnu_sreekumar; 07-01-2008 at 11:15 AM.
 
Old 07-01-2008, 11:56 PM   #9
Flybye
LQ Newbie
 
Registered: Jul 2008
Posts: 5

Original Poster
Rep: Reputation: 0
I'll never understand tech support.

Now one of the guys emailed me telling me I should be using the chkconfig command and that I should access the /etc.init.d file.

How exactly do I get to that file as the root? When I login to the root, and DIR, I see nothing.

BTW, I did try the cron command, but it doesnt seem to be working. I also verified the exact directory.
 
Old 07-02-2008, 12:37 AM   #10
tungvs
Member
 
Registered: May 2008
Distribution: Centos; Ubuntu; Fedora
Posts: 98

Rep: Reputation: 15
You may try adding a new service into chkconfig list by
Code:
chkconfig --add <service_name>
then try this to see if the service appears
Code:
chkconfig --list
At last, use
Code:
chkconfig --level <something i don't remember exactly, use "man chkconfig" to discover it>
to make the service start automatically in specified runlevels.
Good luck.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Which process is making DNS queries? TruckStuff Linux - Networking 4 11-29-2005 05:05 PM
making a process last beyond a session Winter-Storm Linux - Newbie 6 11-10-2005 09:38 PM
Making a service as a system service Dakkar Suse/Novell 2 07-13-2005 08:36 AM
How to find which program/service/process touch the file? Raman_RB Linux - Security 2 11-01-2004 04:16 AM
Making a Mail Cluster service freelinuxcpp Linux - Networking 2 03-01-2004 04:44 AM


All times are GMT -5. The time now is 02:47 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration