2 * Ceph - scalable distributed file system
4 * Copyright (C) 2019 SUSE LINUX GmbH
6 * This is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software
9 * Foundation. See file COPYING.
13 #include "include/compat.h"
14 #include "common/ceph_context.h"
19 ServiceBase(CephContext
*cct_
);
20 virtual ~ServiceBase() {};
22 static int initialize(ServiceBase
*service
);
25 static void control_handler(DWORD request
);
27 void shutdown(bool ignore_errors
= false);
30 void set_status(DWORD current_state
, DWORD exit_code
= NO_ERROR
);
32 /* Subclasses should implement the following service hooks. */
33 virtual int run_hook() = 0;
34 /* Invoked when the service is requested to stop. */
35 virtual int stop_hook() = 0;
36 /* Invoked when the system is shutting down. */
37 virtual int shutdown_hook() = 0;
42 /* A handle used when reporting the current status. */
43 SERVICE_STATUS_HANDLE hstatus
;
44 /* The current service status. */
45 SERVICE_STATUS status
;
47 /* singleton service instance */
48 static ServiceBase
*s_service
;