You are here: TWiki> Online Web>PVSSAutomaticStartupWindows (2010-06-10, gary)
Tags:
create new tag
, view all tags

Automatic startup of PVSS projects at boot time as a Windows Service

Configuration of Service + on control PC

To have PVSS projects started at boot time under Windows, please send a mail to Online Helpdesk: lbonsupp@cern.ch with the following information :

  • Name of the computer where the project[s] will run on
  • Name of the project[s]
  • Name of the Windows service ( usually the PVSS project name seems to be the best choice...) and a description for the service ( ie: Muon High Voltage side A)
  • If project config file is not in L:\localdisk\pvss\< PROJECT NAME >\config, provide its location ( but it should not be different if you follow the LHCb ECS Integration Guideline https://edms.cern.ch/file/732486/3/LHCb_ECS_Guidelines.pdf smile )
  • Tell us if your project need to start an OPC server, because in this case specific rights need to be granted to the account ( "group" operator ) from which service is started
  • If your project needs access to any shared drives, make sure to add '/C "L:\MapGforServices.bat"' into parameters in events in ServiceMill in the service properties. The bat script should contain mount directives ala 'net use G:\\smb\group /YES'

All projects should have manual startup for all UIs.

Starting-Stopping a Project run as a Windows service

ATTENTION: Since may 2010 it is no longer needed to use project-Stop services. All projects run as Windows services can be stopped using the usual stop command send to the service. PROJECT-STOP services are started to be removed, but unfortunately this new settings required a last stop with PROJECT-STOP service (or computer reboot).

Now the correct procedure to STOP-RESTART your PVSS project started as a service is :

  1. Stop the PROJECT service: It should take few second to complete depending of numbers of managers to stop.
  2. Start the PROJECT service: This should be done only when the Project has been successfully stopped.

Available tools for managing services are:

  • Windows services standard UI ( launch services.msc )
  • Service + UI
  • And from the command line:
    >net stop "Service Name" (ie: net stop MUHVA02 )
    >net start "Service Name" (ie: net start MUHVA02 ) ## Please wait for the full stop of the project before starting it again!

Attaching a PVSS UI to a project started as a service:

After logging to a control PC where a PVSS project is started as a service, you need to manually attach a PVSS UI to the running project. You can start PVSS Gedi by running:

C:\ETM\PVSS2\3.6\bin\PVSS00ui.exe -proj "PROJECT NAME"
or
C:\ETM\PVSS2\3.6\bin\PVSS00ui.exe -config "Path to config file"

Or you can start a specific panel with "-p" option:

C:\ETM\PVSS2\3.6\bin\PVSS00ui.exe -proj "PROJECT NAME" -p fwInstallation\fwInstallation.pnl (## You must provide the path to the panel starting from PVSS root ##)
to start the FrameWork installation tool

For all others options , try:

C:\ETM\PVSS2\3.6\bin\PVSS00ui.exe -help

Managing PVSS projects services from a script:

As per users request, a script has been created in order to query the status of PVSS project services and to start and/or stop several projects from the Windows command prompt of any Online computers.
The main goal of this script is to either query status, either start or stop the PVSS project service on several control pc but it also can be used to manage a single project.
Target projects and computers are defined into text file, used as first argument of the script.
It already exist files for Muon, Calo and Rich, plus a full list of all Service + projects. You can of course create you own file provided that your respect this syntax:
One projects per line with first Project service Shortname (could be different that real name) followed by computername, semicolon separated. ( Shortname can be find in service plus UI )
R1DAQL0;r1daq01w
R1MDMS;r1daq02w
R1DCS1;r1dcs01w
R1ECS;r1dcs01w
R1DCS2;r1dcs02w

This script is ManagingPVSSProjectasWinService.cmd and can be found into the shared file system: G:\online\scripts\PVSSProjMgnt
Text files with different lists of projects per subdetectors are also available there.

It can be run from any Windows computers in the Online network.
To get help on how it can be used, you can start it without arguments or with -h , --help or /?

G:\online\scripts\PVSSProjMgnt>ManagingPVSSProjectasWinService.cmd

"Usage: ManagingPVSSProjectasWinService.cmd File_name|single [Options]"

This script can be used to { query - start - stop } PVSS projects running as Windows services.
It required at least 1 argument.
The first argument is:
        A file name (include path if not in current directory) containing projects and computer names.
        File syntax is: 1 Project per line with first Project name, then computer name ,semicolon separated:
        MUSIDES;mudaqa01w
        The keyword: single to control only a single project.
        This keyboard required 2 mandatory arguments: First computer name ,then project name.
Options:
        start   To start Project[s] service[s].
        stop    To stop Project[s]  service[s].
        -h, -help, --help, /?   Show this help message and exit.
Examples:
"U:\>ManagingPVSSProjectasWinService.cmd U:\MyProjectsList.txt <start/stop>"
"U:\>ManagingPVSSProjectasWinService.cmd single mudaqa01w musides <start/stop>"


Consider the following example:
As Muon operator, you receive a mail from the Online that a maintenance will occurs and you have to stop all your PVSS projects started as service.
First you can check the status of the services on all Muon control pc:

G:\online\scripts\PVSSProjMgnt>ManagingPVSSProjectasWinService.cmd MuonServicePlusProjectsList.txt 
Project MUSIDES running on mudaqa01w    - status is:
        STATE              : 4  RUNNING
Project mudaqa01 running on mudaqa01w - status is:
        STATE              : 4  RUNNING
Project mudaqa23 running on mudaqa03w - status is:
        STATE              : 4  RUNNING
Project mudaqa45 running on mudaqa04w - status is:
        STATE              : 4  RUNNING
Project mudaqc01 running on mudaqc01w - status is:
        STATE              : 4  RUNNING
Project mudaqc23 running on mudaqc03w - status is:
        STATE              : 4  RUNNING
Project mudaqc45 running on mudaqc04w - status is:
        STATE              : 4  RUNNING
....

Then you can simply send a stop command to all projects services:

G:\online\scripts\PVSSProjMgnt>ManagingPVSSProjectasWinService.cmd MuonServicePlusProjectsList.txt stop


As shown in the help, it is also possible to manage a single project service by replacing the first argument file name with the keyword single.
In this mode 2 more arguments are mandatory: computer name and project service shortname.
And when required start or stop command can be sent to service.

For example if Muon operator want to stop only MUSIDES project on pc mudaqa01w:

G:\online\scripts\PVSSProjMgnt>ManagingPVSSProjectasWinService.cmd single mudaqa01w musides stop

Attention, in order to be able to manage PVSS projects services, you must be members of the correct groups. Thus Muon people can only manage Muon PVSS projects services.
In the case of an user try to manage other groups PVSS project service, this error message will then be displayed:

An error occured during batch processing, check batch arguments and user permisssions

This error message could be also displayed if batch arguments are wrong:
ie in case of errors in computer or service name, project not exist on associated computers,etc..

-- GaryMoine - 22 May 2008

-- Main.gary - 10 Jun 2010 : Addition of documentation for Project as service management script

Edit | Attach | PDF version | Print version |  | Raw View | Raw edit | Backlinks | History: r5 < r4 < r3 < r2 < r1 | More topic actions
Topic revision: r5 - 2010-06-10 - gary
 

TWIKI.NET
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback