B4J Question [ABMaterial] Why tempjars has "root" as owner and not "pi"?

Cableguy

Expert
Licensed User
Longtime User
I am finally starting to run some test some "under-dev" ABMaterial samples and each time I re-upload the files to the Raspberry pi, using SFTP, I see that "tempjars" owned by "root" and not by "pi"... so I get a "permission denied" alert!
So when copying, at each "permission denied" alert, I just skip these files… (the 'myapp.core.min.xxxxx.css', 'myapp.xxxxx.css', 'myapp.xxxxxx.js' and 'index.html')
Is this ok?
 

Cableguy

Expert
Licensed User
Longtime User
Not using b4bridge at all... When I do, I get same kind of errors, even running it from root with sudo.
So I am just compiling in release and copying the files over using SFTP...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
When I do, I get same kind of errors, even running it from root with sudo.
You are probably missing some files that are not being copied by B4J-Bridge.

So I am just compiling in release and copying the files over using SFTP...
Make sure to use the correct SFTP user. The files will be owned by this user.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
What command do you use to start your ABMaterial application?
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
The usual "sudo Java -jar"
My question is not about running the jar but why some files have "root" as owner while other have "pi", which is the user logged in for SFTP
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
If the mentioned files are generated by ABMaterial then yes.
They are if in debug mode. I never "debug' run an app (I guess this is the tempjars?) but always compile it in release mode and then copy the final .jar, .needs and the whole www folder to the Pi.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
My question is not about running the jar but why some files have "root" as owner while other have "pi", which is the user logged in for SFTP
By running your jar file via sudo, you are running it as root and therefore any files generated by the your application are owned by root. What do you copy to your pi? Plus the thing @alwaysbusy mentioned (he out typed me).
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
always compile it in release mode and then copy the final .jar, .needs and the whole www folder to the Pi.
That is how I do it. Plus, I always rename the www folder and copy from anew.
So when copying, at each "permission denied" alert, I just skip these files… (the 'myapp.core.min.xxxxx.css', 'myapp.xxxxx.css', 'myapp.xxxxxx.js' and 'index.html')
Looking at an older www folder, it is interesting to see that the "myapp" files listed here are owned by root. For "sub" pages, those four files are owned by the user I used to copy the folder with. What is so special about the "myapp" files that they are regenerated, but the sup-pages are not?
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Hum.. I seem to have sprung an interesting discussion...

I too compile in release, at least, most of the time, but tried b4bridge and compiled in debug just to see things...
Still, even in release, those 4 files are the only ones the SFTP complains about and have indeed a different owner than any other project related file.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
1) Looking at my server, it looks like these 4 files are generated by running the application on the developer box in debug mode. Once copied to the production machine, they are somehow "touched" by the application (the release version/not debug version) upon (first startup?) in such a way that changes ownership w/o changing content (99.99% sure) nor the regular access date/time display. (Hope this made sense).

2) Renaming the www folder and uploading it works for me since I'm currently in testing phase. For production, this may not work, since upload folders may also be located there and recreating the www folder would also involve recopying the uploaded files.

3) Any uploaded files are also owned by root. Technically, root should only be necessary if the ABMaterial application uses a port below 1024 (it does in my case), otherwise it should be able to run as a user.

Hum.. I seem to have sprung an interesting discussion...
Yup
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
3) Any uploaded files are also owned by root. Technically, root should only be necessary if the ABMaterial application uses a port below 1024 (it does in my case), otherwise it should be able to run as a user.

I'm using port 80, using a no-ip as redirect to my raspberry. All needed ports are open in my router. Seeding the webapp is not an issue, just "uploading/updating" the webapp
 
Upvote 0
Top