root/lib/services/services_private.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright 2010-2011 Red Hat, Inc.
   3  * Later changes copyright 2012-2025 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 #if SUPPORT_SYSTEMD
  54     char *job_path;         // D-Bus object path for enqueued start/stop job
  55 #endif  // SUPPORT_SYSTEMD
  56 };
  57 
  58 G_GNUC_INTERNAL
  59 const char *services__action_kind(const svc_action_t *action);
  60 
  61 G_GNUC_INTERNAL
  62 GList *services_os_get_single_directory_list(const char *root, gboolean files,
  63                                              gboolean executable);
  64 
  65 G_GNUC_INTERNAL
  66 GList *services_os_get_directory_list(const char *root, gboolean files, gboolean executable);
  67 
  68 G_GNUC_INTERNAL
  69 int services__execute_file(svc_action_t *op);
  70 
  71 G_GNUC_INTERNAL
  72 gboolean cancel_recurring_action(svc_action_t * op);
  73 
  74 G_GNUC_INTERNAL
  75 gboolean recurring_action_timer(gpointer data);
  76 
  77 G_GNUC_INTERNAL
  78 int services__finalize_async_op(svc_action_t *op);
  79 
  80 G_GNUC_INTERNAL
  81 int services__generic_error(const svc_action_t *op);
  82 
  83 G_GNUC_INTERNAL
  84 int services__not_installed_error(const svc_action_t *op);
  85 
  86 G_GNUC_INTERNAL
  87 int services__authorization_error(const svc_action_t *op);
  88 
  89 G_GNUC_INTERNAL
  90 int services__configuration_error(const svc_action_t *op, bool is_fatal);
  91 
  92 G_GNUC_INTERNAL
  93 void services__handle_exec_error(svc_action_t * op, int error);
  94 
  95 G_GNUC_INTERNAL
  96 void services__set_cancelled(svc_action_t *action);
  97 
  98 G_GNUC_INTERNAL
  99 void services_add_inflight_op(svc_action_t *op);
 100 
 101 G_GNUC_INTERNAL
 102 void services_untrack_op(const svc_action_t *op);
 103 
 104 G_GNUC_INTERNAL
 105 gboolean is_op_blocked(const char *rsc);
 106 
 107 #if HAVE_DBUS
 108 G_GNUC_INTERNAL
 109 void services_set_op_pending(svc_action_t *op, DBusPendingCall *pending);
 110 #endif
 111 
 112 #ifdef __cplusplus
 113 }
 114 #endif
 115 
 116 #endif // PCMK__SERVICES_SERVICES_PRIVATE__H

/* [previous][next][first][last][top][bottom][index][help] */