jl777 / libjl777

Other
17 stars 21 forks source link

[agents] Agent name should be equal to file name #19

Open blackyblack opened 9 years ago

blackyblack commented 9 years ago

When file name not equal to agent registered name agent cannot register in SuperNET.

Working call:

./BitcoinDarkd SuperNET '{"plugin":"SuperNET","method":"install","path":"/home/andrew/dev/snagentj/echodemo","daemonize":1,"timeout":5000}'

Not working call:

./BitcoinDarkd SuperNET '{"plugin":"SuperNET","method":"install","path":"/home/andrew/dev/snagentclj/run.sh","daemonize":1,"timeout":5000}'

It will be an issue for Windows users since filename should have extension to be executed (echodemo file does not start on Windows - echodemo.exe does)

blackyblack commented 9 years ago

More info here:

Not working path:

./BitcoinDarkd SuperNET '{"plugin":"SuperNET","method":"install","path":"/home/andrew/dev/snagentclj/run.sh","daemonize":1}'

In btcd logs:

call_SuperNET_JSON register.(echodemo) recv: {"requestType":"instances","instanceids":["14761106664701345456", "14761106664701345456"],"daemonid":"3597766287535","instanceid":"14761106664701345456"}

Trying to call method:

./BitcoinDarkd SuperNET '{"plugin":"echodemo","method":"echo","echostr":"test"}'

Answer:

{"error":"cant find plugin"}

If we rename run.sh to echodemo it is working fine.

jl777 commented 9 years ago

the name of the agent needs to match the internal name. so if renaming the file fixes this, maybe we can close this issue?

blackyblack commented 9 years ago

Windows requires file extension to execute it properly. So better not rely on filename to maintain compatibility with another OS.