Gnome3, Systemd and umask












2














I try to configure how Nautilus, GEdit and other Gnome applications set new file and directory permissions (002 instead of the default 022).



After reading posts and trying things, I found a "working" solution. All the users use these settings :



mkdir /etc/systemd/user/dbus.service.d/
mkdir /etc/systemd/user/gnome-terminal-server.service.d/
echo -e "[Service]nUMask=002n" > /etc/systemd/user/dbus.service.d/override.conf
echo -e "[Service]nUMask=002n" > /etc/systemd/user/gnome-terminal-server.service.d/override.conf


After reading a few more posts I removed these files and directories and tried :



mkdir /etc/systemd/system/user@.service.d/
echo -e "[Service]nUMask=002n" > /etc/systemd/system/user@.service.d/override.conf


I did this because both dbus.service and gnome-terminal-server.service are under user@1000.service (systemd-cgls):



Control group /:
-.slice
├─user.slice
│ ├─user-1000.slice
│ │ └─user@1000.service
│ │ ├─gnome-terminal-server.service
│ │ │ ├─1763 /usr/lib/gnome-terminal/gnome-terminal-server
│ │ │ ├─1771 bash
│ │ ├─dbus.service
│ │ │ └─1973 /usr/bin/nautilus --gapplication-service


Unfortunately, executing umask in my terminal prints 0022 and not 0002 but GEdit and Nautilus use 002 (I created a new text file and a new directory).



What am I missing ?










share|improve this question




















  • 1




    Does your shell set the umask somewhere else (such as ~/.profile or /etc/profile)?
    – sebasth
    Jan 23 '18 at 7:21










  • No, I checked ~/.bashrc too. I never modify these files. If the first solution works for my terminals, we can probably assume bash doesn't override the umask.
    – sylvain
    Jan 24 '18 at 8:32


















2














I try to configure how Nautilus, GEdit and other Gnome applications set new file and directory permissions (002 instead of the default 022).



After reading posts and trying things, I found a "working" solution. All the users use these settings :



mkdir /etc/systemd/user/dbus.service.d/
mkdir /etc/systemd/user/gnome-terminal-server.service.d/
echo -e "[Service]nUMask=002n" > /etc/systemd/user/dbus.service.d/override.conf
echo -e "[Service]nUMask=002n" > /etc/systemd/user/gnome-terminal-server.service.d/override.conf


After reading a few more posts I removed these files and directories and tried :



mkdir /etc/systemd/system/user@.service.d/
echo -e "[Service]nUMask=002n" > /etc/systemd/system/user@.service.d/override.conf


I did this because both dbus.service and gnome-terminal-server.service are under user@1000.service (systemd-cgls):



Control group /:
-.slice
├─user.slice
│ ├─user-1000.slice
│ │ └─user@1000.service
│ │ ├─gnome-terminal-server.service
│ │ │ ├─1763 /usr/lib/gnome-terminal/gnome-terminal-server
│ │ │ ├─1771 bash
│ │ ├─dbus.service
│ │ │ └─1973 /usr/bin/nautilus --gapplication-service


Unfortunately, executing umask in my terminal prints 0022 and not 0002 but GEdit and Nautilus use 002 (I created a new text file and a new directory).



What am I missing ?










share|improve this question




















  • 1




    Does your shell set the umask somewhere else (such as ~/.profile or /etc/profile)?
    – sebasth
    Jan 23 '18 at 7:21










  • No, I checked ~/.bashrc too. I never modify these files. If the first solution works for my terminals, we can probably assume bash doesn't override the umask.
    – sylvain
    Jan 24 '18 at 8:32
















2












2








2







I try to configure how Nautilus, GEdit and other Gnome applications set new file and directory permissions (002 instead of the default 022).



After reading posts and trying things, I found a "working" solution. All the users use these settings :



mkdir /etc/systemd/user/dbus.service.d/
mkdir /etc/systemd/user/gnome-terminal-server.service.d/
echo -e "[Service]nUMask=002n" > /etc/systemd/user/dbus.service.d/override.conf
echo -e "[Service]nUMask=002n" > /etc/systemd/user/gnome-terminal-server.service.d/override.conf


After reading a few more posts I removed these files and directories and tried :



mkdir /etc/systemd/system/user@.service.d/
echo -e "[Service]nUMask=002n" > /etc/systemd/system/user@.service.d/override.conf


I did this because both dbus.service and gnome-terminal-server.service are under user@1000.service (systemd-cgls):



Control group /:
-.slice
├─user.slice
│ ├─user-1000.slice
│ │ └─user@1000.service
│ │ ├─gnome-terminal-server.service
│ │ │ ├─1763 /usr/lib/gnome-terminal/gnome-terminal-server
│ │ │ ├─1771 bash
│ │ ├─dbus.service
│ │ │ └─1973 /usr/bin/nautilus --gapplication-service


Unfortunately, executing umask in my terminal prints 0022 and not 0002 but GEdit and Nautilus use 002 (I created a new text file and a new directory).



What am I missing ?










share|improve this question















I try to configure how Nautilus, GEdit and other Gnome applications set new file and directory permissions (002 instead of the default 022).



After reading posts and trying things, I found a "working" solution. All the users use these settings :



mkdir /etc/systemd/user/dbus.service.d/
mkdir /etc/systemd/user/gnome-terminal-server.service.d/
echo -e "[Service]nUMask=002n" > /etc/systemd/user/dbus.service.d/override.conf
echo -e "[Service]nUMask=002n" > /etc/systemd/user/gnome-terminal-server.service.d/override.conf


After reading a few more posts I removed these files and directories and tried :



mkdir /etc/systemd/system/user@.service.d/
echo -e "[Service]nUMask=002n" > /etc/systemd/system/user@.service.d/override.conf


I did this because both dbus.service and gnome-terminal-server.service are under user@1000.service (systemd-cgls):



Control group /:
-.slice
├─user.slice
│ ├─user-1000.slice
│ │ └─user@1000.service
│ │ ├─gnome-terminal-server.service
│ │ │ ├─1763 /usr/lib/gnome-terminal/gnome-terminal-server
│ │ │ ├─1771 bash
│ │ ├─dbus.service
│ │ │ └─1973 /usr/bin/nautilus --gapplication-service


Unfortunately, executing umask in my terminal prints 0022 and not 0002 but GEdit and Nautilus use 002 (I created a new text file and a new directory).



What am I missing ?







systemd gnome3






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 23 '18 at 6:49

























asked Jan 21 '18 at 12:21









sylvain

113




113








  • 1




    Does your shell set the umask somewhere else (such as ~/.profile or /etc/profile)?
    – sebasth
    Jan 23 '18 at 7:21










  • No, I checked ~/.bashrc too. I never modify these files. If the first solution works for my terminals, we can probably assume bash doesn't override the umask.
    – sylvain
    Jan 24 '18 at 8:32
















  • 1




    Does your shell set the umask somewhere else (such as ~/.profile or /etc/profile)?
    – sebasth
    Jan 23 '18 at 7:21










  • No, I checked ~/.bashrc too. I never modify these files. If the first solution works for my terminals, we can probably assume bash doesn't override the umask.
    – sylvain
    Jan 24 '18 at 8:32










1




1




Does your shell set the umask somewhere else (such as ~/.profile or /etc/profile)?
– sebasth
Jan 23 '18 at 7:21




Does your shell set the umask somewhere else (such as ~/.profile or /etc/profile)?
– sebasth
Jan 23 '18 at 7:21












No, I checked ~/.bashrc too. I never modify these files. If the first solution works for my terminals, we can probably assume bash doesn't override the umask.
– sylvain
Jan 24 '18 at 8:32






No, I checked ~/.bashrc too. I never modify these files. If the first solution works for my terminals, we can probably assume bash doesn't override the umask.
– sylvain
Jan 24 '18 at 8:32












1 Answer
1






active

oldest

votes


















1














At least on fedora, bash overwrites the umask in /etc/bashrc






share|improve this answer





















  • Really? Are you sure?
    – G-Man
    Dec 19 '18 at 14:25










  • @G-Man yes, it does, for non-login shells: for uids starting at 200, if the user matches the group name, it’s set to 002, otherwise 022.
    – Stephen Kitt
    Dec 19 '18 at 14:37










  • @StephenKitt: What we have here is a failure to communicate.  I guess you're saying that bash overrides the umask in /etc/bashrc.  I read the above answer as saying that bash overwrites the file /etc/bashrc, which I (still) doubt.
    – G-Man
    Dec 19 '18 at 16:08










  • @G-Man ah, right, yes, bash doesn’t overwrite /etc/bashrc, but if the author had meant that, why mention “the umask in”?
    – Stephen Kitt
    Dec 19 '18 at 16:10










  • @StephenKitt If I modified a file, unconditionally setting a new value for one parameter (ignoring its existing value) and leaving the rest of the file unchanged, I might use similar language.
    – G-Man
    Dec 19 '18 at 16:15











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f418624%2fgnome3-systemd-and-umask%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














At least on fedora, bash overwrites the umask in /etc/bashrc






share|improve this answer





















  • Really? Are you sure?
    – G-Man
    Dec 19 '18 at 14:25










  • @G-Man yes, it does, for non-login shells: for uids starting at 200, if the user matches the group name, it’s set to 002, otherwise 022.
    – Stephen Kitt
    Dec 19 '18 at 14:37










  • @StephenKitt: What we have here is a failure to communicate.  I guess you're saying that bash overrides the umask in /etc/bashrc.  I read the above answer as saying that bash overwrites the file /etc/bashrc, which I (still) doubt.
    – G-Man
    Dec 19 '18 at 16:08










  • @G-Man ah, right, yes, bash doesn’t overwrite /etc/bashrc, but if the author had meant that, why mention “the umask in”?
    – Stephen Kitt
    Dec 19 '18 at 16:10










  • @StephenKitt If I modified a file, unconditionally setting a new value for one parameter (ignoring its existing value) and leaving the rest of the file unchanged, I might use similar language.
    – G-Man
    Dec 19 '18 at 16:15
















1














At least on fedora, bash overwrites the umask in /etc/bashrc






share|improve this answer





















  • Really? Are you sure?
    – G-Man
    Dec 19 '18 at 14:25










  • @G-Man yes, it does, for non-login shells: for uids starting at 200, if the user matches the group name, it’s set to 002, otherwise 022.
    – Stephen Kitt
    Dec 19 '18 at 14:37










  • @StephenKitt: What we have here is a failure to communicate.  I guess you're saying that bash overrides the umask in /etc/bashrc.  I read the above answer as saying that bash overwrites the file /etc/bashrc, which I (still) doubt.
    – G-Man
    Dec 19 '18 at 16:08










  • @G-Man ah, right, yes, bash doesn’t overwrite /etc/bashrc, but if the author had meant that, why mention “the umask in”?
    – Stephen Kitt
    Dec 19 '18 at 16:10










  • @StephenKitt If I modified a file, unconditionally setting a new value for one parameter (ignoring its existing value) and leaving the rest of the file unchanged, I might use similar language.
    – G-Man
    Dec 19 '18 at 16:15














1












1








1






At least on fedora, bash overwrites the umask in /etc/bashrc






share|improve this answer












At least on fedora, bash overwrites the umask in /etc/bashrc







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 19 '18 at 14:13









stefan

191




191












  • Really? Are you sure?
    – G-Man
    Dec 19 '18 at 14:25










  • @G-Man yes, it does, for non-login shells: for uids starting at 200, if the user matches the group name, it’s set to 002, otherwise 022.
    – Stephen Kitt
    Dec 19 '18 at 14:37










  • @StephenKitt: What we have here is a failure to communicate.  I guess you're saying that bash overrides the umask in /etc/bashrc.  I read the above answer as saying that bash overwrites the file /etc/bashrc, which I (still) doubt.
    – G-Man
    Dec 19 '18 at 16:08










  • @G-Man ah, right, yes, bash doesn’t overwrite /etc/bashrc, but if the author had meant that, why mention “the umask in”?
    – Stephen Kitt
    Dec 19 '18 at 16:10










  • @StephenKitt If I modified a file, unconditionally setting a new value for one parameter (ignoring its existing value) and leaving the rest of the file unchanged, I might use similar language.
    – G-Man
    Dec 19 '18 at 16:15


















  • Really? Are you sure?
    – G-Man
    Dec 19 '18 at 14:25










  • @G-Man yes, it does, for non-login shells: for uids starting at 200, if the user matches the group name, it’s set to 002, otherwise 022.
    – Stephen Kitt
    Dec 19 '18 at 14:37










  • @StephenKitt: What we have here is a failure to communicate.  I guess you're saying that bash overrides the umask in /etc/bashrc.  I read the above answer as saying that bash overwrites the file /etc/bashrc, which I (still) doubt.
    – G-Man
    Dec 19 '18 at 16:08










  • @G-Man ah, right, yes, bash doesn’t overwrite /etc/bashrc, but if the author had meant that, why mention “the umask in”?
    – Stephen Kitt
    Dec 19 '18 at 16:10










  • @StephenKitt If I modified a file, unconditionally setting a new value for one parameter (ignoring its existing value) and leaving the rest of the file unchanged, I might use similar language.
    – G-Man
    Dec 19 '18 at 16:15
















Really? Are you sure?
– G-Man
Dec 19 '18 at 14:25




Really? Are you sure?
– G-Man
Dec 19 '18 at 14:25












@G-Man yes, it does, for non-login shells: for uids starting at 200, if the user matches the group name, it’s set to 002, otherwise 022.
– Stephen Kitt
Dec 19 '18 at 14:37




@G-Man yes, it does, for non-login shells: for uids starting at 200, if the user matches the group name, it’s set to 002, otherwise 022.
– Stephen Kitt
Dec 19 '18 at 14:37












@StephenKitt: What we have here is a failure to communicate.  I guess you're saying that bash overrides the umask in /etc/bashrc.  I read the above answer as saying that bash overwrites the file /etc/bashrc, which I (still) doubt.
– G-Man
Dec 19 '18 at 16:08




@StephenKitt: What we have here is a failure to communicate.  I guess you're saying that bash overrides the umask in /etc/bashrc.  I read the above answer as saying that bash overwrites the file /etc/bashrc, which I (still) doubt.
– G-Man
Dec 19 '18 at 16:08












@G-Man ah, right, yes, bash doesn’t overwrite /etc/bashrc, but if the author had meant that, why mention “the umask in”?
– Stephen Kitt
Dec 19 '18 at 16:10




@G-Man ah, right, yes, bash doesn’t overwrite /etc/bashrc, but if the author had meant that, why mention “the umask in”?
– Stephen Kitt
Dec 19 '18 at 16:10












@StephenKitt If I modified a file, unconditionally setting a new value for one parameter (ignoring its existing value) and leaving the rest of the file unchanged, I might use similar language.
– G-Man
Dec 19 '18 at 16:15




@StephenKitt If I modified a file, unconditionally setting a new value for one parameter (ignoring its existing value) and leaving the rest of the file unchanged, I might use similar language.
– G-Man
Dec 19 '18 at 16:15


















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f418624%2fgnome3-systemd-and-umask%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Morgemoulin

Scott Moir

Souastre