diff options
Diffstat (limited to 'src/pies.h')
-rw-r--r-- | src/pies.h | 28 |
1 files changed, 21 insertions, 7 deletions
@@ -1,5 +1,5 @@ /* This file is part of GNU Pies. - Copyright (C) 2008-2021 Sergey Poznyakoff + Copyright (C) 2008-2023 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -99,10 +99,15 @@ enum return_action #define STATUS_SIG_BIT 0x80000000 #define STATUS_CODE(c) ((c) & ~STATUS_SIG_BIT) +struct status_cond +{ + unsigned status; + int neg; +}; + struct action { - size_t nstat; - unsigned *status; + struct grecs_list *cond_list; /* List of status conditions. */ enum return_action act; /* Action to take when the component terminates */ char *addr; /* Addresses to notify about it. */ char *message; /* Notification mail. */ @@ -244,6 +249,8 @@ struct component struct pies_privs privs; /* UID/GIDS+groups to run as */ mode_t umask; /* Umask to install before starting */ limits_record_t limits; /* System limits */ + int sigterm; /* Signal to terminate the process */ + unsigned long shutdown_seqno; /* Shutdown sequence number */ /* For exec (init) components */ char *runlevels; @@ -336,7 +343,8 @@ void config_file_remove_all (void); void free_redirector (struct redirector *rp); void pies_schedule_action (int act); -void free_action (struct action *act); + +void listel_dispose (void *el); void argv_free (char **argv); @@ -358,7 +366,11 @@ void progman_start (void); void progman_gc (void); void progman_wake_sleeping (int); void progman_stop (void); -void progman_cleanup (int expect_term); + +#define CLEANUP_DEFAULT 0 +#define CLEANUP_EXPECT_TERM 1 + +void progman_cleanup (int flags); void progman_filter (int (*filter) (struct component *, void *data), void *data); int progman_accept (int socket, void *data); @@ -378,8 +390,8 @@ int check_acl (pies_acl_t acl, struct sockaddr *s, socklen_t salen, pies_identity_t identity); void log_setup (int want_stderr); -void signal_setup (RETSIGTYPE (*sf)(int)); -void setsigvhan (RETSIGTYPE (*handler) (int signo), int *sigv, int sigc); +void signal_setup (void (*sf)(int)); +void setsigvhan (void (*handler) (int signo), int *sigv, int sigc); void add_extra_sigv (int *sigv, int sigc); typedef struct pies_depmap *pies_depmap_t; @@ -448,6 +460,8 @@ int component_foreach (int (*filter) (struct component *, void *), void components_dump_depmap (void); void components_trace (char **argv, enum pies_depmap_direction dir); +void components_list_shutdown_sequence (void); +size_t components_shutdown_sequence_numbers (unsigned long **ret); struct component *component_depmap_first (enum pies_depmap_direction dir, size_t idx, pies_depmap_pos_t *ppos); |