LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-17-2006, 06:37 PM   #1
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Rep: Reputation: 30
creating a "stop" script for a ventrilo server


im trying to create a simplified start and stop scripts for my ventrilo server so i can just execute start.script or stop.script to do either(instead of typing anything)

to start the ventrilo server is simple

#!/bin/bash

cd /usr/local/ventrilo
./ventrilo_srv -d


but the only way in which i can stop the server is using the kill command. which in order to use it i need to know the pid of ventrilo, which is different each time its ran

the pid is kept in a file in the same location called ventrilo_srv.pid and its only content is the pid of the ventrilo server.

so somehow i need to make a stop script to figure out this number when its executed to stop the server... im not sure how to do this...
 
Old 08-17-2006, 06:55 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
You can use $(cat /usr/local/ventrilo/ventrilo_srv.pid) in the kill argument.

Just an example: kill -s SIGQUIT $(cat /usr/local/ventrilo/ventrilo_srv.pid)

I don't use this server or have it's documentation, so I couldn't tell you if SIGHUP is the best signal to send. For many services, sending SIGHUP ( The hangup signal ) will tell the server to reload its configuration file. For normal programs it will tell the program that the terminal is disconnected so it should quit.

A better solution would be to write a script that you can call with the arguments of start | stop | reload | restart. If you look at the init.d scripts, there should be a skeleton file that you can base it on. Then you could use ckconfig to have it start with you desired run modes. Also you would be able to enter something like:
"service ventrilo stop" to stop the service for example.

Last edited by jschiwal; 08-17-2006 at 07:04 PM.
 
  


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
bash script: using "select" to show multi-word options? (like "option 1"/"o zidane_tribal Programming 7 12-19-2015 01:03 AM
"creating symbolic link" "operation not permitted" wheni Linux - Newbie 3 05-08-2011 01:36 AM
Creating a "sound server" genderbender Linux - General 3 01-24-2006 03:20 PM
Can't install "glibmm" library. "configure" script can't find "sigc++-2.0&q kornerr Linux - General 4 05-10-2005 02:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:44 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