niekwoo10 Posted November 17, 2013 Report Share Posted November 17, 2013 I'm running a daemon on my server as root. How do I change the default permissions of new files to 766? Quote Link to comment Share on other sites More sharing options...
tuxpoldo Posted November 17, 2013 Report Share Posted November 17, 2013 DAEMON_UMASK=0011More Info in the initial posting Quote Link to comment Share on other sites More sharing options...
niekwoo10 Posted November 17, 2013 Author Report Share Posted November 17, 2013 DAEMON_UMASK=0011More Info in the initial postingOkay, here's the beginning of my config file://!/root/.btsync/btsync --config////DAEMON_UID=www-data//DAEMON_UMASK=0011{ "device_name": "Cubian", "listening_port" : 53, // 0 - randomize port/* storage_path dir contains auxilliary app files if no storage_path field: .sync dir created in the directory where binary is located. otherwise user-defined directory will be used*/// "storage_path" : "/home/user/.sync",// uncomment next line if you want to set location of pid file// "pid_file" : "/var/run/btsync/btsync.pid",For some reason it doesn't work. I think it's because the line is commented, but when I remove the comment I get an error. Quote Link to comment Share on other sites More sharing options...
tuxpoldo Posted November 17, 2013 Report Share Posted November 17, 2013 It must be commented. Read the initial posting. And it works. But there are some limitations: Files that are already present, will not be changed. You have to to change the old files manually. Only newly created files will be created based on the new UMASK The UMASK is only a mask (and not a mode). The default UMASK is typically 0022 - that means that all objects created with 666 will become 644 and all objects created with 777 will become 755. By default applications create files with 666 and directories with 777. This results by default in directories with 755 and files with 644. By setting the UMASK to 0011 you will get directories with 766 and files with 666 Quote Link to comment Share on other sites More sharing options...
niekwoo10 Posted November 23, 2013 Author Report Share Posted November 23, 2013 I have tried in numerous ways, but ps aux | grep btsyncstill shows it running as root. Quote Link to comment Share on other sites More sharing options...
tuxpoldo Posted November 23, 2013 Report Share Posted November 23, 2013 Your question was "How do I change the default permissions of new files to 766?" - not "How do I change the user under which credentials the daemon runs?" But I will give you good news: you will also find the answer to that question in the initial posting. Using DAEMON_UID=<username> was the right way to do it. One tip: you can find out more in the system log and also when starting manually the daemon with service btsync restart, if you uncomment the last line (the one with DAEMON_INIT_DEBUG) in the file /etc/default/btsync Quote Link to comment Share on other sites More sharing options...
niekwoo10 Posted November 23, 2013 Author Report Share Posted November 23, 2013 Thank you. When I started the topic I didn't follow your guide. I've reinstalled it and it's finally working Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.