source4 smdb: Add a post fork hook to the service API
authorGary Lockyer <gary@catalyst.net.nz>
Wed, 22 Aug 2018 21:35:52 +0000 (09:35 +1200)
committerGary Lockyer <gary@samba.org>
Thu, 1 Nov 2018 22:49:24 +0000 (23:49 +0100)
commit99aea42520fc10564dbba013c365adb3059febad
treef3b63d2d703983b23dc9b6aaddc764c105c10637
parentd6777a66c0dbd0c356059644b57070d4587d83ea
source4 smdb: Add a post fork hook to the service API

Add a post fork hook to the service API this will be called:

 - standard process model
   immediately after the task_init.

- single process model
  immediately after the task_init

- prefork process model, inhibit_pre_fork = true
  immediately after the task_init

- prefork process model, inhibit_pre_fork = false
  after each service worker has forked. It is not run on the service
  master process.

The post fork hook is not called in the standard model if a new process
is forked on a new connection. It is instead called immediately after
the task_init.

The task_init hook has been changed to return an error code. This ensures
the post_fork code is only run if the task_init code completed successfully.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
24 files changed:
file_server/file_server.c
source4/cldap_server/cldap_server.c
source4/dns_server/dns_server.c
source4/dsdb/dns/dns_update.c
source4/dsdb/kcc/kcc_service.c
source4/dsdb/repl/drepl_service.c
source4/echo_server/echo_server.c
source4/kdc/kdc-heimdal.c
source4/kdc/kdc-service-mit.c
source4/ldap_server/ldap_server.c
source4/nbt_server/nbt_server.c
source4/ntp_signd/ntp_signd.c
source4/rpc_server/service_rpc.c
source4/smb_server/service_smb.c
source4/smbd/process_model.h
source4/smbd/process_prefork.c
source4/smbd/process_single.c
source4/smbd/process_standard.c
source4/smbd/service.c
source4/smbd/service.h
source4/smbd/service_task.c
source4/web_server/web_server.c
source4/winbind/winbindd.c
source4/wrepl_server/wrepl_server.c