Making sure service.running reload is the very last thing

192 views
Skip to first unread message

Andrew Holway

unread,
Mar 20, 2015, 12:18:45 PM3/20/15
to salt-...@googlegroups.com
Hello,

I'm finding that Salt is not reloading services.

sssd:
  service.running:
    - reload: True

I've been noticing for a while that this is a problem with a range or services that I want to restart.

Thanks,

Andrew



##Output of state.highstate

          ID: sssd

    Function: service.running

      Result: True

     Comment: The service sssd is already running

     Started: 16:09:35.667116

    Duration: 124.188 ms

     Changes: 





Debug...

[INFO    ] Executing command 'systemctl status sssd.service' in directory '/root'

[DEBUG   ] output: sssd.service - System Security Services Daemon

   Loaded: loaded (/usr/lib/systemd/system/sssd.service; enabled)

   Active: active (running) since Fri 2015-03-20 16:07:46 UTC; 1min 49s ago

  Process: 2323 ExecStart=/usr/sbin/sssd -D -f (code=exited, status=0/SUCCESS)

 Main PID: 2324 (sssd)

   CGroup: /system.slice/sssd.service

           |-2324 /usr/sbin/sssd -D -f

           |-2325 /usr/libexec/sssd/sssd_be --domain cloud.native-instruments.de --debug-to-files

           |-2326 /usr/libexec/sssd/sssd_nss --debug-to-files

           |-2327 /usr/libexec/sssd/sssd_pam --debug-to-files

           |-2328 /usr/libexec/sssd/sssd_ssh --debug-to-files

           |-2329 /usr/libexec/sssd/sssd_sudo --debug-to-files

           `-2330 /usr/libexec/sssd/sssd_pac --debug-to-files


Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de sssd[be[2325]: Starting up

Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de sssd[2330]: Starting up

Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de sssd[2326]: Starting up

Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de sssd[2327]: Starting up

Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de sssd[2328]: Starting up

Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de sssd[2329]: Starting up

Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de systemd[1]: Started System Security Services Daemon.

Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de sssd_be[2325]: GSSAPI client step 1

Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de sssd_be[2325]: GSSAPI client step 1

Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de sssd_be[2325]: GSSAPI client step 1

Mar 20 16:07:46 test-freeipa-client-6.cloud.native-instruments.de sssd_be[2325]: GSSAPI client step 2

[INFO    ] Executing command 'systemctl is-active sssd.service' in directory '/root'

[DEBUG   ] output: active

[INFO    ] The service sssd is already running

[INFO    ] Completed state [sssd] at time 16:09:35.791304

[DEBUG   ] LazyLoaded .returner

[DEBUG   ] Decrypting the current master AES key

[DEBUG   ] Loaded minion key: /etc/salt/pki/minion/minion.pem


Colton Myers

unread,
Mar 31, 2015, 7:24:30 PM3/31/15
to salt-...@googlegroups.com
The service state is an interesting beast. It takes the `reload` argument, but `service.running` itself doesn't use that argument by default.

Rather, this argument is really only used when you use a `watch` requisite in conjunction with the `service.running` state. Let me explain.

The `watch` requisite has the same base behavior as the `require` requisite -- a state will only run if its watched states ran successfully. However, `watch` can also add *additional* behavior when there are changes in the watched state. The most common example is that a `service.running` state will `watch` a `file.managed` state. When changes are made to that file, the service will restart/reload, depending on the `reload` argument.

So, if you add a `watch` to your state, it should start to reload when changes are made in the watched state.

If you want to reload your service every state run, you should use `module.run` in conjunction with the `service.reload` execution module function.

Hope that helps!

--
Colton Myers
Platform Engineer, SaltStack
@basepi on Github/Twitter/IRC
> --
> You received this message because you are subscribed to the Google Groups "Salt-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

signature.asc
Reply all
Reply to author
Forward
0 new messages