I recently wrote this script for like the upteenth time, so now it is on bo.codeplex.com and in my BIN directory on Windows and in my sh directory on my Mac.
Note for the scripts in this post:
- on Windows you need to execute them with run as Administrator!
- on a Mac you need to run them with sudo
Windows
restart-InterBase.cmd:
net stop IBG_gds_db
net stop IBS_gds_db
net start IBG_gds_db
net start IBS_gds_db
It restarts only the default instance.
Usually it is enough to restart the Guarduan (IBG_gds_db), but sometimes that hangs, so I restart both the Guardian and the DB service (IBS_gds_db).
You can do the same with Firebird of course, and adapt for non-default instances: just find the right service names using a script like this:
sc query
then search the output for entries matching InterBase or Firebird like these:
SERVICE_NAME: IBG_gds_db DISPLAY_NAME: InterBase XE Guardian gds_db TYPE : 10 WIN32_OWN_PROCESS STATE : 4 RUNNING (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0 SERVICE_NAME: IBS_gds_db DISPLAY_NAME: InterBase XE Server gds_db TYPE : 10 WIN32_OWN_PROCESS STATE : 4 RUNNING (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0
Mac OS X
You can find the name of your Interbase service when you look at the user-installed services:
bash-3.2$ cd /Library/StartupItems/InterBase_gds_db/ bash-3.2$ ls -l total 16 -rwxr-xr-x 1 root wheel 636 Oct 21 15:44 InterBase_gds_db -rwxr-xr-x 1 root wheel 204 Sep 14 2007 StartupParameters.plist bash-3.2$ cat StartupParameters.plist { Description = "InterBase Server"; Provides = ("InterBase Database Server"); Requires = ("DirectoryServices"); Uses = ("Disks", "NFS"); OrderPreference = "None"; } bash-3.2$
You can restart the InterBase Database Server using this command:
sudo SystemStarter -vdD restart "InterBase Database Server"
The SystemStarter -vdD parameters make the output add verbose, debugging information and dependencies.
–jeroen