serviceToggler


SourceForge Project Page | Download it now!

serviceToggler - What is it?
-----------------------------------------------------------------------------------------
serviceToggler is an application that allows the user to associate NT services on a
computer in to groups.  It allows the user to easily bring up and take down the groups
of services from a simple systray icon.  Additionally, groups of services can be setup
to toggle each other up and down.

For example, as a consultant developer, I am often asked to write applications (duh).
Sometimes the applications may use a MySQL database.  Other times, they may use a
MS SqlServer database.  I don't want to run both database servers on my laptop at the
same time, because usually I'm using one or the other, but not both.  In serviceToggler,
I've configured two service groups: MySQL and SQLServer.

The MySQL group has one service in it: the mysql database service.  The SQLServer group
has numerous services in it: SQL Server database service, SQL Server reporting server
service, etc.

From the systray icon of serviceToggler, I can select the SQLServer group.  It will
shutdown the MySQL service and bring up services associated with the SQLServer group.
Later on, I may choose to select the MySQL group from serviceToggler and it will shut
down the SQLServer services and bring up the MySQL service.

serviceToggler can be configured to use any number of service groups each can be
associated with another group to toggle with.  Groups don't have to be associated with
other groups for toggling, they can stand alone.  Selecting a group once from
serviceToggler brings it up.  Selecting it again, brings the group down.


Installation/Use
-----------------------------------------------------------------------------------------
serviceToggler is a python application.  In order to run it, you will need to install:

The Python interpreter (preferably 2.5) -> http://www.python.org/download/
The win32all library for Python         -> http://sourceforge.net/projects/pywin32/
The wxPython library for Python         -> http://www.wxpython.org/download.php#binaries

To run the application simply run the seviceToggler.py.  If you don't like the DOS box
coming up when running it, try renaming serviceToggler.py to serviceToggler.pyw.

I've included a setup.py script that, if you've installed the py2exe library for Python,
will allow you to "compile" the serviceToggler.py script into a windows executable.  This
can be accomplished by issuing the command:

	C:> python setup.py py2exe

This will result in a folder named "dist" being created on your hard drive.  It will
contain serviceToggler.exe and all the files necessary to run it.  It should be
xcopy installable at that point so long as you keep the supporting files with the .exe.

Or...

For those of you who don't want to mess with installing Python or hunting down the
required libraries, I've taken the liberty of running the py2exe "compiler" and have
placed the resulting executable and supporting files into the "binary" folder of this
package.  You should be able to just run at will.


Configuration
-----------------------------------------------------------------------------------------
serviceToggler reads a single config file named (wait for it...)serviceToggler.ini that
resides in the same folder as the .py script or .exe file, depending on how you
installed.

The config file is a simple layout.  In the [Groups] section you specify the number of
groups you'd like to set up.  This is done with the NumGroups entry.  Then you enumerate
them by name with GroupX entries.

After that you should create sections for each of the groups you've set up in the [Groups]
section.  Each group section needs to have at least a NumServices entry and 1 ServiceX
entry.  Optionally you can place a ToggleGroup entry in a service group section to
indicate what service you'd like this group to toggle with.  An example serviceToggler.ini
file might look like this:

	[Groups]
	NumGroups=3
	Group1=Microsoft Development
	Group2=Open Source Development
	Group3=Task Scheduler
	
	[Microsoft Development]
	ToggleGroup=Open Source Development
	NumServices=2
	Service1=W3SVC
	Service2=MSSQL$SQLEXPRESS
	
	[Open Source Development]
	ToggleGroup=Microsoft Development
	NumServices=2
	Service1=apache
	Service2=mysql
	
	[Task Scheduler]
	NumServices=1
	Service1=Schedule


License
-----------------------------------------------------------------------------------------
Copyright (C) 2008 Steve Brettschneider

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see .


Enjoy,
Steve

SourceForge.net Logo