Open rudderfeet opened 8 years ago
Please attach the error log. There is a cleanup, but at the moment t doesn't work as expected.
10x Tsvetan
+1
Same issues when my application runs as root. Files created by my application cannot be clean when I execute the second time. I have to change right "sudo chmod 777 -R
Great tip, thanks ericpinet. Tsvetan, will do, and thanks again for this really useful plugin. I wish I was more experienced with Eclipse plugins, as I'd be happy to help more directly.
An update - now that Raspbian Jesse comes with the user "pi" as a default member of "spi", "i2c" and "gpio", and those groups have permission to access the IO functions, there are even fewer reasons to run Pi4J code as root. Tonight I was able to uncheck the "Run java as root" option within my LaunchPi profile and deploy multiple times without issue. That's because my runtime logs weren't given root ownership - they were owned by "pi" and LaunchPi is cleaning up after itself in the .launchpi_projects directory nicely.
Tsvetan, my own issue is resolved, but if others HAVE to run their code as root, they may still experience the issue where remnants of a previous launch (like log files) may stick around. If there's any way for LaunchPi to clean up using root privs when "Run java as root" is checked, then that should take care of the issue. You'll just want to be really careful about what you delete with root privs. ;-)
I can reproduce the problem here with Eclipse Oxygen on the host and latest Rasbian Stretch on the PI.
I can only start the application a second time when I delete ".launchpi_projects/" after each run.
I can launch a Pi project using Run just fine, and the project stops when I terminate the program using Eclipse' "stop" button. However, attempts to relaunch the project fail until I manually delete the project directory on the Pi. I presume there are files (possibly app logs) that get created in there once the project runs as root, and there is probably a launchpi cleanup step that uses the under-privleged pi user.
I'll see if I can get my project to run without root or to alternatively write app logs to another place to avoid the problem. I'll update this issue with additional findings.