Results 1 to 10 of 10

Thread: Adding users - what creates their default subdirectories? (Suse 11.4)

  1. #1

    Default Adding users - what creates their default subdirectories? (Suse 11.4)

    Can anyone tell me what process creates the user directories ~/Documents, ~/Downloads, ~/Public etc?

    They are not present in the structure of /etc/skel, and they do not appear until the user logs in to any graphical environment for the first time. I tried it with KDE, LXDE and Icewm. In each case the same set of directories were created. I've searched the scripts in /etc/X11, without success.
    Go placidly amidst the noise and haste, and remember what peace there may be in silence.

  2. #2

    Default Re: Adding users - what creates their default subdirectories? (Suse 11.4)

    There are packages "xdg-user-dirs" and "xdg-user-dirs-gtk" which provide the logic behind this. Try "rpm -ql xdg-user-dirs{,-gtk}" to find some of the relevant files. There are two obvious places from where this program is called:

    • /etc/xdg/autostart/user-dirs-update-gtk.desktop: On my machine this is executed in GNOME, XFCE and LXDE.
    • /etc/X11/xinit/xinitrc.d/xdg-user-dirs.sh. Maybe this is only called when an Xserver is started by the user, but I'm not sure. You write that these dirs also appear if you use IceWM, so maybe it gets called whenever someone logs in from vt7.


    You find the configuration of this (including non-localized directory names) in /etc/xdg/user-dirs.* .
    If you don't like the default setting for a specific user account, you can change it by creating ~/.config/user-dirs.dirs. That's how I do it.
    -- Y

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: Adding users - what creates their default subdirectories? (Suse 11.4)

    AFAIK, the tool useradd is used internally by YaST, thus read
    Code:
    man useradd
    and there you see that /etc/skel is used as a skeleton for polupalting a user's home directory aty user creation.
    Henk van Velden

  4. #4

    Default Re: Adding users - what creates their default subdirectories? (Suse 11.4)

    Quote Originally Posted by Yarny View Post
    • /etc/X11/xinit/xinitrc.d/xdg-user-dirs.sh. Maybe this is only called when an Xserver is started by the user, but I'm not sure.
    It depends if the xinitrc or Xsession script starting the X session runs this script or not:

    Code:
    # run all system xinitrc shell scripts.
    
    if [ -d /etc/X11/xinit/xinitrc.d ]; then
        for i in /etc/X11/xinit/xinitrc.d/* ; do
            echo "Loading xinit script $i"
            if [ -x "$i" -a ! -d "$i" ]; then
    	    . "$i"
            fi
        done
    fi
    As you can see in this example, removing the executable bit will prevent a script from beeing sourced.

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Adding users - what creates their default subdirectories? (Suse11.4)

    On 2012-08-02 12:56, hcvv wrote:
    >
    > AFAIK, the tool useradd is used internally by YaST, thus read
    >
    > Code:
    > --------------------
    > man useradd
    > --------------------
    >
    > and there you see that /etc/skel is used as a skeleton for polupalting
    > a user's home directory aty user creation.


    But ~/Documents is not there, for example. Or ~/Desktop.


    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  6. #6

    Default Re: Adding users - what creates their default subdirectories? (Suse 11.4)

    Quote Originally Posted by hcvv View Post
    AFAIK, the tool useradd is used internally by YaST, thus read
    Code:
    man useradd
    and there you see that /etc/skel is used as a skeleton for polupalting a user's home directory aty user creation.
    These directories are not included in /etc/skel and not created by useradd.
    See here: Man Page for xdg-user-dirs-update (OpenSolaris Section 1) - The UNIX and Linux Forums
    The manpage in this link is for OpenSolaris, but it's the same under Linux. It's a FreeDesktop (XDG) thing.

    icewm-session (not icewm) is partially XDG compatible.

  7. #7
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,882
    Blog Entries
    3

    Default Re: Adding users - what creates their default subdirectories? (Suse 11.4)

    Quote Originally Posted by oakhillj View Post
    Can anyone tell me what process creates the user directories ~/Documents, ~/Downloads, ~/Public etc?
    I don't know in general.

    In my case, they are automatically created for the user I give during install. I later create two additional users with "vipw", and nothing is created for them. But they have home directories from earlier use (earlier versions of linux).

    For those two additional users, "Documents", "Desktop", "Public" and several others are created by KDE4 when that user first logs in. I presume other desktop environments do the same.

    If I don't want those directories, I can then delete them and avoid any X desktop login for that user.
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  8. #8

    Default Re: Adding users - what creates their default subdirectories? (Suse 11.4)

    Quote Originally Posted by nrickert View Post
    I don't know in general.
    Who is that going to help to learn that you don't know (in general)? Btw the question has been answered in the other posts. Just read them and you will know!

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,384

    Default Re: Adding users - what creates their default subdirectories? (Suse 11.4)

    I stand corrected. And the OP allready said that in it's first post. It is something added when using a GUI.
    Henk van Velden

  10. #10

    Default Re: Adding users - what creates their default subdirectories? (Suse 11.4)

    Thank you all for your contributions. In particular,

    Quote Originally Posted by please_try_again View Post
    See here: Man Page for xdg-user-dirs-update (OpenSolaris Section 1) - The UNIX and Linux Forums
    The manpage in this link is for OpenSolaris, but it's the same under Linux. It's a FreeDesktop (XDG) thing.
    led me to the complete answer.
    Go placidly amidst the noise and haste, and remember what peace there may be in silence.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •