#1  
Old 26th December 2008, 19:36
staticanime staticanime is offline
Member
 
Join Date: Jul 2008
Location: Dundalk, Ireland
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to staticanime Send a message via MSN to staticanime Send a message via Yahoo to staticanime Send a message via Skype™ to staticanime
Default simple shutdown script

Hey, I'm trying to make a script to be run by VirtualMin to stop my xbtt torrent tracker when the server is shutdown/restarted.

I have a script called stop-xbtt.sh and in it I have
Code:
#!/bin/sh
cd /home/xbtt/Tracker/
kill 'cat xbt_tracker.pid'
now, I can't get the kill 'cat xbt_tracker.pid' to work. All I wanted it to do is read the PID number in the xbt_tracker.pid (which works with cat) and pass it onto kill

PS. Server is Ubuntu 8.04
Reply With Quote
Sponsored Links
  #2  
Old 27th December 2008, 14:07
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,747 Times in 2,578 Posts
Default

Try
Code:
kill ´cat xbt_tracker.pid´
instead of
Code:
kill 'cat xbt_tracker.pid'
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 27th December 2008, 18:29
staticanime staticanime is offline
Member
 
Join Date: Jul 2008
Location: Dundalk, Ireland
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to staticanime Send a message via MSN to staticanime Send a message via Yahoo to staticanime Send a message via Skype™ to staticanime
Default

Yep, that worked like a charm, thanks Falko
Reply With Quote
  #4  
Old 21st January 2009, 15:40
stutch stutch is offline
Junior Member
 
Join Date: Dec 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How would I set this up if I wanted it to execute before the server is brought down automatically?
Reply With Quote
  #5  
Old 21st January 2009, 15:53
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,149
Thanks: 4
Thanked 56 Times in 52 Posts
Default

why not write a real initrd script and then add it to the default runlevels?
__________________
"Common sense is not as common as commonly believed" by sjau

Auto-Install Script for ISPConfig and Horde on a Vanilla Debian Stable

Need more Repos for Ubuntu? Repository Generator
Need more Repos for Debian? Debian Repository Generator
Reply With Quote
  #6  
Old 26th January 2009, 15:32
ebal ebal is offline
Member
 
Join Date: Aug 2007
Posts: 36
Thanks: 0
Thanked 2 Times in 2 Posts
Default

kill sends TERM signal so there is a possibility not to kill your process.

I use pkill command without knowing the PID of the process and after a sleep i use pkill -9 just to be sure.

something like this:

Code:
pkill apache
sleep 3
pkill -9 apache
__________________
http://ebalaskas.gr/wiki
Reply With Quote
  #7  
Old 1st March 2009, 00:04
sjau sjau is offline
Local Meanie
 
Join Date: Apr 2006
Location: Switzerland
Posts: 1,149
Thanks: 4
Thanked 56 Times in 52 Posts
 
Default

http://wiki.linuxquestions.org/wiki/Update-rc.d
__________________
"Common sense is not as common as commonly believed" by sjau

Auto-Install Script for ISPConfig and Horde on a Vanilla Debian Stable

Need more Repos for Ubuntu? Repository Generator
Need more Repos for Debian? Debian Repository Generator
Reply With Quote
Reply

Bookmarks

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
freebsd 7, samba 3, domain controller alexdimarco Suggest HOWTO 6 5th November 2010 17:54
Internet Explorer won't connect to my server wctaelectronics Server Operation 10 27th October 2008 22:14
Need help getting started simple simple shell script dhonnoll78 Programming/Scripts 1 18th December 2007 13:05
Need help writing simple copy script z3cka Programming/Scripts 3 26th August 2006 23:56
PERL script help... simple issue i think gjcomputer General 3 14th March 2006 10:49


All times are GMT +2. The time now is 22:42.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.