It's all about the answers!

Ask a question

RTC-SCM-CLI: how to detect whether a login is necessary before calling any CLI command ?


Karthikeyan Baskaran (45813) | asked Oct 10 '13, 8:08 a.m.
retagged Dec 13 '13, 11:31 a.m. by David Lafreniere (4.5k7)
I'm building a wrapper tool (C# .net) around the RTC SCM CLI
This wrapper tool calls lscm.bat (from RTC-scmTools-Win-4.0.3 installation)

These are the steps that are executed by the user of the wrapper tool:
  1. Execute login command
    • Internally, calls lscm.bat with login command (with appropriate username and password)
    • As lscm.bat is called for the first time, it launches "scm.exe" which continues to run even after termination of lscm.bat (I assume, this scm.exe is the daemon process that is explained in jazz.net. Please correct me if I'm wrong)
    • login command is successfully executed
  2. Execute "create stream" command
    • Internally, calls lscm.bat with "create stream" command (with appropriate arguments)
    • Stream gets created successfully from the account of the user who logged-in during step-1
  3. ....
  4. User continues to execute other commands of lscm.bat
  5. User executes logout command

Questions:

  1. Is there a possibility that the user might get automatically logged out during steps 2 to 4, in case if these steps are executed in longer intervals ? Say, the user executes step-2 today, but doesn't close the wrapper tool application, and doesn't shut down the PC, then executes step-3 one day later.
    • Internally, is there a timeout defined for automatic logout ?
    • if yes, how to detect this auto logout, so that login command can be issued before executing the actual command intended by the user in step 2 to 4 ?
    • if not, are there any other scenarios during which the user credentials might be lost ?

Thanks for your help in advance.

2 answers



permanent link
Shashikant Padur (4.1k27) | answered Oct 29 '13, 5:34 a.m.
JAZZ DEVELOPER
edited Oct 29 '13, 5:35 a.m.
If you have run the login command the username and encrypted password is stored in the {users home directory}/.jazzscm/repositories.txt file.

In case you server goes down or inaccessible or the license session has terminated or expired you will get the appropriate error. Once the server is operational/accessible/license available you do not have to rerun the login command. The command should work as the daemon already has the credentials. If the daemon was shutdown for some reason, the credentials will be picked up from the cached location.

Comments
Karthikeyan Baskaran commented Dec 11 '13, 5:47 a.m.

Thanks for the info.

1. In my local PC, under the user's home directory, I could find the ".jazz-scm" folder (please note the hyphen in between). But inside thls folder, I could not find the repositories.txt file. This .jazz-scm folder contains below sub folder tree.

.jazz-scm
|- configuration
   |- 4.0.5.0-RTC-I20131024-0100
       |- org.eclipse.core.runtime
       |- org.eclipse.equinox.app
       |- org.eclipse.osgi
       |- org.eclipse.update

2. Is this explanation applicable only for daemon (lscm.bat) or is it applicable even if I directly use scm.exe as well ? Will this scm.exe also pick up the credentials from this cached location ?

3. Is this cached location common for all clients (lscm.bat, scm.exe, web client, eclipse client, msscci client etc.,) ?

4. If I execute logout command from scm.exe, then will this cached location be cleaned up ?


Shashikant Padur commented Dec 11 '13, 6:14 a.m.
JAZZ DEVELOPER
  1. I don't think that is the right scm cli configuration directory. It should be at %LOCALAPPDATA%/jazz-scm or %APPDATA%/jazz-scm. If you have run the 'login' command then you should see the repositories.txt file. If you have run using --config option then you will find it in that directory.

    1. It is applicable to both lscm.bat and scm.exe. lscm.bat launches scm.exe in the background as a daemon process.

  2. The cached location is scm cli (lscm.bat and scm.exe) specific.

  3. Yes, logout command will clear the entry from repositories.txt file. You can run 'list credentials' command to see the cached credentials.

permanent link
Kevin Ramer (4.4k6164186) | answered Oct 18 '13, 4:41 p.m.
If you add the -n nickname to the scm login step and there after use nickname for the repository parameter, I would guess that the login lifetime would be impacted by

  1. License lease lifetime (for floating license)
  2. session limits set within the application server configuration


Comments
Karthikeyan Baskaran commented Oct 25 '13, 4:29 a.m.

Thanks for help.
I will check with my server admin for these session limits/license lifetime and get back.

Your answer


Register or to post your answer.