Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

How to create clearcase shared views? #1384

buildmeister ·
Hi Robin,
I use the ClearCase repository to “Create View as Necessary from Config Spec”
The buildagent runs as a user with umask 0002.
But after the step Repository Checkout the view is private to the user who runs the buildagent.

The ClearCase manual page for mkview says:
“Your current umask(1) setting determines which users can access the
view. For example, a umask value of 2 allows anyone to read data in the
view, but only you (the view's owner) and others in your group can write
data to it--create view-private files, build derived objects, and so on.
If your umask value is 22, only you can write data to the new view.”

This kind of view supports excellently effective teamwork.
I want to provide my developer with this views.

How can I do this in QB?

Thanks in advance Leon
  • replies 9
  • views 4891
  • stars 0
robinshen ADMIN ·
Hi Leon,

Have you deleted the view and have QB create it again after you've modified the umask? If the view is still private after recreating, please run the build manually in debug mode, and then run the mkview command in the build log directly from command line to see if shared view can be created.

Regards
Robin
buildmeister ·
Hi Robin,
I run the build manually in debug mode

16:10:54,601 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Executing command: cleartool mkview -snapshot -tag shared_view /net/vob2/data/viewstore/shared_view
16:10:54,601 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Command working directory: /opt/quickBuild/buildagent/bin
16:10:55,357 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Created view.
16:10:55,357 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Host-local path: vob2.ger.magma.lan:/data/viewstore/shared_view/.view.stg
16:10:55,357 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Global path: /net/vob2.ger.magma.lan/data/viewstore/shared_view/.view.stg
16:10:55,357 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - It has the following rights:
16:10:55,357 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - User : vobadm : rwx
16:10:55,357 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Group: msoft : r-x
16:10:55,357 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Other: : r-x
16:10:55,564 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Created snapshot view directory "/net/vob2/data/viewstore/shared_view".
16:10:55,588 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Executing command: cleartool catcs -tag shared_view

and directly from command line

vobadm@vob2 [25] $ cleartool mkview -snapshot -tag shared_view /net/vob2/data/viewstore/shared_view
Created view.
Host-local path: vob2.ger.magma.lan:/data/viewstore/shared_view/.view.stg
Global path: /net/vob2.ger.magma.lan/data/viewstore/shared_view/.view.stg
It has the following rights:
User : vobadm : rwx
Group: msoft : rwx
Other: : r-x

Created snapshot view directory "/net/vob2/data/viewstore/shared_view".
vobadm@vob2 [26] $


You can see the different permissions for Group : msoft ...

Leon
robinshen ADMIN ·
Hi Leon,

The most probable reason is that the process running QB agent is still not using the umask you set. To verify, please stop build agent and start it from the command window where you created shared view successfully with below command:
<agent dir>/bin/agent.sh console

This makes sure that QB agent has the same environment as your command window. Then please delete the view and run a build manually again to see if shared view can be created.

Regards
Robin
buildmeister ·
This was my first idea too. But it doesn’t work.

09:00:47,178 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Executing command: cleartool mkview -snapshot -tag shared_view /net/vob2/data/viewstore/shared_view
09:00:47,178 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Command working directory: /opt/quickBuild/buildagent/bin
09:00:47,410 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Created view.
09:00:47,410 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Host-local path: vob2.ger.magma.lan:/data/viewstore/shared_view/.view.stg
09:00:47,410 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Global path: /net/vob2.ger.magma.lan/data/viewstore/shared_view/.view.stg
09:00:47,410 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - It has the following rights:
09:00:47,410 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - User : vobadm : rwx
09:00:47,411 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Group: msoft : r-x
09:00:47,411 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Other: : r-x
09:00:47,435 [master>cleartool update@vob2.ger.magma.lan:8811] DEBUG - Created snapshot view directory "/net/vob2/data/viewstore/shared_view".


Regards Leon
robinshen ADMIN ·
This is odd. Can you please add a step in QB to display current umask just before the checkout step?
buildmeister ·
Hi Robin,
umask is a shell builtin. So I can show it only indirect (touch x; ls -o x)

09:31:18,644 [master>show umask@vob2.ger.magma.lan:8811] INFO  - Running step...
09:31:18,963 [master>show umask@vob2.ger.magma.lan:8811] DEBUG - Executing command: touch x
09:31:18,963 [master>show umask@vob2.ger.magma.lan:8811] DEBUG - Command working directory: /opt/quickBuild/buildagent/bin
09:31:19,000 [master>show umask@vob2.ger.magma.lan:8811] DEBUG - Executing command: ls -o x
09:31:19,001 [master>show umask@vob2.ger.magma.lan:8811] DEBUG - Command working directory: /opt/quickBuild/buildagent/bin
09:31:19,028 [master>show umask@vob2.ger.magma.lan:8811] DEBUG - -rw-r--r-- 1 vobadm 0 Mar 17 09:31 x
09:31:19,042 [master>show umask@vob2.ger.magma.lan:8811] INFO  - show permissions : -rw-r--r-- 1 vobadm 0 Mar 17 09:31 x
09:31:19,042 [master>show umask@vob2.ger.magma.lan:8811] INFO  - Executing post-execute script...


Leon
robinshen ADMIN ·
Hi Leon,

This seems like a bug of JSW (a third party service wrapper): it ignores umask of current user and always uses the value 0022. We will contact JSW support to see if there is any quick workarounds.

Regards
Robin
robinshen ADMIN ·
Hi Leon,

It turns out that JSW resets the umask to always use 0022 by default. To use umask of "0002", please add the option "wrapper.java.umask=0002" to file "<agent install dir>/conf/wrapper.conf". This is how JSW works now and we are contacting them asking why it is not using umask of the user by default.

Regards
Robin
buildmeister ·
YaY! it works,


17:27:58,036 [master>show umask@vob1.ger.magma.lan:8811] DEBUG - Executing command: ls -o x
17:27:58,036 [master>show umask@vob1.ger.magma.lan:8811] DEBUG - Command working directory: /opt/quickBuild/buildagent/bin
17:27:58,063 [master>show umask@vob1.ger.magma.lan:8811] DEBUG - -rw-rw-r-- 1 vobadm 0 17. Mär 17:27 x
17:27:58,075 [master>show umask@vob1.ger.magma.lan:8811] INFO - show permissions : -rw-rw-r-- 1 vobadm 0 17. Mär 17:27 x
17:27:58,075 [master>show umask@vob1.ger.magma.lan:8811] INFO - Executing post-execute script...



17:27:58,743 [master>cleartool update@vob1.ger.magma.lan:8811] DEBUG - Executing command: cleartool mkview -snapshot -tag shared_view /data/viewstore/shared_view
17:27:58,743 [master>cleartool update@vob1.ger.magma.lan:8811] DEBUG - Command working directory: /opt/quickBuild/buildagent/bin
17:27:58,883 [master>cleartool update@vob1.ger.magma.lan:8811] DEBUG - Created view.
17:27:58,884 [master>cleartool update@vob1.ger.magma.lan:8811] DEBUG - Host-local path: vob1.ger.magma.lan:/data/viewstore/shared_view/.view.stg
17:27:58,884 [master>cleartool update@vob1.ger.magma.lan:8811] DEBUG - Global path: /net/vob1.ger.magma.lan/data/viewstore/shared_view/.view.stg
17:27:58,884 [master>cleartool update@vob1.ger.magma.lan:8811] DEBUG - It has the following rights:
17:27:58,884 [master>cleartool update@vob1.ger.magma.lan:8811] DEBUG - User : vobadm : rwx
17:27:58,885 [master>cleartool update@vob1.ger.magma.lan:8811] DEBUG - Group: msoft : rwx
17:27:58,885 [master>cleartool update@vob1.ger.magma.lan:8811] DEBUG - Other: : r-x
17:27:58,898 [master>cleartool update@vob1.ger.magma.lan:8811] DEBUG - Created snapshot view directory "/data/viewstore/shared_view".


thanks Leon