tsvetan-stoyanov / launchpi

Launch Raspberry PI Java applications from within Eclipse
Apache License 2.0
23 stars 3 forks source link

Can't launch Pi project a second time without manual deletion #23

Open rudderfeet opened 8 years ago

rudderfeet commented 8 years ago

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.

tsvetan-stoyanov commented 8 years ago

Please attach the error log. There is a cleanup, but at the moment t doesn't work as expected.

10x Tsvetan

ericpinet commented 8 years ago

+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 " before.

rudderfeet commented 8 years ago

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.

rudderfeet commented 8 years ago

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. ;-)

matthiasklein commented 6 years ago

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.