diff --git a/Changelog.md b/Changelog.md
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,3 +1,8 @@
+### 1.6.2
+
+- Added exception *TerminateWorkerProcess* that can be used for a little bit
+  more graceful termination of the worker process than bare exit(2).
+
 ### 1.6.1
 
 - Upgraded Cabal version constraint.
diff --git a/NgxExport.hs b/NgxExport.hs
--- a/NgxExport.hs
+++ b/NgxExport.hs
@@ -47,6 +47,8 @@
                  ,ngxCyclePtr
                  ,ngxUpstreamMainConfPtr
                  ,ngxCachedTimePtr
+    -- * Exception /TerminateWorkerProcess/
+                 ,TerminateWorkerProcess (..)
     -- * Re-exported data constructors from /Foreign.C/
     -- | Re-exports are needed by exporters for marshalling in foreign calls.
                  ,Foreign.C.CInt (..)
@@ -480,6 +482,22 @@
 instance Show ServiceHookInterrupt where
     show = const "Service was interrupted by a service hook"
 
+-- | Terminates the worker process.
+--
+-- Being thrown from a service when that runs for the first time, this
+-- exception makes Nginx log the supplied message and terminate the worker
+-- process without respawning. This can be useful when the service is unable
+-- to read its configuration from the Nginx configuration script or to perform
+-- an important initialization action.
+--
+-- @since 1.6.2
+newtype TerminateWorkerProcess =
+    TerminateWorkerProcess String  -- ^ Contains the message to log
+
+instance Exception TerminateWorkerProcess
+instance Show TerminateWorkerProcess where
+    show (TerminateWorkerProcess s) = s
+
 safeMallocBytes :: Int -> IO (Ptr a)
 safeMallocBytes =
     flip catchIOError (const $ return nullPtr) . mallocBytes
@@ -584,7 +602,9 @@
     return (C8L.pack $ show e,
             (case fromException e of
                 Just ServiceHookInterrupt -> 2
-                _ -> 1
+                _ -> case fromException e of
+                    Just (TerminateWorkerProcess _) -> 3
+                    _ -> 1
             ,case asyncExceptionFromException e of
                 Just ThreadKilled -> True
                 _ -> False
diff --git a/ngx-export.cabal b/ngx-export.cabal
--- a/ngx-export.cabal
+++ b/ngx-export.cabal
@@ -1,5 +1,5 @@
 name:                       ngx-export
-version:                    1.6.1
+version:                    1.6.2
 synopsis:                   Helper module for Nginx haskell module
 description:                Helper module for
         <http://github.com/lyokha/nginx-haskell-module Nginx haskell module>.
