Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOC name inconsistencies with IOC manager #90

Closed
klauer opened this issue Aug 11, 2022 · 3 comments · Fixed by #86
Closed

IOC name inconsistencies with IOC manager #90

klauer opened this issue Aug 11, 2022 · 3 comments · Fixed by #86

Comments

@klauer
Copy link
Contributor

klauer commented Aug 11, 2022

There have been several cases to my knowledge of mismatched $(IOC) name compared to what IOC Manager has assigned as its ID.

This is a big problem since:

  • IOC manager will write log files and things to one directory
  • And ads-ioc will assume things are in another directory

This leads to confusion and potentially incorrect behavior in the end.

This is set here: https://github.com/pcdshub/IocManager/blob/fabc34c31e4fbb14c9d3b746474f42b3ef9e3688/startProc#L24
As part of the full process: https://confluence.slac.stanford.edu/display/PCDS/Detailed+Soft+IOC+boot+process#DetailedSoftIOCbootprocess-startProc

So we should be able to rely on $(IOC) being set for us externally. We could instead do:
epicsEnvSet("IOC", "$(IOC=iocname)")
to set a default in case it's being run without iocmanager (which can be useful in development/testing situations).

epics> epicsEnvShow GITHUB_USER
GITHUB_USER=klauer
epics> epicsEnvSet("GITHUB_USER", "$(GITHUB_USER=asdf)")
epics> epicsEnvShow GITHUB_USER
GITHUB_USER=klauer

and

epics> epicsEnvShow GITHUB_USER_A
GITHUB_USER_A is not an environment variable.
epics> epicsEnvSet("GITHUB_USER_A", "$(GITHUB_USER_A=asdf)")
epics> epicsEnvShow GITHUB_USER_A
GITHUB_USER_A=asdf

@ZLLentz
Copy link
Member

ZLLentz commented Aug 11, 2022

Oh this is annoying

Letting the ioc manager set the ioc name seems reasonable. I'm trying to figure out why this isn't an issue for other IOCs but I'm coming up blank. Usually this gets set to the directory name under iocBoot in ioc manager since this is how the ioc manager locates the st.cmd file. So we can possibly check the mismatch by comparing our iocname to the directory name? But this assumes things are being done the usual way (ioc path is /some/long/path/v1.0.0 and ioc name is set to the subdirectory name)

@klauer
Copy link
Contributor Author

klauer commented Aug 11, 2022

I think there's no way we can do the check, unless we shell out to an external script. There's no real control flow options in st.cmd after all

I put this in the PR: 184e609
I think ideally we'd want a verification that they match, but in the meantime deferring to IOC Manager to set it if possible seems good enough to me?

@ZLLentz
Copy link
Member

ZLLentz commented Aug 11, 2022

Yes, I think giving the IOC manager control makes the most sense.

@klauer klauer closed this as completed in #86 Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants