Tip #29 - Stop a Mongrel (or any) Service in Windows
Wed Dec 23 03:21:33 -0800 2009
If you are running a rails app on Windows Server (GASP) then you will run into the problem of how to restart your apps?
I had this problem when I had to deploy an app on a Windows server. It wasn’t a lot of fun, but it is possible, and the app is actually quite stable.
To restart a service, you need to talk to the Service Control Manager (SCM in windows). Windows Server provides a utility called “sc” which communicates and allows you interact with the SCM.
Say you installed your mongrel service and called it (unimaginatively enough) Mongrel_1. Well, you could type this and get the following data:
c:\WINNT> sc
This will give you all the help you need for the Service Control Manager.
But the simple style to stop a service called “Mongrel1” is:
c:\WINNT> sc stop Mongrel1
This will find the service called Mongrel1 and then sent a stop command to it. To find out what your services are called, go into the services control panel, right click on the Service you want to find the name of and then select properties, it will be listed under “Service name”.
You can do a bunch of other things with the sc command, restart services, start new ones, pause services and even change the config of the services (description etc). It is worth a look and gives you a good batch file way to start and stop services in windows.
Good luck! (and try to migrate away from windows for Rails as soon as you can :)
blogLater
Mikel
Leave a Reply
Latest posts
- Put your mailer where the action is!
- Why Force a Choice?
- How to make an RSS feed in Rails
- Rails 3 Routing with Rack
- Bundle me some Rails
- Helping out in Haiti
- Watch your self
- Is Rails 3.0 a Game Changer?
- Where did the scripts go?
- validates :rails_3, :awesome => true
- New Rails Version 3.0 Guides Online
- New ActionMailer API in Rails 3.0
- Mail gem version 2 released
- How to rename a Rails 3 Application
- Rails 3.0 Examples
- DECCA Driving Day
- Mail now merged into ActionMailer
- Ruby on Rails Tips Page
- Monitoring a DAHDI or Zaptel Channel
- Mail gets some compliments!
- Rails Unit Tests: uninitialized constant error
- New Mail gem released
- Mail and Bounced Emails
- Mail, TMail, The Future of Ruby Email Handling
- Custom Music on Hold for Asterisk
- Always getting an invalid authenticity token error
- Windows ipconfig does not show anything
- FreeBSD rc scripts
- How to monitor a logged in professional
- TMail Moves to GIT
- Funny...
- How to reset a sequence with PostgreSQL
- OpenBSD RAID and Temp Sensors on HP Proliant DL 360 and 380 Series
- Terminator - Timeout without Mercy
- Tip #28 - Separate the things that change from the things that stay the same
- Fortune...
- Examples of Behaviour Spec'n
- Tip #27 - Spec a Behaviour, Not an Implementation
- Tip #26 - Start Small
- Tip #25 - Logging is your friend...
- Tip #24 - Being clever in specs is for dummies
- Tip #23 - Know your fundamentals
- Convert Visual Basic / Microsoft Long Integer Color Values to CSS RGB Format
- It's amazing what you find...
- RSpec Story xhr problem
- Tip #22 - How to ask a question about Rails
- Tip #21 - Developer Info On Every Page
- And now for something completely different...
- Rails 2.1 is out
Latest comments
Tag Cloud
AJAX ARGH! ActiveRecord Ajax Apache Apple Asterisk Australia Copy Database Development Feedburner Gem server Google Human Rights Javascript L. Ron Hubbard MS SQL Server MacOSX Mail Mephisto Not Programming OpenBSD Opensource Performance Personal Integrity PostgreSQL Programming Prototype Puzzle RDoc REST RESTful Rails RSPec RSpec Rails Rails Tips Rspec Ruby Ruby on Rails Ruby on Rails Tips Ruby on rails Tips SQL SQLServer SVN Scientologist Scientology Site Stats Soekris Soekris net5501 TMail Textmate Tips Windows World about mikel anti drug apache contributing daemon documentation drugs illustrator javascript lambda mail mephisto newspapers nitro open source opensource photoshop productivity programming railscasts rspec ruby ruby on rails rubyforge scientology seo sitemap sqlserver tips tmail tom cruise unix tricks vector graphicsArchives
- November 2009 (1)
- October 2009 (2)
- September 2009 (2)
- August 2009 (0)
- July 2009 (1)
- June 2009 (0)
- May 2009 (1)
- April 2009 (0)
- March 2009 (0)
- February 2009 (0)
- January 2009 (2)
- December 2008 (0)
- November 2008 (5)
- October 2008 (0)
- September 2008 (1)
- August 2008 (0)
- July 2008 (2)
- June 2008 (13)
- May 2008 (7)
- April 2008 (18)
- March 2008 (8)
- February 2008 (5)
- January 2008 (7)
- December 2007 (20)
- November 2007 (22)

Tue Dec 22 07:07:51 -0800 2009
Hey, I think this one is unfinished :-)
Tue Dec 22 19:23:59 -0800 2009
Fixed now, thanks for the alert :)