Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

make changes in SYSTARTUP_VMS.COM without starting the system

 
SOLVED
Go to solution
smg_atlas
Frequent Advisor

make changes in SYSTARTUP_VMS.COM without starting the system

Hi

I am a unix/linux guy and have no exp working on OpenVMS 7.1.
When I run sh dev d:
I can notice that one of the disk is filling up.
As there are few database files getting copied to this disk with extension .rbf.

$1$DUA7: (HSD30) Mounted 0 DATDSK2 102357 1 2

Currently I have another disk:
$1$DUA1801: (HSD30) Mounted 0 DATDSK1
22352575 1 2

I was planning to point the backup to DATDSK1.

After going through the config.dvax01 file I got a clue about startup_vms.com file.

In that file I can see
$ define/system/exec rdb_backup_dir datdsk2:[rdb_backup]

which gives me a clue that by replacing datdsk2 with datdsk1 I can solve the problem.
But my next challenge is that I dont want to restart the system.
Is there any way I can make change to the startup_vms.com and execute without rebooting the system?

Any help much appreciated.
If I am wrong pls correct me or give me suggestions.

13 REPLIES 13
Richard Whalen
Honored Contributor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

You can make that change to the startup_vms.com file, then enter the command interactively to have it take effect immediately. There is no need to restart the system.
smg_atlas
Frequent Advisor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

so it means that I will have to create a directory in datdsk2 to be called rdb_backup or by just replacing datdsk2 with datdsk1 it will automatically create the directory rdb_backup if it doesn't exist.

$ define/system/exec rdb_backup_dir datdsk2:[rdb_backup]


Pls explain.

regrds,
smg_atlas
Frequent Advisor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

sorry I mean I need to create directory in datdsk1 same as datdsk2.

regards
Hoff
Honored Contributor
Solution

Re: make changes in SYSTARTUP_VMS.COM without starting the system

SYSTARTUP_VMS.COM is a part of the system startup processing that is reserved to you and to your local applications; to the system manager. It functions analogous to the init/rc scripts or launchd, and each of these allow you to invoke various tasks and operations when the system bootstraps.

To perform the changes "hot" (and avoid having to reboot the box), you can invoke the same commands that you would enter into SYSTARTUP_VMS.COM.

To create the logical name -- the logical name will likely be a completely foreign concept to you, as it has characteristics of an environment variable and some rather significant differences -- you can invoke the following two DCL commands:

$ set process/priv=(cmexec,sysnam)
$ define/system/executive -
rdb_backup_dir datdsk2:[rdb_backup]

You need only create the directories once, and not each time the system bootstraps.

The OpenVMS FAQ has a section "DCL Symbols and OpenVMS Logical Names?", which introduces the concepts:

http://64.223.189.234/node/1

For some info on wrinkles with symbols and logical names (and how logical names tie into the I/O stack), see topics including the following:

http://64.223.189.234/node/487
http://64.223.189.234/node/357

The HP OpenVMS manuals are at:

http://www.hp.com/go/openvms/doc

And the User's Guide and the System Manager's Manuals would be the usual starting point for most folks starting out learning about OpenVMS and OpenVMS system management.

Whether or not the directories are created automatically is something you'll have to look into locally. This is determined by the local applications. Some applications will create these, though most won't. I'd tend to assume not, and would create them.

You'll also want to set the ownership appropriately for what is writing into the directory. CREATE/DIRECTORY/OWNER=[uic] ... or SET DIRECTORY/OWNER=[uic] ... These DCL commands are analogous to chown, and SET PROTECTION is similar to chmod.

If you are not comfortable with DCL and with this environment, I'd encourage getting help from somebody that does, or getting access to a system to experiment with. This only because errors in the site-specific portion of the system startup can cause problems rather distant from when the change was made.

Stephen Hoffman
HoffmanLabs LLC
smg_atlas
Frequent Advisor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

Hi Stephen Hoffman

Thanks very much for some explanation.

I was just curious about the two commands you gave me.
$ set process/priv=(cmexec,sysnam)
$ define/system/executive -
rdb_backup_dir datdsk2:[rdb_backup]


besides changing the startup_vms.com file for datdsk2 to datdsk1.
I will make sure that I create a directory in datdsk1 as the same as datdsk2 RIGHT!
This startup_vms.com will only be effective once the system reboots RIGHT!
By also typing the two commands you gave me the backup should work on datdsk1 but what is the command :
$ set process/priv=(cmexec,sysnam)
used for?
Pls explain to me.


Regards,
Hoff
Honored Contributor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

// besides changing the startup_vms.com file for datdsk2 to datdsk1.
I will make sure that I create a directory in datdsk1 as the same as datdsk2 RIGHT! //

If your processing requires the directories, then create them. Do ensure the ownership and protection is set appropriately, as mentioned earlier.

// This startup_vms.com will only be effective once the system reboots RIGHT! //

What commands are included in SYSTARTUP_VMS.COM are invoked when the system boots. Again, akin to /init/rc scripts or other similar startup procedures from other platforms. All platforms have some analogous mechanism.

// By also typing the two commands you gave me the backup should work on datdsk1 but what is the command :
$ set process/priv=(cmexec,sysnam)
used for? //

It's akin to sudo and to typical root access. Privileges are a more finely-grained version of root access. Specific privileges grant access to specific areas and functions within OpenVMS.

See HELP SET PROCESS /PRIVILEGE, as a start.

The SET PROCESS /PRIVILEGE command enables the two specific privileges needed for the specified DEFINE command referenced. (SYSTARTUP_VMS is invoked with these and other privileges enabled.) Your username may or may not have these privileges; if the access to privileges is lacking within the current process and the SET PROCESS /PRIVILEGE fails to enable the privileges, you'll have to use a (more) privileged username to enable the privileges. This akin having the login listed in sudoers, for instance.

If you're working in this area and coming up to speed on OpenVMS, I'd suggest some time in the manuals, and an occasional look at the HELP library as needed. The HP OpenVMS manuals are here:

http://www.hp.com/go/openvms/doc/

The OpenVMS User's Guide and the System Manager's Manuals would be the usual starting point for folks seeking to learn more about OpenVMS and about OpenVMS system management.
smg_atlas
Frequent Advisor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

Hi Stephen Hoffman

I am working as user: system
I have already created the directory in datdsk1:[rdb_backup].
But when I do dir datdsk2:/rdb_backup] I can see the permissions on the files in rdb-backup directory.
How to check permissions on the directory?

regards,
Jon Pinkley
Honored Contributor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

No offense meant, but you really need to do some reading and understanding what you are reading before you start making changes.

If a nine year old asked you the following, how would you answer?

"I found this pistol and a box of cartriges in a my Dad's closet. I think the bullets go in this round thing that spins around. I put 6 cartriges in it. Then I pull back on this thing at the rear, but it seems stuck there now. I don't want my dad to know I've been messing with his stuff. How can I get this to go back where it was?"
it depends
Jon Pinkley
Honored Contributor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

"I am working as user: system"

Then be extra careful.

"I have already created the directory in datdsk1:[rdb_backup]."

Without knowing what command you used, the protection and ownership of that directory may not be what it should be.

"But when I do dir datdsk2:/rdb_backup] I can see the permissions on the files in rdb-backup directory.
How to check permissions on the directory?"

Directories are special files in VMS that have a type (extension) and version ".DIR;1".

The root directory of a device on VMS is called the MFD (master file directory), and it is in a special directory that contains itself. [000000]00000.DIR

To see the protection of the datdsk2:[rdb_backup]
directory, use the following command:

$ directory/security datdsk2:[000000]rdb_backup.dir

To set the protection and ownership of the directory you created to the same as the datdsk2:[000000]rdb_backup.dir directory, use the command:

$ SET SECURITY/LIKE=NAME=source_filename destination_filename /COPY=ALL

In your case:

$ SET SECURITY/LIKE=NAME=datdsk2:[000000]rdb_backup.dir;1 datdsk1:[000000]rdb_backup.dir;1 /COPY=ALL

For information about the set security command, see the output from

$ help set security

Now some other things you need to think about. What is going to happen to the files that are in the datdsk2:[rdb_backup] directory? Were you planning to move them to datdsk1? If you do that will the problem just move? What about things that go looking for things using the logical name rdb_backup_dir, which if you change it is now pointing to a totally different directory that (unless you make a copy of the files) won't have the original files.

One way to avoid that problem is to use what VMS calls a search list; a logical name that has a list of values. It is a bit like what a path environment variable does for executable files on unix, but it is more general.

For example, you could use the following definition of rdb_backup_dir to tell VMS that when it does a file lookup using the file specification rdb_backup_dir:abc.rbf, to first look in the new location, and if the abc.rbf file was not found there, to look in the original location. New files would normally be created in the first element of the list, but some software (for example editors) will create a new version a file in the same directory as it was found.

$ define/system/executive -
rdb_backup_dir -
datdsk1:[rdb_backup], - ! new files will go here
datdsk2:[rdb_backup] ! old files will be found here

This definition has less chance of breaking existing things than a single valued logical name definition that references only the new location.

And if you have a cluster, the logical name must be defined on each node.

Please, take some time to read some of the stuff that Hoff referenced, it will be time well spent.

Good luck,

Jon
it depends
Robert Gezelter
Honored Contributor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

smg_atlas,

While Hoff and Jon have made good comments, I will add one thought.

Make the changes to SYSTARTUP_VMS.COM and then use the editor to write a temporary file (e.g., X.TMP) containing the changed lines. Then execute this file from user SYSTEM with the appropriate privileges enabled (as a general principle, while I am disinclined to turn on all privileges without caution, I would in this case, as to mimic the environment when SYSTARTUP_VMS.COM is running), and run the snipped piece of code.

I have seen far too many instances of errors creeping into SYSTARTUP_VMS.COM. This acts as a guard, detecting many of those errors when the snippet is executed, rather than inconveniently at the next reboot.

- Bob Gezelter, http://www.rlgsc.com
Jon Pinkley
Honored Contributor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

Bob has extremely good advice.

In general you will not want to execute the complete vms_startup.com file at any time other than system startup (since it may do many things that are only appropriate at that time).

However, you do want to be sure that what you have added to the startup command file is correct.

So extracting just that part, and saving to a small command procedure is the best way to test that change.

I do that myself, because I have been surprised by typos that don't show up until the next reboot, which can be a long time from when the change was made.
it depends
Hoff
Honored Contributor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

Would you set up a user that was unfamiliar with bash and with commands including chmod and chown with root access on your production Linux server?

I'd certainly be inclined to avoid that.

For this case, I'd suggest getting access to a test server, and using it to practice and to test changes. To learn. To learn about DCL and syntax, about system management, and the related troubleshooting. Or a week or two of time in one of the available classes on OpenVMS, if that's how you prefer to learn.

Do spend some time in the manuals regardless. No matter how well anyone might know Linux or Unix, that knowledge does not map to OpenVMS commands and system management operations, and assuming similarities can often lead to frustration and even to failure. OpenVMS and Linux are very different beasts.

Within a production environment and operating with full privileges (root access), it is quite feasible to very seriously mess up an Rdb database with the wrong RMU command, or the wrong DCL command. In Linux terms, one errant rm -R / can ruin your whole day. And your whole production environment. OpenVMS has its analogous commands.

And a busted SYSTARTUP_VMS.COM is very low on the "System Breakage" scale.

System privileges on OpenVMS are root on Unix. The level of production damage that can be caused is entirely analogous.

(And we were all once newbies with bash or with DCL, and each of us was once dangerous with root or system privileges. And this whole system management area is the "deep end of the pool", regardless of the platform. Mistakes here can hurt.)
smg_atlas
Frequent Advisor

Re: make changes in SYSTARTUP_VMS.COM without starting the system

Thanks a lot! guys I really appreciate comments/commands.
ActuallY I am working in an environment where we monitor HP-UX/solaris/Linux systems. And one in a blue moon we have a customer with Openvms environment.
We dont have too much knowledge only except checking devices, memory , error logs.
Thanks very much once again.

regards,