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

Read-only iocStats databases #19

Open
stephAllison opened this issue Dec 2, 2016 · 3 comments
Open

Read-only iocStats databases #19

stephAllison opened this issue Dec 2, 2016 · 3 comments

Comments

@stephAllison
Copy link

stephAllison commented Dec 2, 2016

Some time ago (over a year!), J. Lewis Muir requested an option be added to the iocStats databases to prevent records that perform invasive actions (like reboot or load a new access security file) from being loaded. There are several ways to implement this but one way that seemed the least amount of work and the least changes to existing startup files is one recommended by Lewis - add a new macro that would be used like this:

$(RO_$(RO=NO),RO_YES=#,RO_NO=)record(sub, "$(IOC,undefined):SYSRESET")
$(RO_$(RO=NO),RO_YES=#,RO_NO=){
$(RO_$(RO=NO),RO_YES=#,RO_NO=)    alias("$(IOC,undefined):SysReset")
$(RO_$(RO=NO),RO_YES=#,RO_NO=)    field(DESC, "IOC Restart" )
$(RO_$(RO=NO),RO_YES=#,RO_NO=)    field(SNAM, "rebootProc")
$(RO_$(RO=NO),RO_YES=#,RO_NO=)    field(BRSV,"INVALID")
$(RO_$(RO=NO),RO_YES=#,RO_NO=)    field(L,"1")
$(RO_$(RO=NO),RO_YES=#,RO_NO=)}
==============

And set RO (Read Only) to YES to remove the record instance:

=== st.cmd ===
dbLoadRecords("$(DEVIOCSTATS)/db/iocAdminVxWorks.db","IOC=17lab,RO=YES")
==============

Or invert the sense of the macro to RW (Read Write), and I can set it to
NO.

(ANJ edited to format suggested changes better)

@anjohnson
Copy link
Member

Is "read-only/read-write" the best language to use to describe this feature? Without actually looking at the database the argument RO=YES tells me nothing about what it's purpose is — maybe something like SYSRESET=LOAD/SKIP?

BTW $(IOC,undefined) should be $(IOC) - the ,undefined part was probably inserted by MSI at some point in the past, it shouldn't be included in the original sources.

@ralphlange
Copy link
Member

Since there are more records in that group (Stephanie mentioned reloading access security definitions), SYSRESET is only gradually better than RO.
So ... next things would be INVASIVE=LOAD/SKIP or INCLUDEINVASIVE=YES/NO?

@anjohnson
Copy link
Member

I wasn't sure how many different groups there might be. Using a group name instead of a specific functionality would make it easier to use. One important question is probably whether the defaults should load everything ("useful"?) or just the "safe" records.

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

No branches or pull requests

3 participants