pacemaker
3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
lib
services
services_private.h
Go to the documentation of this file.
1
/*
2
* Copyright 2010-2011 Red Hat, Inc.
3
* Later changes copyright 2012-2024 the Pacemaker project contributors
4
*
5
* The version control history for this file may have further details.
6
*
7
* This source code is licensed under the GNU Lesser General Public License
8
* version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
9
*/
10
11
#ifndef PCMK__SERVICES_SERVICES_PRIVATE__H
12
#define PCMK__SERVICES_SERVICES_PRIVATE__H
13
14
#include <unistd.h>
// uid_t, gid_t
15
16
#include <glib.h>
// G_GNUC_INTERNAL, gboolean, guint, etc.
17
#if HAVE_DBUS
18
#include <dbus/dbus.h>
// DBusPendingCall
19
#endif
20
21
#include <
crm/common/mainloop.h
>
// mainloop_io_t
22
#include <
crm/services.h
>
// svc_action_t
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
28
#define MAX_ARGC 255
29
struct
svc_action_private_s
{
30
char
*
exec
;
31
char
*
exit_reason
;
32
char
*
args
[
MAX_ARGC
];
33
34
uid_t
uid
;
35
gid_t
gid
;
36
37
guint
repeat_timer
;
38
void (*
callback
) (
svc_action_t
* op);
39
void (*
fork_callback
) (
svc_action_t
* op);
40
41
int
stderr_fd
;
42
mainloop_io_t
*
stderr_gsource
;
43
44
int
stdout_fd
;
45
mainloop_io_t
*
stdout_gsource
;
46
47
int
stdin_fd
;
48
#if HAVE_DBUS
49
DBusPendingCall* pending;
50
unsigned
timerid;
51
#endif
52
};
53
54
G_GNUC_INTERNAL
55
const
char
*
services__action_kind
(
const
svc_action_t
*
action
);
56
57
G_GNUC_INTERNAL
58
GList *
services_os_get_single_directory_list
(
const
char
*root, gboolean files,
59
gboolean executable);
60
61
G_GNUC_INTERNAL
62
GList *
services_os_get_directory_list
(
const
char
*root, gboolean files, gboolean executable);
63
64
G_GNUC_INTERNAL
65
int
services__execute_file
(
svc_action_t
*op);
66
67
G_GNUC_INTERNAL
68
gboolean
cancel_recurring_action
(
svc_action_t
* op);
69
70
G_GNUC_INTERNAL
71
gboolean
recurring_action_timer
(gpointer
data
);
72
73
G_GNUC_INTERNAL
74
int
services__finalize_async_op
(
svc_action_t
*op);
75
76
G_GNUC_INTERNAL
77
int
services__generic_error
(
const
svc_action_t
*op);
78
79
G_GNUC_INTERNAL
80
int
services__not_installed_error
(
const
svc_action_t
*op);
81
82
G_GNUC_INTERNAL
83
int
services__authorization_error
(
const
svc_action_t
*op);
84
85
G_GNUC_INTERNAL
86
int
services__configuration_error
(
const
svc_action_t
*op,
bool
is_fatal);
87
88
G_GNUC_INTERNAL
89
void
services__handle_exec_error
(
svc_action_t
* op,
int
error);
90
91
G_GNUC_INTERNAL
92
void
services__set_cancelled
(
svc_action_t
*
action
);
93
94
G_GNUC_INTERNAL
95
void
services_add_inflight_op
(
svc_action_t
*op);
96
97
G_GNUC_INTERNAL
98
void
services_untrack_op
(
const
svc_action_t
*op);
99
100
G_GNUC_INTERNAL
101
gboolean
is_op_blocked
(
const
char
*rsc);
102
103
#if HAVE_DBUS
104
G_GNUC_INTERNAL
105
void
services_set_op_pending(
svc_action_t
*op, DBusPendingCall *pending);
106
#endif
107
108
#ifdef __cplusplus
109
}
110
#endif
111
112
#endif // PCMK__SERVICES_SERVICES_PRIVATE__H
services.h
Services API.
svc_action_private_s::callback
void(* callback)(svc_action_t *op)
Definition:
services_private.h:38
data
char data[0]
Definition:
cpg.c:58
services__configuration_error
G_GNUC_INTERNAL int services__configuration_error(const svc_action_t *op, bool is_fatal)
Definition:
services_linux.c:859
services_os_get_single_directory_list
G_GNUC_INTERNAL GList * services_os_get_single_directory_list(const char *root, gboolean files, gboolean executable)
Definition:
services_linux.c:1401
services__action_kind
G_GNUC_INTERNAL const char * services__action_kind(const svc_action_t *action)
Definition:
services.c:1293
svc_action_private_s::stderr_gsource
mainloop_io_t * stderr_gsource
Definition:
services_private.h:42
services_os_get_directory_list
G_GNUC_INTERNAL GList * services_os_get_directory_list(const char *root, gboolean files, gboolean executable)
Definition:
services_linux.c:1456
mainloop_io_t
struct mainloop_io_s mainloop_io_t
Definition:
mainloop.h:41
svc_action_private_s::repeat_timer
guint repeat_timer
Definition:
services_private.h:37
svc_action_private_s::stdin_fd
int stdin_fd
Definition:
services_private.h:47
mainloop.h
Wrappers for and extensions to glib mainloop.
action
const char * action
Definition:
pcmk_fence.c:32
cancel_recurring_action
G_GNUC_INTERNAL gboolean cancel_recurring_action(svc_action_t *op)
Definition:
services.c:618
services__handle_exec_error
G_GNUC_INTERNAL void services__handle_exec_error(svc_action_t *op, int error)
Definition:
services_linux.c:887
svc_action_private_s::uid
uid_t uid
Definition:
services_private.h:34
svc_action_private_s::gid
gid_t gid
Definition:
services_private.h:35
services__finalize_async_op
G_GNUC_INTERNAL int services__finalize_async_op(svc_action_t *op)
Definition:
services_linux.c:556
svc_action_s
Object for executing external actions.
Definition:
services.h:99
services__not_installed_error
G_GNUC_INTERNAL int services__not_installed_error(const svc_action_t *op)
Definition:
services_linux.c:796
recurring_action_timer
G_GNUC_INTERNAL gboolean recurring_action_timer(gpointer data)
Definition:
services_linux.c:520
services__set_cancelled
G_GNUC_INTERNAL void services__set_cancelled(svc_action_t *action)
Definition:
services.c:1275
services__authorization_error
G_GNUC_INTERNAL int services__authorization_error(const svc_action_t *op)
Definition:
services_linux.c:827
MAX_ARGC
#define MAX_ARGC
Definition:
services_private.h:28
svc_action_private_s::args
char * args[MAX_ARGC]
Definition:
services_private.h:32
svc_action_private_s::exec
char * exec
Definition:
services_private.h:30
svc_action_private_s::exit_reason
char * exit_reason
Definition:
services_private.h:31
svc_action_private_s::stderr_fd
int stderr_fd
Definition:
services_private.h:41
svc_action_private_s
Definition:
services_private.h:29
services__execute_file
G_GNUC_INTERNAL int services__execute_file(svc_action_t *op)
Definition:
services_linux.c:1208
is_op_blocked
G_GNUC_INTERNAL gboolean is_op_blocked(const char *rsc)
Definition:
services.c:883
svc_action_private_s::stdout_gsource
mainloop_io_t * stdout_gsource
Definition:
services_private.h:45
services__generic_error
G_GNUC_INTERNAL int services__generic_error(const svc_action_t *op)
Definition:
services_linux.c:765
services_add_inflight_op
G_GNUC_INTERNAL void services_add_inflight_op(svc_action_t *op)
Definition:
services.c:808
svc_action_private_s::stdout_fd
int stdout_fd
Definition:
services_private.h:44
services_untrack_op
G_GNUC_INTERNAL void services_untrack_op(const svc_action_t *op)
Definition:
services.c:829
svc_action_private_s::fork_callback
void(* fork_callback)(svc_action_t *op)
Definition:
services_private.h:39
Generated on Wed Jan 8 2025 16:55:40 for pacemaker by
1.8.14