Question
Ben Spead · Feb 3

How to determine the UNIX user/group that InterSystems IRIS is running as?

(I wasn't able to find this in the docs or the Community, so feel free to point me to a reference that I missed)

How can I determine the effective User and Group that will be used when an InterSystems IRIS process is doing file I/O on the file system for UNIX?  Bonus points if you can tell me how to do it from within InterSystems IRIS as well as from the host OS.

Thanks!

0
0 222
Discussion (11)5
Log in or sign up to continue

From the OS side in AIX, I can see it in parameters.isc (example from a QA env I'm playing with)

security_settings.iris_user: irisusr
security_settings.iris_group: irisusr
security_settings.manager_user: irisusr
security_settings.manager_group: irisusr

I do not recall how to see it in IRIS itself (or if it's even possible) but I remember wanting to figure out how to change the values after installation (due to someone goofing up an entry on a dev environment) and without a lot of effort, it is pretty difficult.

Interesting question. I didn't see anything for this in the class reference either. I'll be following this post.

great way to do it within InterSystems IRIS - thanks Tim!

You could try:
ps -ax -o uname,cmd | grep "irisdb WD" | grep -v "grep"

-ax will get all the running processes including ones that aren't running on a terminal, retrieve the username, and command that started the process. We then use grep to filter out the exact process we need. 

Thanks @Jean Millette and @Timothy Leavitt for the help with this!
 

If you're doing file I/O, why not %File.GetOwnerGroup()? Or is this something you need to know before you open (or create) a file?

@Jeffrey Drumm - it is important to have this run from a process that is already running in the InterSystems IRIS instance (or something spun off from the SuperServer) so that it doesn't pick up your UNIX username if you enter via console.  So being able to run an API like Tim's will work nicely as I can run it via the Output window from Studio:

Understood ... but I'm curious as to how IRIS is getting my environment:

w ##class(%SYSTEM.Util).GetEnviron("USER")
jdrumm
w ##class(%SYS.ProcessQuery).GetOSUsername()
irisusr

No idea, but I don't think it's tied to the IRIS name.  When I am logged into Studio as bspead I see the following:

[quote]

w ##class(%SYSTEM.Util).GetEnviron("USER")
root
w ##class(%SYS.ProcessQuery).GetOSUsername()
cacheusr

[/quote]