I had a look at the manual of confd.conf, I set up <developerLogLevel>trace</developerLogLevel>, confdLog is enabled on file, and so are developerLog and errorLog.
They don’t show anything relevant to my error…
I also tried launching confd with confd --verbose --foreground, but no luck.
Sure it will. The developer log will show that your osCommand produced an error when it was executed.
And so now it is up to you to debug that error in your script from your command line for example.
My script logs to a file as soon as it’s called and takes 20-30 seconds to finish its execution. It really seems that confd cannot even find the script, even if I specify it by its absolute path and make it executable by all users.
Well, the output parameters output1/output2 don’t match the var1/var2 that you had in your YANG snippet, but that doesn’t explain the empty error and the script not being run at all… But maybe there are other differences - are you sure that you are updating, re-compiling, and restarting ConfD with, the right version of the module when you make changes? Can you run the ‘ping’ action in the intro/7-c_actions example? When I change the path in the YANG module there, I get the expected error in the CLI:
admin@mars% set config host localhost
[ok][2017-10-09 18:44:48]
[edit]
admin@mars% request config host localhost ping count 1
Error: /nowhere/ping.pl: No such file or directory
[error][2017-10-09 18:45:01]
I think it would be better if you actually (if possible) ran the example, to reduce the number of unknowns… I wonder if there is something wrong with your ConfD installation - tailf:exec actions are run via the program $CONFD_DIR/lib/confd/lib/core/confd/priv/cmdwrapper - does it exist and is executable?[quote=“rick_r, post:9, topic:1580”]
Can it be a permission problem? How do I declare that a given user or user group can execute actions?
[/quote]
There is nothing that needs to be “declared” for that. You can control it via the AAA/NACM rules just like everything else, but the defaults should not prevent running actions (and those rules don’t differentiate between action-as-callback and action-as-executable).[quote=“rick_r, post:9, topic:1580”]
What’s even more weird is that I just tried to run the action via netconf and I got “unknown element” error…
[/quote]
What exactly was the “unknown element” (this should be inciuded in the info)? It might just be that you need to set /confdConfig/netconf/capabilities/actions/enabled to “true”.
That was the way to go. With the help of strace, I looked at the system calls that are executed when I run my action and it turned out that I didn’t have the file child_setup in my installation of Confd.
I have a similar issue, how did you fix it exactly? I can’t find “child_setup” in the documentation, sorry.
Here is my attempt to run the action example:
ntc(config)# config host localhost
ntc(config-host-localhost)# commit
Commit complete.
ntc(config-host-localhost)# ping count 3 ?
Possible completions:
<cr>
ntc(config-host-localhost)# ping count 3
Error: ./ping.pl: No such file or directory
ntc(config-host-localhost)# ping
Error: ./ping.pl: No such file or directory
ntc(config-host-localhost)# end
ntc@ntc:7-actions$ make start
### Killing any confd daemon and ARP confd agents
/home/ntc/confd-install/bin/confd --stop || true
connection refused (stop)
killall `pgrep -f "python ./action.py"` || true
10353: no process found
/home/ntc/confd-install/bin/confd -c confd.conf --addloadpath /home/ntc/confd-install/etc/confd
### * In one terminal window, run: tail -f ./confd.log
### * In another terminal window, run queries
### (try 'make query' for an example)
### * In this window, the actions confd daemon now starts:
python ./action.py
register_done called
^C
Ctrl-C pressed