Missing dot files in home folder after fresh install

@oxwrongagain in my test there was no su to the user, I logged in remotely and it created dot files as required.

Hello @malcolmlewis ,

When you logged in remotely, was it a simple shell login or full desktop?

@oxwrongagain just a shell, no desktop environment.

Hello,

I just created another test user, creatively named “test4”, using the gnome user utility embedded in gnome-settings. I then logged in with that user id on the console (not gui) … just a simple shell login and the results were the same as with the users created in yast.

root@orca# find /home/test4
/home/test4
/home/test4/.bashrc
/home/test4/.bash_history
/home/test4/bin
/home/test4/.xinitrc.template

The contents of /etc/skel are as expected.

root@orca# ls -l1 /etc/skel
total 48
-rw------- 1 root root    0 May 18  1996 .bash_history
-rw-r--r-- 1 root root 1177 May  7  2022 .bashrc
drwx------ 2 root root 4096 Mar 15  2022 .cache
drwx------ 3 root root 4096 Jun 13 21:53 .config
-rw-r--r-- 1 root root 1637 Apr  9  2018 .emacs
drwxr-xr-x 2 root root 4096 Mar 15  2022 .fonts
-rw-r--r-- 1 root root   73 May 25  2018 .i18n
-rw-r--r-- 1 root root  861 Apr  9  2018 .inputrc
drwx------ 2 root root 4096 Mar 15  2022 .local
-rw-r--r-- 1 root root 1028 May  7  2022 .profile
-rw-r--r-- 1 root root 1951 May 25  2018 .xim.template
-rwxr-xr-x 1 root root 1112 May  4  2019 .xinitrc.template
drwxr-xr-x 2 root root 4096 Mar 15  2022 bin

That the gnome utility and yast both provided the same unexpected result, I can only conclude that something else is going … not a problem in the yast users module, unless opensuse has tweaked gnome to use yast under the covers :slight_smile: .

What is the content of /etc/default/useradd?

# useradd defaults file
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
USRSKEL=/usr/etc/skel
CREATE_MAIL_SPOOL=yes

I just now ran another test. I jumped to Runlevel three (you know, text-mode with networking, no DE). I ran “yast” - Users - Add User

Same result as in my first Reply … only the sub-dir “.cache” exists in the user’s home sub-dir.

In order to test my own sanity regarding how things are supposed to work, I created a test user on my tumbleweed box and the test user’s home directory was created as expected (no login necessary!).

On my Leap box, the directory /usr/etc/skel does not exist.

1 Like

@oxwrongagain it won’t usr merge was Tumbleweed (and I suspect Leap 16).

It by be worth noting that the original poster mentioned a fresh install. The account I actually use, the one created when I installed Leap 15.6 from the original release DVD image (build 709.1) appears to have created the home directory correctly. It certainly created .profile and .i18n, which are no longer created.

I installed during the 15.6-Beta period, using a 15.6-Beta ISO (USB flash), then [eventually] moved to the GA-release using zypper.

Hello all,

I am mostly convinced that there is a problem with pam. Even using “useradd -k /etc/skel …” gives the same erroneous result. I even tried adding the line:

session required pam_mkhomedir.so skel=/etc/skel/ umask=0022

in each of

/etc/pam.d/login (as suggested by /usr/share/doc/packages/pam/modules/README.pam_mkhomedir)
/etc/pam.d/useradd
/etc/pam.d/newusers

-k is not enough.
I tested on 15.6 and

useradd -m test2

created user2 home directory and populated it from /etc/skel.

I tried that:

# useradd -m utest16
# ls -Al /home/utest16
total 0
drwx------ 1 utest16 users 0 Mar 15  2022 .cache
#
#  ls -Al  /etc/skel
total 28
-rw------- 1 root root    0 May 18  1996 .bash_history
-rw-r--r-- 1 root root 1177 May  7  2022 .bashrc
drwx------ 1 root root    0 Mar 15  2022 .cache
drwx------ 1 root root    0 Mar 15  2022 .config
-rw-r--r-- 1 root root 1637 Apr  9  2018 .emacs
drwxr-xr-x 1 root root    0 Mar 15  2022 .fonts
-rw-r--r-- 1 root root   73 May 25  2018 .i18n
-rw-r--r-- 1 root root  861 Apr  9  2018 .inputrc
drwx------ 1 root root    0 Mar 15  2022 .local
-rw-r--r-- 1 root root 1028 May  7  2022 .profile
-rw-r--r-- 1 root root 1951 May 25  2018 .xim.template
-rwxr-xr-x 1 root root 1112 May  4  2019 .xinitrc.template
drwxr-xr-x 1 root root    0 Mar 15  2022 bin
#
#  useradd -m -k /etc/skel utest24
#
# ls -Al /home/utest24
total 0
drwx------ 1 utest24 users 0 Mar 15  2022 .cache
#

:roll_eyes: , and I’m not the OP

Hello @arvidjaar ,

I am using an up to date Leap 15.6. If you are also using an “up to date” Leap 15.6, then there is something else going on …

With new user creation, whether I do it through yast, gnome, or useradd, I get the same result. A subset of /etc/skel gets created in the user dir.

root@orca# find /home/testtwo/
/home/testtwo/
/home/testtwo/.bashrc
/home/testtwo/bin
/home/testtwo/.xinitrc.template

Hello @aggie ,

I am not OP either!

It is interesting the you are getting a subset that is smaller and different.

I just now executed this:

# nohup strace useradd -m newuser18 > uaddout.txt 2>&1

and currently examining the uaddout.txt file in Kate to see what low-level calls are failing. Might take me quite a few minutes, as there’s 624 lines of the strace output :+1:

HA!

I am about to do the same as google helped me find this bug from ubuntu:

1 Like

Hmmm. That post is from almost two years ago …

Anyway, I might have found a bit of a clue (blank lines added for readability):

close(13)                               = 0
close(14)                               = 0

utimensat(12, ".cache", [{tv_sec=1722456842, tv_nsec=152935545} /* 2024-07-31T15:14:02.152935545-0500 */, {tv_sec=1647344124, tv_nsec=0} /* 2022-03-15T06:35:24-0500 */], AT_SYMLINK_NOFOLLOW) = 0

newfstatat(AT_FDCWD, "\300Jxe1V", 0x7ffc4cc4c6c0, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)

mknodat(12, ".cache", S_IFDIR|000)  = -1 EPERM (Operation not permitted)

close(11)                               = 0
close(12)                               = 0

openat(AT_FDCWD, "/usr/etc/skel", 
[ ... ]

See the call to “utimensat” … there is a comment dated
/* 2024-07-31 T15:14:02.152935545-0500 */

… I assume there has been a change yesterday !!

Also notice the two calls just after it … to newfstatat and mknodat. (The argumenet to newfstatat is odd)

They both failed … then /etc/skel file is closed and , so nothing else happens.

2 Likes

GREAT EYE @aggie

The package “shadow”, which includes the useradd program updated from 4.8.1-150600.15.45 → 4.8.1-150600.17.3.1

The temporary fix is the obvious downgrade:

zypper in --oldpackage shadow-4.8.1-150600.15.45

After downgrading:

root@orca# useradd -m testone
root@orca# find /home/testone/
/home/testone/
/home/testone/.emacs
/home/testone/.bashrc
/home/testone/.i18n
/home/testone/.config
/home/testone/.config/autostart
/home/testone/.config/autostart/set_trusted.desktop
/home/testone/.cache
/home/testone/.xim.template
/home/testone/.inputrc
/home/testone/.fonts
/home/testone/.bash_history
/home/testone/bin
/home/testone/.profile
/home/testone/.xinitrc.template
/home/testone/.local

The expected result.