// you’re reading...

CMS

Restarting RedDot CMS services without rebooting – Part II


As I love improving good ideas like the one to create a batch file for restarting the RedDot CMS server without rebooting it, which Fred had the other day here comes my enhancement. I talked to Kim Dezen about enhancing that solution for the RedDot CMS.

Restarting within RedDot CMS Server Manager

The script Fred provided works fine. But you need acces to the RedDot CMS Server via Remote Desktop or even have to sit in front of it. So Kim suggested a nicer solution would be the usage of a user defined job within the RedDot CMS. That saves a lot of time logging in to the system(or walking into the server room, in the other building 500 metres away). It’s quite easy to create a user defined Job inside the RedDot CMS Server Manager. Just a few steps to do that:

Create a “User-Defined Job” within RedDot CMS Server Manager

  1. log in, go to “Server Manager” > “Administer User-Defined Jobs” > “Jobs” > From “Action Menu” column to the right choose > “Create User-Defined Job”.
  2. Enter the details for the job, like name(”Restart Server”), RedDot CMS server, from which the script should be executed and make sure, that you”ve ticked the box “active”.
  3. Activate the checkbox saying “Call event controlled” and make sure, that you disable “Call periodically”. (Unless you want to restart your server for example every 15 minutes to annoy your editors just a little bit more than they might already be anyway..)
  4. From the radio button selection choose “External application” and enter the path to Freds nifty restart_reddot.cmd file. Make sure, that your path is in quotes, I didn’t think about that. And without the help of my Areeba colleague Paul Gibson I would still suffer from searching what causes the execution error. The RedDot CMS isn’t very helpful at this point to giving you a usable error message. (The error message here was just: “Result: The errorcode is 255. Error: “)
  5. Put in the data for the notification email and save all that stuff. That’s it.

(By the way, I like the way how things are solved easily over here in my new company. Great guys!)

Everybody with Server Manager rights can use it. Good idea? Bad idea?

What I thought after creating that was, that now everybody is able to use this nice RedDot CMS User defined Job. Well, nice, but sometimes people would be pleased to know who restarted their server during that tender presentation in front of a Fortune 500 CEO, right? Right.
So I tried to have a look at the log file for that job via RedDot CMS > “Server Manager” > “Administer User-Defined Jobs” > “Jobs” > “Restart Server” > And from the “Action Menu” column to the right choose > “View LogFile”.
And voila – now you can see: nothing. Ok, a popup opens and says “The XML page cannot be displayed”. Yeah, I wasn’t ready for that, that was totally unexpectable..
Right, so we have no ordinary logfile which just pops up and we could lean back and look for the suspect.
But I would like to have a logfile and the (only hypothetical, but still) raging project manager would like to have a name!

Sense of creating a logfile to log the RedDot CMS restart process

Sure, you can dig through the server logfiles, but everyone of us who had to that do once in his RedDot CMS developer or administrator career knows, it is not only painful it also takes ages. And a process like restarting the RedDot CMS servers services is not a too small thing to have a own logfile. For example in a running live environment with about 20 to 50 RedDot CMS editors – it could ruin a good amount of work time editors spent on their content. So here is

How to log these RedDot CMS restart processes by pushing the .cmd-file a bit further

The code below is a nice combination of the base provided by Fred, a windows command line date-creation script and some help of Paul to thin and optimise the whole thing a little bit(and debug it!).

CLS
@echo off
TITLE Restarting RedDot Services
echo.
   FOR /f "tokens=1-4 delims=/-. " %%G IN ('date /t') DO (call :s_fixdate %%G %%H %%I %%J)
   goto :s_print_the_date
   :s_fixdate
   if "%1:~0,1%" GTR "9" shift
   FOR /f "skip=1 tokens=2-4 delims=(-)" %%G IN ('echo.^|date') DO (
       set %%G=%1&set %%H=%2&set %%I=%3)
   goto :eof
   :s_print_the_date
   SET _log="C:Program FilesRedDotCMSASPPlugInsUserDefinedJobslog%yy%%mm%%dd%_RestartServer_log.txt"
echo ------------------------------------------------------------------------- >> %_log%
   echo. >> %_log%
   echo running restart script (www.reddotcmsblog.com) >> %_log%
   echo %date% - %time% -- Stopping services now >> %_log%
     echo y | net stop RdIiceService >> %_log%
::     echo y | net stop RDCMSStarterService >> %_log%
     echo y | net stop ObjectService >> %_log%
     echo y | net stop DataService >> %_log%
     echo y | net stop RDInteropService2 >> %_log%
   echo %date% - %time% -- All CMS services stopped. Restarting services now. >> %_log%
     echo y | net start RdIiceService >> %_log%
::     echo y | net start RDCMSStarterService >> %_log%
     echo y | net start DataService >> %_log%
     echo y | net start ObjectService >> %_log%
     echo y | net start RDInteropService2 >> %_log%
   echo %date% - %time% -- All CMS services restarted. Back to work, busy content bees. >> %_log%
echo ------------------------------------------------------------------------- >> %_log%
   ENDLOCAL&SET mm=%mm%&SET dd=%dd%&SET yy=%yy%

I think the RDCMSStarterService doesn’t need to be stopped, as it is stopped by default and set to “autromatic”. I think this service just starts the other ones.
Pretty self explaining, isn’t it? And now we get a nice log result everytime the RedDot CMS User-Defined Job will be executed. That doesn’t give us a name yet. But it tells us in a separate file for each day, the exact server time when the server has been restarted:

------------------------------------------------------------------------------
running restart script (www.reddotcmsblog.com)
Fri 20/03/2009 - 9:56:50.42 -- Stopping services now
The RedDot IICE Service service is stopping.
The RedDot IICE Service service was stopped successfully.
The RedDot Object Service service is stopping.
The RedDot Object Service service was stopped successfully.
The RedDot Data Service service is stopping.
The RedDot Data Service service was stopped successfully.
The RedDot RQL Service service is stopping.
The RedDot RQL Service service was stopped successfully.
Fri 20/03/2009 - 9:57:00.85 -- All CMS services stopped. Restarting services now.
The RedDot IICE Service service is starting.
The RedDot IICE Service service was started successfully.
The RedDot Data Service service is starting.
The RedDot Data Service service was started successfully.
The RedDot Object Service service is starting.
The RedDot Object Service service was started successfully.
The RedDot RQL Service service is starting.
The RedDot RQL Service service was started successfully.
Fri 20/03/2009 - 9:57:10.01 -- All CMS services restarted. Back to work, busy content bees.
------------------------------------------------------------------------------

That doesn’t give us a name yet, but the exact server time of our RedDot CMS engine to look up in the RedDot log and then the project manager can freak out – everybodie is happy. End of story.

File download

To DOWNLOAD the file. Click here and after that it would be nice, if you would DONATE here.

Share and Enjoy:
  • Print
  • email
  • Twitter
  • Digg
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • del.icio.us
  • MisterWong
  • Facebook
  • LinkedIn

No related posts.

About the author:

Markus Giesen Markus Giesen is a Solutions Architect and RedDot CMS Consultant, formerly based in Germany. Travelling around the world to find and offer solutions for a better world (in a very web based meaning). He just found a way to do this as part of a Melbourne based online consultant house. On this blog Markus shares his personal (not his employers) thoughts and opinions on CMS and web development. In his spare time you will find him reading, snowboarding or travelling. Also, you should follow him on Twitter!

Discussion

One comment for “Restarting RedDot CMS services without rebooting – Part II”

  1. What about the PageBuilder and XMLServer COM+ components?

    From time to time it is necessary to restart one or both of these as well.

    (e.g. when you “Clear Page Cache” from the project node, this actually clears the cache in memory in the running PageBuilder COM+ component, as well as in the file system)

    For some changes made to RDServer.ini, main.config, or other restarting one of these could be necessary.

    For changes made to the RedDotCMSServiceProcess.exe.config, restarting the RedDot Object service will always suffice as restarting this will end and start a new RedDotCMSServiceProcess.exe (which will put changes made to the .exe.config into effect)

    Posted by El Pollo Loco | April 5, 2009, 7:18 pm

Post a comment



Stay up to date! - Get notified about followup comments

If you don't feel the urge to comment but wish to stay in the loop:
Just enter your email and subscribe to new comments.

Subscribe without commenting

Recent Tweets

  • RT @AirKraft: Transport Canada breakout: they manage 80K pages and 300K assets with WSM(RedDot). Wow! #OTCW 2010-11-11
  • The RedDot usergroup session 'Future of WCM' is in National Harbor 7, now. See you there! #otcw 2010-11-11
  • RT @yttergren: @AirKraft: Calling all WSM(RedDot) devs: share your solutions on http://bit.ly/bgPIof EVERY solution can win an iPad #OTCW 2010-11-10
  • Come to the Solution Exchange session. Enhance your (#reddot) CMS project! Chesapeake 12, 3:20pm #otcw Looking forward to see you there! 2010-11-10
  • More updates...