This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
app-notes:cumulocity-agent-in-lxc-container [2017/02/08 10:20] – shasha | app-notes:cumulocity-agent-in-lxc-container [2017/02/08 11:09] – shasha | ||
---|---|---|---|
Line 4: | Line 4: | ||
[[http:// | [[http:// | ||
+ | ====Generate a new SSH public key==== | ||
+ | We need for the agent SSH. We create the key in the lxc container. | ||
+ | <code bash> | ||
+ | ssh-keygen | ||
+ | #The new key | ||
+ | cat / | ||
+ | #cp the key and go to the router and copy the key in this file | ||
+ | vi / | ||
+ | </ | ||
====Build the agent==== | ====Build the agent==== | ||
Now we need to make some installation. | Now we need to make some installation. | ||
Line 30: | Line 39: | ||
<code bash> | <code bash> | ||
cp Makefile.template Makefile | cp Makefile.template Makefile | ||
+ | </ | ||
+ | Add the Cumulocity agent to the SDK: | ||
+ | <code bash> | ||
+ | tar xvf netmoduleCumulocityAgent.tar | ||
+ | cd netmoduleCumulocityAgent | ||
+ | </ | ||
+ | Move the content of **src** folder to the **src** folders of the SDK. | ||
+ | <code bash> | ||
+ | cp src/* sdk_folder/ | ||
+ | cp include/* sdk_folder/ | ||
+ | #Copy also the srtemplate.txt | ||
+ | cp srtemplate.txt sdk_folder/ | ||
+ | </ | ||
+ | Edit the configfile (c8yAgent.conf) and move it. | ||
+ | <code bash> | ||
+ | cp c8yAgent.conf /etc/ | ||
+ | </ | ||
+ | Now we can build the agent. | ||
+ | <code bash> | ||
+ | make | ||
+ | |||
+ | #If you want, you can delete all and rebuild again: | ||
+ | make clean | ||
+ | make | ||
+ | </ | ||
+ | Now go to the **src** folder. | ||
+ | <code bash> | ||
+ | make | ||
+ | </ | ||
+ | <code bash> | ||
+ | ./main | ||
</ | </ |