Skip to main content

I have a client that runs Universe processes from cron. They do it by running a shell script that changes to the desired Universe folder and then execute "uv SOME.COMMAND".  Universe starts up and runs that command. The problem is, it first runs the LOGIN proc so if there's a menu, it displays that and only runs the command when they exit.

They've gotten around that by checking to see if the user is running as root (which is how their cron jobs run) and going directly to TCL if that's the case. That works but has some issues.

Is there any way to start Universe in an account but tell it to not run the account logon procs? Alternatively, is there any way from a basic program to tell if Universe was started with a command line argument? When you run uv with a command, does it push it onto the stack? How does it all work?

I have a client that runs Universe processes from cron. They do it by running a shell script that changes to the desired Universe folder and then execute "uv SOME.COMMAND".  Universe starts up and runs that command. The problem is, it first runs the LOGIN proc so if there's a menu, it displays that and only runs the command when they exit.

They've gotten around that by checking to see if the user is running as root (which is how their cron jobs run) and going directly to TCL if that's the case. That works but has some issues.

Is there any way to start Universe in an account but tell it to not run the account logon procs? Alternatively, is there any way from a basic program to tell if Universe was started with a command line argument? When you run uv with a command, does it push it onto the stack? How does it all work?

Joe,

Set an environment variable and test it in the LOGIN paragraph. Either drop to TCL to run the executed command or continue the LOGIN as required.

As a general note, I would not recommend running as root and if this is commonly done you may encounter permission and ownership issues with files being inconsisent. If found, then please use chmod/chown as appropriate and chmod g+s on parent directories can be helpful in avoidanc.e

Regards

JJ


I have a client that runs Universe processes from cron. They do it by running a shell script that changes to the desired Universe folder and then execute "uv SOME.COMMAND".  Universe starts up and runs that command. The problem is, it first runs the LOGIN proc so if there's a menu, it displays that and only runs the command when they exit.

They've gotten around that by checking to see if the user is running as root (which is how their cron jobs run) and going directly to TCL if that's the case. That works but has some issues.

Is there any way to start Universe in an account but tell it to not run the account logon procs? Alternatively, is there any way from a basic program to tell if Universe was started with a command line argument? When you run uv with a command, does it push it onto the stack? How does it all work?

Hi John,

I'd prefer to not run things as root. Sadly its an old EDI application with no support and no source code for a lot of the underlying functions so we're stuck running a lot of things as root. 

Thanks for the advise. It's good advice. I wish I could take it.


I have a client that runs Universe processes from cron. They do it by running a shell script that changes to the desired Universe folder and then execute "uv SOME.COMMAND".  Universe starts up and runs that command. The problem is, it first runs the LOGIN proc so if there's a menu, it displays that and only runs the command when they exit.

They've gotten around that by checking to see if the user is running as root (which is how their cron jobs run) and going directly to TCL if that's the case. That works but has some issues.

Is there any way to start Universe in an account but tell it to not run the account logon procs? Alternatively, is there any way from a basic program to tell if Universe was started with a command line argument? When you run uv with a command, does it push it onto the stack? How does it all work?

Joe,

We are on a Windows server and do the same thing with Task Scheduler.  We kick off a scheduled task that runs a batch job.

 

C:
CD PATHTOACCOUNT
C:U2uvinuv "PHANTOM SOME.PROGRAM"

Then, in the LOGIN entry of VOC, we have the following to check for running as a phantom:

IF @TTY = 'phantom' THEN GO END.OF.LOGIN

...

END.OF.LOGIN:

Would something like that help you?  If you put the @tty check above where you call your menu, it would skip that and go right to TCL.  You shouldn't need to run as root.

Joseph


I have a client that runs Universe processes from cron. They do it by running a shell script that changes to the desired Universe folder and then execute "uv SOME.COMMAND".  Universe starts up and runs that command. The problem is, it first runs the LOGIN proc so if there's a menu, it displays that and only runs the command when they exit.

They've gotten around that by checking to see if the user is running as root (which is how their cron jobs run) and going directly to TCL if that's the case. That works but has some issues.

Is there any way to start Universe in an account but tell it to not run the account logon procs? Alternatively, is there any way from a basic program to tell if Universe was started with a command line argument? When you run uv with a command, does it push it onto the stack? How does it all work?

You mention a LOGIN proc, so I assume you are running a Pick or Reality (or unlikely IN2) flavor? 

There is a sequence of executable VOC entries that will be tried upon entering UV (like the LOGIN proc) that varies by account flavor. They include LOGIN, the tail of the account path, the account name, and the O/S level user ID  (including the Domain if on Windows). That provides a number of opportunities to avoid running the LOGIN proc. You can schedule the cron job for a particular user, and make an executable VOC entry of that user name. It will execute that first.

You can make two entries in the UV.ACCOUNT for the account path, say OriginalAccount ad NewAccount.  Starting in an account without the LOGIN proc, and issueing "LOGTO NewAccount" will try to execute NewAccount in that VOC in place of the LOGIN proc if it exists. So, NewAccount can be a simple VOC entry like "S" @FM "DISPLAY Hi", and then it will execute your "SOME.COMMAND". 

As long as the user logname has sufficient capabilities to run SOME.COMMAND, you should be all set. Note that running commands as root may have altered permissions on files or created new files that the user logname may not be able to access until adjustments are made.


I have a client that runs Universe processes from cron. They do it by running a shell script that changes to the desired Universe folder and then execute "uv SOME.COMMAND".  Universe starts up and runs that command. The problem is, it first runs the LOGIN proc so if there's a menu, it displays that and only runs the command when they exit.

They've gotten around that by checking to see if the user is running as root (which is how their cron jobs run) and going directly to TCL if that's the case. That works but has some issues.

Is there any way to start Universe in an account but tell it to not run the account logon procs? Alternatively, is there any way from a basic program to tell if Universe was started with a command line argument? When you run uv with a command, does it push it onto the stack? How does it all work?

Too bad UV doesn't have the UD @USER.TYPE variable - makes this pretty simple: