B4J Question JServer Log file limited permissions

avalle

Active Member
Licensed User
Longtime User
I have my B4J server app based on jServer running on a Linux Ubuntu 18.
The JAR is executed with the usual nohup command:
sudo nohup java -jar myServer.jar > nohup.out &

The Jetty Web server creates its "logs" folder where all the Web requests to the server are logged in daily files.
I have an issue with the file permissions: they get created with "rw-r-----" permissions.
The creator is root so my SSH client cannot read the files as it runs will non-admin permissions.

I'd like to change the permissions to "rw-r--r--" but I have no idea where this should be configured.
Note that the logs folder has generous permissions (rwxr-xr-x), so it does not seem like the permission set is inherited from the parent folder.

Thanks
Andrea
 

amykonio

Active Member
Licensed User
Longtime User
I believe this is an expected behaviour as you are running your command using sudo. The file is created under that command and will take the appropriate permissions. Nohup should use append to the output file. So I guess when your file exists (it should be created only when you first run your application) you can run a command like sudo chmod 744 <your file>.

Andreas.
 
Upvote 0

avalle

Active Member
Licensed User
Longtime User
Thanks for the suggestion but I'm talking about the log files generated daily by the Jetty server in the logs folder, not the nohup.out file which is ok
 
Upvote 0

avalle

Active Member
Licensed User
Longtime User
Good question... I thought it was required to run jServer apps with sudo. If I don't, and run the server using the ssh user (not admin) I get the following exceptions:

 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…