Service not starting on one server

23 views
Skip to first unread message

John Harmon

unread,
Nov 8, 2017, 5:17:49 PM11/8/17
to Ansible Project
I have a playbook that configures ldap for linux servers via sssd.  It runs against OEL 6, 7 and RHEL 6.  One OEL sssd is enabled and running when the playbook is done; however, on RHEL6 the service is only enabled and not running.  I can start the service without incident and it works as expected.  Have any of you seen something similar?  I have been watching it via logs and verbose output, but I can't find anything to tell me why it isn't running on RHEL6.  I am assuming it is some type of a race issue.  Maybe I will put in a pause in my ansible playbook to see if that helps.

John Harmon

unread,
Nov 8, 2017, 5:26:06 PM11/8/17
to Ansible Project
Update:  If I stop sssd on the RHEL6 box, and run the playbook again, the services start fine.  It is only after I have installed sssd for the first time that it doesn't seem to start.
The pause doesn't do any good.
Running the playbook a second time always seems to start the service.

John Harmon

unread,
Nov 8, 2017, 5:40:31 PM11/8/17
to Ansible Project
Update:  RHEL7 does NOT have the same problem, only RHEL6

John Harmon

unread,
Nov 10, 2017, 5:33:17 PM11/10/17
to Ansible Project
I found the culprit and thought I would post the update for posterity's sake.  Tailing the /var/log/messages file on the managed rhel6 host I noticed that sssd was starting, but authconfig was running after the startup and you see sssd shut down.  I reversed the order of my handlers file so that the authconfig handler ran first, and then the restart of my sssd service.  It is working now.

I had all sorts of code to show you, but google groups wont let me post it for some reason.

John Harmon

unread,
Nov 10, 2017, 5:35:05 PM11/10/17
to Ansible Project
I found the culprit.  I thought I would post my findings for posterity.

Following the /var/log/messages file on the rhel6 managed host:
Nov 10 15:18:58 ansibletest-rhel6 sssd: Starting up
Nov 10 15:18:58 ansibletest-rhel6 sssd[be[nspnet.net]]: Starting up
Nov 10 15:18:59 ansibletest-rhel6 sssd[pam]: Starting up
Nov 10 15:18:59 ansibletest-rhel6 sssd[nss]: Starting up
Nov 10 15:19:00 ansibletest-rhel6 ansible-command: Invoked with warn=True executable=None _uses_shell=True _raw_params=authconfig --enablesssd --enablesssdauth --enablemkhomedir --update removes=None creates=None chdir=None stdin=None
Nov 10 15:19:00 ansibletest-rhel6 sssd[pam]: Shutting down
Nov 10 15:19:00 ansibletest-rhel6 sssd[nss]: Shutting down

You notice sssd does indeed start, but after authconfig it shuts down (unexepcted).  Here is what my handlers file looked like:
---
# handlers file for ldap_users
- name: restart sssd
  service
:
    name
: sssd
    state
: restarted
    enabled
: yes
    pattern
: /usr/sbin/sssd

- name: authconfig update
  shell
: "authconfig --enablesssd --enablesssdauth --enablemkhomedir --update"
  ignore_errors
: yes
  changed_when
: false



I reversed the order and it works fine now:
---
# handlers file for ldap_users
- name: authconfig update
  shell
: "authconfig --enablesssd --enablesssdauth --enablemkhomedir --update"
  ignore_errors
: yes
  changed_when
: false

- name: restart sssd
  service
:
    name
: sssd
    state
: restarted
    enabled
: yes
    pattern
: /usr/sbin/sssd
Reply all
Reply to author
Forward
0 new messages