On installing keyd configuration error - unknown item 'USERADD_CMD'

I’m on the latest Tumbleweed Slowroll. I noticed that keyd keymapper cannot be installed properly, giving errors related to user management.

ed@chuwi-tw:/etc> sudo zypper in keyd
Refreshing service 'openSUSE'.
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  keyd

1 new package to install.

Package download size:   208.0 KiB

Package install size change:
              |       1.3 MiB  required by packages that will be installed
     1.3 MiB  |  -      0 B    released by packages that will be removed

Backend:  classic_rpmtrans
Continue? [y/n/v/...? shows all options] (y): 
Retrieving: keyd-2.5.0-1.1.x86_64 (repo-oss)                                                                                              (1/1), 208.0 KiB    
Retrieving: keyd-2.5.0-1.1.x86_64.rpm ....................................................................................................[done (935.0 KiB/s)]

Checking for file conflicts: ...........................................................................................................................[done]
configuration error - unknown item 'USERADD_CMD' (notify administrator)
configuration error - unknown item 'USERDEL_PRECMD' (notify administrator)
configuration error - unknown item 'USERDEL_POSTCMD' (notify administrator)
(1/1) Installing: keyd-2.5.0-1.1.x86_64 ................................................................................................................[done]
Running post-transaction scripts .......................................................................................................................[done]

This was custom SUSE patch which apparently has been removed almost a year ago:

- Remove scripts that claim to be config but are in /usr (boo#1191578)
  * userdel-script.patch
  * useradd-script.patch
  * useradd.local
  * userdel-post.local
  * userdel-pre.local

If these settings are still in /usr/etc/login.defs on your system - it is a bug. If you have /etc/login.defs with old values - consider removing it (after comparing with the default one).

I don’t understand what I need to do to fix it.

  1. The script files you mentioned are not in /usr
  2. you referred to ‘these settings’ in /usr/etc/login.defs. Which settings? What ‘old values’? How to compare?

SUSE moved the default login.defs into /usr/etc. If you have /etc/login.defs, it is leftover from older package versions. If you never modified this file, just remove it. You may compare /etc/login.defs with /usr/etc/login.defs to check for differences, whether you want to keep them. In which case you are advised to place only modified settings in a file under /etc/login.defs.d, not replacing the whole file.

1 Like

There is no /etc/login.defs file on my system. Only /usr/etc/login.defs. The directory /etc/login.defs.d is empty.

And does it contain USERADD_CMD, USERDEL_PRECMD and USERDEL_POSTCMD?

no.

Only this commented out:
#USERDEL_CMD /usr/sbin/userdel_local

ed@chuwi-tw:/usr/etc> ls /usr/sbin/user*
/usr/sbin/useradd  /usr/sbin/userdel  /usr/sbin/usermod

Then I can only guess that login.defs was already replaced. Do you see any warning during

sudo groupadd xxx
sudo groupdel xxx
ed@chuwi-tw:/usr/etc> sudo groupadd xxx
[sudo] password for root: 
configuration error - unknown item 'USERADD_CMD' (notify administrator)
configuration error - unknown item 'USERDEL_PRECMD' (notify administrator)
configuration error - unknown item 'USERDEL_POSTCMD' (notify administrator)
ed@chuwi-tw:/usr/etc> sudo groupdel xxx
configuration error - unknown item 'USERADD_CMD' (notify administrator)
configuration error - unknown item 'USERDEL_PRECMD' (notify administrator)
configuration error - unknown item 'USERDEL_POSTCMD' (notify administrator)

Run

sudo strace -f -o /tmp/groupadd.log groupadd xxx

and upload /tmp/groupadd.log to https://paste.opensuse.org/

You may need to install strace first.

https://paste.opensuse.org/pastes/5577b7403d13

9549  openat(AT_FDCWD, "/etc/login.defs.d/70-yast.defs", O_RDONLY|O_CLOEXEC) = 4

You claimed that /etc/login.defs.d is empty, but it clearly shows that there is file inside this directory.

oops, you’re right. I am working on 2 different laptops, so accidently looking into the wrong one.

Here’s the culprit /etc/login.defs.d/70-yast.defs:

..
USERADD_CMD /usr/sbin/useradd.local
USERDEL_PRECMD /usr/sbin/userdel-pre.local
USERDEL_POSTCMD /usr/sbin/userdel-post.local

Well, check timestamp of this file, it may have been created long ago. You can simply delete these line (or the whole file if they are the only settings).

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.