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. :) |
Hi,
which command do you use to start the service? |
When I'm in the program's folder, I type ./ventrilo_srv
|
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. |
This is where I am getting stuck at.
What do I do after typing @reboot ~/Vent/ventsrv/ventrilo_srv? Pic of my SSH |
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 |
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 |
you have to give the complete path to the script. please check the path using pwd command.
|
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. |
You may try adding a new service into chkconfig list by
Code:
chkconfig --add <service_name> Code:
chkconfig --list Code:
chkconfig --level <something i don't remember exactly, use "man chkconfig" to discover it> Good luck. |
All times are GMT -5. The time now is 01:44 PM. |