Page 1 of 1

Servoy headless writing files as root

PostPosted: Tue Aug 23, 2011 5:00 pm
by Gordon
Hi

I am using Servoy Headless Client to write files from one server to another via a shared folder. The issues is that Servoy is using root privileges and hence the share will not recognise the written file. Is there a way to change the privileges Servoy is using for this process ?

Many thanks
Gordon

Re: Servoy headless writing files as root

PostPosted: Tue Aug 23, 2011 5:06 pm
by jcompagner
don't start servoy as root?

Re: Servoy headless writing files as root

PostPosted: Tue Aug 23, 2011 5:09 pm
by Gordon
Thanks - thats kinda logical !! :oops:

Re: Servoy headless writing files as root

PostPosted: Tue Aug 23, 2011 5:15 pm
by Gordon
jcompagner wrote:don't start servoy as root?


Hi Johan

I have just taken a look at the install and both the whole of the Servoy folder is marked as owner/group ubuntu. The app is started with this script

#!/bin/bash
cd /home/ubuntu/servoy_514/application_server

export LD_LIBRARY_PATH=/home/ubuntu/servoy_514/application_server/sybase_db
sybase_db/dbsrv11 @sybase_db/sybase.config
sleep 5
nohup ./servoy_server.sh &

SO I am not really sure where I have started it as root - however it certainly seems to be the problem.

Cheers
Gordon

Re: Servoy headless writing files as root

PostPosted: Wed Aug 24, 2011 8:50 am
by Gordon
The issue here was not in fact Servoy, it was where Servoy was writing files to.

The project requires Servoy to move streamed files from one server to another via a shared folder. The file therefore streams to the uploads folder in the servoy root directory and on completion the callback moves the file from there to /shared - this was the point where the file permissions were set to root rather than the expected ubuntu user. What we had not realised is that by placing them in /share we were intact instructing Linux to uplift their permissions to root and by moving /share to /home/ubuntu/share we corrected the issue.

What this now means is Servoy is able to stream video files to the server and on receipt move them to the Apache server for use with our mobile app.

Cheers
Gordon