diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@intel.com> | 2020-11-04 10:02:36 +0100 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2020-11-25 18:15:55 -0500 |
commit | ff6bb131a46e1bac84a26e5b2c4bf408c0e56926 (patch) | |
tree | 3234e5a3eb4e383a298f4bd27254c812cd222059 /mdadm.h | |
parent | a8f3cfd54e45c8aabc4a99cdc92b6b9080b26607 (diff) | |
download | mdadm-ff6bb131a46e1bac84a26e5b2c4bf408c0e56926.tar.gz |
mdadm: Unify forks behaviour
If mdadm is run by udev or systemd, it gets a pipe as each stream.
Forks in the background may run after an event or service has been
processed when udev is detached from pipe. As a result process
fails quietly if any message is written.
To prevent from it, each fork has to close all parent streams. Leave
stderr and stdout opened only for debug purposes.
Unify it across all forks. Introduce other descriptors detection by
scanning /proc/self/fd directory. Add generic method for
managing systemd services.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r-- | mdadm.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -129,6 +129,14 @@ struct dlm_lksb { #define FAILED_SLOTS_DIR "/run/mdadm/failed-slots" #endif /* FAILED_SLOTS */ +#ifndef MDMON_SERVICE +#define MDMON_SERVICE "mdmon" +#endif /* MDMON_SERVICE */ + +#ifndef GROW_SERVICE +#define GROW_SERVICE "mdadm-grow-continue" +#endif /* GROW_SERVICE */ + #include "md_u.h" #include "md_p.h" #include "bitmap.h" @@ -1497,6 +1505,8 @@ extern int is_standard(char *dev, int *nump); extern int same_dev(char *one, char *two); extern int compare_paths (char* path1,char* path2); extern void enable_fds(int devices); +extern void manage_fork_fds(int close_all); +extern int continue_via_systemd(char *devnm, char *service_name); extern int parse_auto(char *str, char *msg, int config); extern struct mddev_ident *conf_get_ident(char *dev); |