Hello !
If I am understanding your question correctly, I think the simple answer would be in the negative. It isn't strictly possible to print to the console directly
in an action or rule function triggered in reponse to a PUT operation. In iRODS' in-memory rulebase (unlike with rule files that are run from command-line)
there's no ready connection to a console device.
Of course, a couple of approaches might be possible to get around this:
- Manual: Split your terminal window using 'screen' or 'tmux'; and, in the other subwindow, do "tail -0f ~irods/log/rodsLog.*" or similar.
and override the core.py module's "acPostProcForPut(rule_args,callback,rei)", or import your rule via "from mymodule import *"
With the latter option, you have all the freedom offered by the Python interpreter, including - if you wish - including access to file and socket I/O and other IPC's. If you choose
to do it this way, make sure that any modules imported into core.py are writable only by the iRODS service account or Unix admin.
Also: look for future releases of iRODS to allow messages to be routed to syslog. You might then be able to use your own choice of a syslog parser to detect iRODS system events.
-Daniel Moore
Applications Engineer
iRODS Consortium
On Tuesday, December 11, 2018 at 2:20:42 PM UTC-5, P_Atreides wrote:
I was wondering how to create a rule that uses acPostProcForPut that writes a message to the console after a file is placed in a collection. I understand how to uncomment it the
core.re file and make it print to the rodsLog file, but how would I write a rule using it and then have a message printed to the screen when a file is put in irods, and what would be the syntax to invoke it from the command line using irule? Any help would be greatly appreciated.