Written by Lionel B. Dyck, Open Mainframe Project Ambassador and Contributor to CBT Tape
This article originally ran on the Dinoframe website. For more content like this, click here.
Introduction
Open Mainframe Project’s zopen community is an open source project where the community contributes ports of Linux tools. As of the time I’m writing this there are 231 repositories ranging from less to git to perl to curl to vim and neovim – well you get the idea. The zopen community can be found on GitHub so, for now, you’ll need to be able to access GitHub to use these tools.
If you want to experiment with these ported tools then you have to install them using their easy to follow Quick Start guide – note that since you probably don’t already have curl installed that you’ll have to use the alternate process which is equally easy.
Note: that git and curl and several other tools are included in the IBM Open Enterprise Foundation which you can read about here in a nutshell it is a no-charge package available with z/OS and installable via SMP/E and comes with full IBM support for all included tools. It will not be as current as the zopen community set of tools but it may suffice for your, and your companies, requirements.
Getting Started
The zopen community tools are installed in a UNIX System Services filesystem and it is highly recommended that you create a new ZFS for it. The reason for this recommendation is that to install the full compliment of the 231 repositories (some of which contain multiple tools) will require approximately 9,000 cylinders of z/OS disk space. My working ZFS is allocated at 12,000 cylinders to allow for growth. It is doubtful that your OMVS home directory filesystem will be large enough to contain this amount of data.
So you will need to allocate a ZFS for this purpose which means you must be able to allocate a z/OS ZFS dataset of an appropriate size. You may need to talk with your storage administrators or systems programmers before doing this (unless you are one of them).
Then the easy part is creating a mount point for the ZFS. If you are doing this for your own testing then you can create the mount point under your home directory, or you can use another location (again see the storage admins or sysprogs).
Before going further you need to check if you have “read access to the BPX.SUPERUSER resource in the Facility class”. This may require checking with your storage admins, sysprogs, or security admins. This is required to be able to mount the new ZFS using the techniques mentioned below. If you do not have this access then you will need to request from your storage admins or sysprogs that they update the BPXPRMxx member in the system PARMLIB to mount your ZFS once you have completed the steps below.
Allocation, Mount Point, Mount
Allocation
Once you know that you can allocate the new ZFS
issue a variation of the following command (be sure to change the hlq
to a valid high level qualifier):
zfsadm define -aggregate 'hlq.zopen.zfs' -volumes xxxxxx -cylinders 12000
See here for more information on the zfsadm define
options. You may not need to use -volumes
if you can specify a SMS class.
Next the ZFS
needs to be formatted so use this command (*be sure to change the hlq
):
zfsadm format -aggregate 'hlq.zopen.zfs'
Mount Point
A mount point
is just an empty directory in a filesystem. If this is just for your own testing and experimentation then create it under your home directory. If others will be using it then create it somewhere that you have other filesystems mounted (again check with your storage admins or sysprogs).
The command to make the mount point
is:
cd xxx
mkdir zopen
Where xxx
is either your home directory or where you want to create the directory.
Using a name of zopen
is suggested so that it is immediately recognized.
Mount
Now that you have the ZFS
and a mount point
it is time to mount the ZFS
so you can use it.
If you have access to the BPX.SUPERUSER
resource then you can issue these commands:
su
mount 'hlq.zopen.zfs' /xxx/zopen
exit
The su
enables superuser
and the exit
returns from that elevated state.
Action Be sure to change the hlq
to the high level qualifier used when creating the ZFS
and change the /xxx/
to point to where you created the mount point.
Note if you do not have superuser
capability then you’ll have to wait for your storage admins or sysprogs to do the mount after updating the system PARMLIB.
Installing zopen
Follow the instructions to install the zopen
tools.
Going Forward
The key point to deal with is that the ZFS
must be mounted so that it can be used. The options are:
- If you do not have
mount
authority because you do not have read access to theBPX.SUPERUSER
resource then your storage admins or sysprogs will have to add a MOUNT statement into the system PARMLIBBPXPRMxx
member that will cause the mount to occur after each system IPL. - Update your
.profile
to add these statements early on:
if mount | grep -q "/xxx/zopen" then
echo "Filesystem for zopen is mounted."
else
tsocmd "mount filesystem('hlq.zopen.zfs') mountpoint('/xxx/zopen/') type(zfs) mode(rdwr)"
echo "Filesystem for zopen is now mounted."
fi
. ./do-zopen
The reason for using tsocmd
is that it makes it easier to get into SuperUser state without using the su
command.
Action change the hlq
to the hlq
selected when the ZFS
is created.
The do-zopen
shell script is this set of code and assumes that it is working with the zopen
filesystem that is mounted under your home directory. (change as appropriate). The test for a .nozot
file is a way that you can bypass the zopen-config
configuration process for that shell session. Just issue a touch .nozot
to create the file and then logoff and back on again. Use a rm .nozot
to remove it when you don’t need to bypass the zopen-config
.
if [ -f .nozot ]; then
echo ' '
echo ".nozot file found so no zopen"
echo ' '
else
echo Starting zopen config
. ~/zopen/etc/zopen-config --override-zos-tools
echo Finished zopen config
fi
Note the –override-zos-tools is optional and instructs the configuration process to use the zopen community versions of tools instead of those that come with z/OS such as grep cat touch df and more. Just remove it if you want to use the tools that come with z/OS.
Learn more about zopen community here or join the Discord or LinkedIn page here.