Is there a way to let an application create files with 664 permissions?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












This is a bit of a tricky issue and I am not sure where to ask this question.
Maybe someone tried something similar already and ran into a similar issue.



The following scenario:



I have a Seafile server 6.2.5 on an Ubuntu 16.04 RootServer --> cloud.example.com (seafile.com --> Opensoruce Cloud solution)



Inside my home network: A Helios4 NAS system with ARM processor and Openmediavault (OMV) is running with Samba shares and headless seaf-cli installed.



On the Helios4 a headless seaf-cli is running under the user “seafile”.



The Seafile Server cloud.example.com shares Library1.



The seaf-cli on the Helios4 syncs Library1 to a Samba share folder “Samba1”.



Samba1 is shared as read/write to the users seafile, user1 and user2.
The sync of Library1 works flawless. All files of Library1 are synced to Samba1.
A ls -l in Samba1 shows the permissions to be:




ls -l drwxr-sr-x 2 seafile users 4096 Apr 2 08:24 Folder1
-rw-r–r-- 1 seafile users 452334049 Mar 29 09:45 Movie1.MOV
-rw-r–r-- 1 seafile users 422486 Mar 29 10:42 Word.docx
-rw-r–r-- 1 seafile users 433303 Mar 14 17:46 Letter.pdf




If I access the files as user1 or user2 from a Mac inside the share Samba1 I can’t edit the files which were written by seaf-cli under user seafile, but can open/read them.



If I access the files as the user seafile from the same Mac inside the Samba1 then I can edit the files which were written by seaf-cli under user seafile. So can read/write.



The reason is that seaf-cli writes files with 644 permissions on user seafile.



So my question is like this:
Is there a way to let the seaf-cli application create all files with 664 permissions?
Then user1 and user2 could read/write in the samba share.



Help would be ver much appreciated ;-)



Greetings, Chris







share|improve this question




















  • According to the Seafile client changelog it should "Respect umask on Linux" since version 4.2.0 (although it's not clear to me whether there's an actual umask configuration setting, or whether you need to set the umask yourself when you start the process)
    – steeldriver
    Apr 27 at 22:28











  • Thanks already for your answer. I did quite a bit more googling this night and understood that what I need to do is to change the umask to 002. First time I looked at "umask", but seems generally pretty straight forward. I will check if I can set the umask in the seaf-cli config file and will post it here. There is a config that seafioe-cli calles during startup. But may I also ask how to to generally start processes with umask 002. So that I can understand the concept of starting applications with a different umask. Then this post would cover both scenarios.
    – StackChrisChris
    Apr 28 at 6:56










  • It seems the question remains the same: How can I set the umask myself when I start the process.
    – StackChrisChris
    Apr 28 at 14:44










  • How are you starting it? if it's via systemd, I think you should be able to add a UMask property e.g. UMask=0002 to the [Service] section of the unit file
    – steeldriver
    Apr 28 at 20:52










  • I am starting it with an unit.d script based on the description on this website: wp.yawc.de/2015/01/seafile-cli-autostart. I tried to add a —umask 002 after "su -c" inside the script and start the service with “sudo service deaf-cli start —umask 002” , which both did not work.
    – StackChrisChris
    Apr 29 at 23:18














up vote
0
down vote

favorite












This is a bit of a tricky issue and I am not sure where to ask this question.
Maybe someone tried something similar already and ran into a similar issue.



The following scenario:



I have a Seafile server 6.2.5 on an Ubuntu 16.04 RootServer --> cloud.example.com (seafile.com --> Opensoruce Cloud solution)



Inside my home network: A Helios4 NAS system with ARM processor and Openmediavault (OMV) is running with Samba shares and headless seaf-cli installed.



On the Helios4 a headless seaf-cli is running under the user “seafile”.



The Seafile Server cloud.example.com shares Library1.



The seaf-cli on the Helios4 syncs Library1 to a Samba share folder “Samba1”.



Samba1 is shared as read/write to the users seafile, user1 and user2.
The sync of Library1 works flawless. All files of Library1 are synced to Samba1.
A ls -l in Samba1 shows the permissions to be:




ls -l drwxr-sr-x 2 seafile users 4096 Apr 2 08:24 Folder1
-rw-r–r-- 1 seafile users 452334049 Mar 29 09:45 Movie1.MOV
-rw-r–r-- 1 seafile users 422486 Mar 29 10:42 Word.docx
-rw-r–r-- 1 seafile users 433303 Mar 14 17:46 Letter.pdf




If I access the files as user1 or user2 from a Mac inside the share Samba1 I can’t edit the files which were written by seaf-cli under user seafile, but can open/read them.



If I access the files as the user seafile from the same Mac inside the Samba1 then I can edit the files which were written by seaf-cli under user seafile. So can read/write.



The reason is that seaf-cli writes files with 644 permissions on user seafile.



So my question is like this:
Is there a way to let the seaf-cli application create all files with 664 permissions?
Then user1 and user2 could read/write in the samba share.



Help would be ver much appreciated ;-)



Greetings, Chris







share|improve this question




















  • According to the Seafile client changelog it should "Respect umask on Linux" since version 4.2.0 (although it's not clear to me whether there's an actual umask configuration setting, or whether you need to set the umask yourself when you start the process)
    – steeldriver
    Apr 27 at 22:28











  • Thanks already for your answer. I did quite a bit more googling this night and understood that what I need to do is to change the umask to 002. First time I looked at "umask", but seems generally pretty straight forward. I will check if I can set the umask in the seaf-cli config file and will post it here. There is a config that seafioe-cli calles during startup. But may I also ask how to to generally start processes with umask 002. So that I can understand the concept of starting applications with a different umask. Then this post would cover both scenarios.
    – StackChrisChris
    Apr 28 at 6:56










  • It seems the question remains the same: How can I set the umask myself when I start the process.
    – StackChrisChris
    Apr 28 at 14:44










  • How are you starting it? if it's via systemd, I think you should be able to add a UMask property e.g. UMask=0002 to the [Service] section of the unit file
    – steeldriver
    Apr 28 at 20:52










  • I am starting it with an unit.d script based on the description on this website: wp.yawc.de/2015/01/seafile-cli-autostart. I tried to add a —umask 002 after "su -c" inside the script and start the service with “sudo service deaf-cli start —umask 002” , which both did not work.
    – StackChrisChris
    Apr 29 at 23:18












up vote
0
down vote

favorite









up vote
0
down vote

favorite











This is a bit of a tricky issue and I am not sure where to ask this question.
Maybe someone tried something similar already and ran into a similar issue.



The following scenario:



I have a Seafile server 6.2.5 on an Ubuntu 16.04 RootServer --> cloud.example.com (seafile.com --> Opensoruce Cloud solution)



Inside my home network: A Helios4 NAS system with ARM processor and Openmediavault (OMV) is running with Samba shares and headless seaf-cli installed.



On the Helios4 a headless seaf-cli is running under the user “seafile”.



The Seafile Server cloud.example.com shares Library1.



The seaf-cli on the Helios4 syncs Library1 to a Samba share folder “Samba1”.



Samba1 is shared as read/write to the users seafile, user1 and user2.
The sync of Library1 works flawless. All files of Library1 are synced to Samba1.
A ls -l in Samba1 shows the permissions to be:




ls -l drwxr-sr-x 2 seafile users 4096 Apr 2 08:24 Folder1
-rw-r–r-- 1 seafile users 452334049 Mar 29 09:45 Movie1.MOV
-rw-r–r-- 1 seafile users 422486 Mar 29 10:42 Word.docx
-rw-r–r-- 1 seafile users 433303 Mar 14 17:46 Letter.pdf




If I access the files as user1 or user2 from a Mac inside the share Samba1 I can’t edit the files which were written by seaf-cli under user seafile, but can open/read them.



If I access the files as the user seafile from the same Mac inside the Samba1 then I can edit the files which were written by seaf-cli under user seafile. So can read/write.



The reason is that seaf-cli writes files with 644 permissions on user seafile.



So my question is like this:
Is there a way to let the seaf-cli application create all files with 664 permissions?
Then user1 and user2 could read/write in the samba share.



Help would be ver much appreciated ;-)



Greetings, Chris







share|improve this question












This is a bit of a tricky issue and I am not sure where to ask this question.
Maybe someone tried something similar already and ran into a similar issue.



The following scenario:



I have a Seafile server 6.2.5 on an Ubuntu 16.04 RootServer --> cloud.example.com (seafile.com --> Opensoruce Cloud solution)



Inside my home network: A Helios4 NAS system with ARM processor and Openmediavault (OMV) is running with Samba shares and headless seaf-cli installed.



On the Helios4 a headless seaf-cli is running under the user “seafile”.



The Seafile Server cloud.example.com shares Library1.



The seaf-cli on the Helios4 syncs Library1 to a Samba share folder “Samba1”.



Samba1 is shared as read/write to the users seafile, user1 and user2.
The sync of Library1 works flawless. All files of Library1 are synced to Samba1.
A ls -l in Samba1 shows the permissions to be:




ls -l drwxr-sr-x 2 seafile users 4096 Apr 2 08:24 Folder1
-rw-r–r-- 1 seafile users 452334049 Mar 29 09:45 Movie1.MOV
-rw-r–r-- 1 seafile users 422486 Mar 29 10:42 Word.docx
-rw-r–r-- 1 seafile users 433303 Mar 14 17:46 Letter.pdf




If I access the files as user1 or user2 from a Mac inside the share Samba1 I can’t edit the files which were written by seaf-cli under user seafile, but can open/read them.



If I access the files as the user seafile from the same Mac inside the Samba1 then I can edit the files which were written by seaf-cli under user seafile. So can read/write.



The reason is that seaf-cli writes files with 644 permissions on user seafile.



So my question is like this:
Is there a way to let the seaf-cli application create all files with 664 permissions?
Then user1 and user2 could read/write in the samba share.



Help would be ver much appreciated ;-)



Greetings, Chris









share|improve this question











share|improve this question




share|improve this question










asked Apr 27 at 21:25









StackChrisChris

114




114











  • According to the Seafile client changelog it should "Respect umask on Linux" since version 4.2.0 (although it's not clear to me whether there's an actual umask configuration setting, or whether you need to set the umask yourself when you start the process)
    – steeldriver
    Apr 27 at 22:28











  • Thanks already for your answer. I did quite a bit more googling this night and understood that what I need to do is to change the umask to 002. First time I looked at "umask", but seems generally pretty straight forward. I will check if I can set the umask in the seaf-cli config file and will post it here. There is a config that seafioe-cli calles during startup. But may I also ask how to to generally start processes with umask 002. So that I can understand the concept of starting applications with a different umask. Then this post would cover both scenarios.
    – StackChrisChris
    Apr 28 at 6:56










  • It seems the question remains the same: How can I set the umask myself when I start the process.
    – StackChrisChris
    Apr 28 at 14:44










  • How are you starting it? if it's via systemd, I think you should be able to add a UMask property e.g. UMask=0002 to the [Service] section of the unit file
    – steeldriver
    Apr 28 at 20:52










  • I am starting it with an unit.d script based on the description on this website: wp.yawc.de/2015/01/seafile-cli-autostart. I tried to add a —umask 002 after "su -c" inside the script and start the service with “sudo service deaf-cli start —umask 002” , which both did not work.
    – StackChrisChris
    Apr 29 at 23:18
















  • According to the Seafile client changelog it should "Respect umask on Linux" since version 4.2.0 (although it's not clear to me whether there's an actual umask configuration setting, or whether you need to set the umask yourself when you start the process)
    – steeldriver
    Apr 27 at 22:28











  • Thanks already for your answer. I did quite a bit more googling this night and understood that what I need to do is to change the umask to 002. First time I looked at "umask", but seems generally pretty straight forward. I will check if I can set the umask in the seaf-cli config file and will post it here. There is a config that seafioe-cli calles during startup. But may I also ask how to to generally start processes with umask 002. So that I can understand the concept of starting applications with a different umask. Then this post would cover both scenarios.
    – StackChrisChris
    Apr 28 at 6:56










  • It seems the question remains the same: How can I set the umask myself when I start the process.
    – StackChrisChris
    Apr 28 at 14:44










  • How are you starting it? if it's via systemd, I think you should be able to add a UMask property e.g. UMask=0002 to the [Service] section of the unit file
    – steeldriver
    Apr 28 at 20:52










  • I am starting it with an unit.d script based on the description on this website: wp.yawc.de/2015/01/seafile-cli-autostart. I tried to add a —umask 002 after "su -c" inside the script and start the service with “sudo service deaf-cli start —umask 002” , which both did not work.
    – StackChrisChris
    Apr 29 at 23:18















According to the Seafile client changelog it should "Respect umask on Linux" since version 4.2.0 (although it's not clear to me whether there's an actual umask configuration setting, or whether you need to set the umask yourself when you start the process)
– steeldriver
Apr 27 at 22:28





According to the Seafile client changelog it should "Respect umask on Linux" since version 4.2.0 (although it's not clear to me whether there's an actual umask configuration setting, or whether you need to set the umask yourself when you start the process)
– steeldriver
Apr 27 at 22:28













Thanks already for your answer. I did quite a bit more googling this night and understood that what I need to do is to change the umask to 002. First time I looked at "umask", but seems generally pretty straight forward. I will check if I can set the umask in the seaf-cli config file and will post it here. There is a config that seafioe-cli calles during startup. But may I also ask how to to generally start processes with umask 002. So that I can understand the concept of starting applications with a different umask. Then this post would cover both scenarios.
– StackChrisChris
Apr 28 at 6:56




Thanks already for your answer. I did quite a bit more googling this night and understood that what I need to do is to change the umask to 002. First time I looked at "umask", but seems generally pretty straight forward. I will check if I can set the umask in the seaf-cli config file and will post it here. There is a config that seafioe-cli calles during startup. But may I also ask how to to generally start processes with umask 002. So that I can understand the concept of starting applications with a different umask. Then this post would cover both scenarios.
– StackChrisChris
Apr 28 at 6:56












It seems the question remains the same: How can I set the umask myself when I start the process.
– StackChrisChris
Apr 28 at 14:44




It seems the question remains the same: How can I set the umask myself when I start the process.
– StackChrisChris
Apr 28 at 14:44












How are you starting it? if it's via systemd, I think you should be able to add a UMask property e.g. UMask=0002 to the [Service] section of the unit file
– steeldriver
Apr 28 at 20:52




How are you starting it? if it's via systemd, I think you should be able to add a UMask property e.g. UMask=0002 to the [Service] section of the unit file
– steeldriver
Apr 28 at 20:52












I am starting it with an unit.d script based on the description on this website: wp.yawc.de/2015/01/seafile-cli-autostart. I tried to add a —umask 002 after "su -c" inside the script and start the service with “sudo service deaf-cli start —umask 002” , which both did not work.
– StackChrisChris
Apr 29 at 23:18




I am starting it with an unit.d script based on the description on this website: wp.yawc.de/2015/01/seafile-cli-autostart. I tried to add a —umask 002 after "su -c" inside the script and start the service with “sudo service deaf-cli start —umask 002” , which both did not work.
– StackChrisChris
Apr 29 at 23:18















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028974%2fis-there-a-way-to-let-an-application-create-files-with-664-permissions%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1028974%2fis-there-a-way-to-let-an-application-create-files-with-664-permissions%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491