daemon: new scheme for graceful termination
[yaz-moved-to-github.git] / include / yaz / daemon.h
index 22de18f..b5ed96b 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2008 Index Data.
+ * Copyright (C) 1995-2012 Index Data.
  * All rights reserved.
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -68,12 +68,24 @@ int yaz_daemon(const char *progname,
                void (*work)(void *data), void *data,
                const char *pidfile, const char *uid);
 
+/** \brief stop daemon - stop parent process
+
+    This function sends a signal to the parent keepalive process that
+    makes it exit immediately - without waiting. If there's no parent
+    keepalive process, this function does nothing. SHould be called
+    when the child process has freed resources, such as listening socket.
+    But the child process may continue running.
+*/
+YAZ_EXPORT
+void yaz_daemon_stop(void);
+
 YAZ_END_CDECL
 
 #endif
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab