VertrigoServがインストールされた環境に、redmine入れて、かつ、thinもインストールして、端末起動したらredmineがすぐ使えるようにサービス化してしまおう。と。
- Download details: Windows Server 2003 Resource Kit Toolsをインストール 。
- 以下のコマンドを実行
“C:\Program Files\Windows Resource Kits\Tools\INSTSRV.EXE” redmine_service “C:\Program Files\Windows Resource Kits\Tools\SRVANY.EXE”
The service was successfuly added!
Make sure that you go into the Control Panel and use
the Services applet to change the Account Name and
Password that this newly installed service will use
for its Security Context.
- レジストリに、以下のデータが追加される。
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\redmine_service]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,\
20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,\
00,73,00,20,00,52,00,65,00,73,00,6f,00,75,00,72,00,63,00,65,00,20,00,4b,00,\
69,00,74,00,73,00,5c,00,54,00,6f,00,6f,00,6c,00,73,00,5c,00,53,00,52,00,56,\
00,41,00,4e,00,59,00,2e,00,45,00,58,00,45,00,00,00
"DisplayName"="redmine_service"
"ObjectName"="LocalSystem"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\redmine_service\Security]
"Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00
- services.mscで見てみると、
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\redmine_serviceに、Parametersという名前のキーを追加する
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\redmine_service\Parametersに、Application、AppParameters、AppDirectoryという名前の文字列値を新規作成する
Applicationは、Ruby.exeのフルパス。例えば、C:\ruby\bin\Ruby.exe
AppParametersは、thinとthinに渡すパラメータ。例えば、c:\ruby\bin\thin start -p 4000 -e production
AppDirectoryは、redmineをインストールした場所。例えば、C:\public_html\redmine
- 最終的には、↓こんな感じに。 (redmine_serviceをエクスポートしたデータ)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\redmine_service]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,\
20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,\
00,73,00,20,00,52,00,65,00,73,00,6f,00,75,00,72,00,63,00,65,00,20,00,4b,00,\
69,00,74,00,73,00,5c,00,54,00,6f,00,6f,00,6c,00,73,00,5c,00,53,00,52,00,56,\
00,41,00,4e,00,59,00,2e,00,45,00,58,00,45,00,00,00
"DisplayName"="redmine_service"
"ObjectName"="LocalSystem"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\redmine_service\Parameters]
"Application"="C:\\ruby\\bin\\Ruby.exe"
"AppParameters"="c:\\ruby\\bin\\thin start -p 4000 -e production"
"AppDirectory"="c:\\redmine"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\redmine_service\Security]
"Security"=hex:01,00,14,80,90,00,00,00,9c,00,00,00,14,00,00,00,30,00,00,00,02,\
00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,\
00,00,02,00,60,00,04,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,\
05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,\
20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,\
00,18,00,fd,01,02,00,01,02,00,00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,\
00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00
と打ってみると、起動すると思います。(起動しない場合は、Application、AppParameters、AppDirectoryらへんの、パスが間違っているかもしれません。)