Bug 1645415

Summary: authselect fails to replace authconfig
Product: [Fedora] Fedora Reporter: Nikos Mavrogiannopoulos <nmavrogi>
Component: authselectAssignee: Pavel Březina <pbrezina>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: jhrozek, pbrezina
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-23 16:44:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nikos Mavrogiannopoulos 2018-11-02 07:56:36 UTC
Description of problem:

The standard way to configure sssd with kerberos was:
```
authconfig --enablesssdauth --enablesssd --enablemkhomedir --update
```

The equivalent of authselect is:
```
authselect select sssd  with-mkhomedir
```

However it fails for two reasons:
1. oddjob-mkhomedir is not installed (should have been a Recommends of authselect)

2. It prints errors about /etc/nsswitch.conf not being a symbolic link
```
[error] [/etc/nsswitch.conf] is not a symbolic link!
[error] [/etc/nsswitch.conf] was not created by authselect!
Current configuration is not valid. It was probably modified outside authselect.
```

Comment 1 Pavel Březina 2018-11-02 09:40:06 UTC
This is not a regression but expected behavior.

1) About "[error] [/etc/nsswitch.conf] is not a symbolic link!"

This is expected as authselect will never touch configuration that was not generated by authselect. If you read the error further, you will know what to do:

[root /home/pbrezina]# authselect select sssd with-mkhomedir
[error] [/etc/nsswitch.conf] is not a symbolic link!
[error] [/etc/nsswitch.conf] was not created by authselect!
[error] Unexpected changes to the configuration were detected.
[error] Refusing to activate profile unless those changes are removed or overwrite is requested.

Some unexpected changes to the configuration were detected.
Use --force parameter if you want to overwrite these changes.

2) About "oddjob-mkhomedir is not installed (should have been a Recommends of authselect)"

Authselect is really a generic tool and as such it can not require any package needed by profiles -- customers does not want to have winbind installed if they are using sssd profile etc. But the spec file uses the weak dependency suggests to say what packages may be interesting to have:
Suggests: sssd
Suggests: samba-winbind
Suggests: fprintd-pam
Suggests: oddjob-mkhomedir

[pbrezina ~]$ sudo authselect select sssd  with-mkhomedir
Profile "sssd" was selected.
The following nsswitch maps are overwritten by the profile:
- passwd
- group
- netgroup
- automount
- services

Make sure that SSSD service is configured and enabled. See SSSD documentation for more information.
 
- with-mkhomedir is selected, make sure oddjobd service is enabled
  - systemctl enable oddjobd.service
  - systemctl start oddjobd.service

This part we can improve to also tell the administrator to install pam_oddjob_mkhomedir module is installed.