Startup Tag^Routine property for UnknownUser
Hello community!
I am trying to set up Startup Tag^Routine
field for the UnknownUser as follows:
And my simple routine is the next:
Calling do ZitRoStart^ZitRo in the terminal prints "Hello"
, but when opening Caché Terminal it results with the next:
And the terminal closes.
// Cache for Windows (x86-64) 2016.2 (Build 636U) Wed Apr 13 2016 20:58:35 EDT
What am I doing wrong in setup?
Thank you very much!
I think this is the expected/designed behavior - when you log in as that user, that routine runs rather than giving you the typical terminal prompt. When the routine quits/ends, so does the terminal session.
Wow, thanks, I thought that this routine will just be executed before the terminal session start and then the normal terminal session will happen.
Do you know is it possible to achieve this behavior? Thank you!
LOGIN^%ZSTART could do the trick. See the documentation.
For example, put this in %ZSTART.mac:
Then, when you log in to terminal, you'll get:
If you wanted to make this a per-user setting, it'd take a bit more work, but would certainly be possible.
Nikita
The following example will cause your process to drop into programmer mode if it is set as the user's startup routine:
When a routine is specified as the user's startup routine the process starts in "application mode", sometimes referred to as a tied routine. Calling routine %SYS.PMODE forces the process into programmer mode if it was started in application mode.
George
George James Software
www.georgejames.com
Hi Nikita,
especially on a 'development mode' installation you need to be careful with messing with UnknownUser. UnknownUser is being used for many different things, and setting a startup routine like this would for example lock you out of the Management Portal. This is because in the default installation the CSP Gateway is using the UnknownUser to log into the instance. So you would have to set it up to use CSPSystem instead. George has already pointed out how to get the user into programmer mode after running any of your code. The more supported approach is what Tim told you.
Cheers,
Fab
Hi all,
Setting a startup routine like this can't lock non-terminal based Cache functionality (CSP, etc) as the routine is started on terminal kind of logins only, while I agree that LOGIN^%ZSTART should be sufficient in most cases. IMHO, this per user settings of startup routine in SMP comes from "the good old days" of terminal oriented apps which were often tied to terminals to prevent end users from entering MUMPS commands.
=
Cheers,
Alex