Skip to content

Commit 3f7ab1f

Browse files
jfsmigfvennetier
authored andcommitted
Increase the signal/noise ratio
1 parent 71bf1dc commit 3f7ab1f

File tree

2 files changed

+16
-163
lines changed

2 files changed

+16
-163
lines changed

lib/children.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -628,12 +628,6 @@ supervisor_children_start_enabled(void *udata, supervisor_cb_f cb)
628628
return count;
629629
}
630630

631-
guint
632-
supervisor_children_startall(void *udata, supervisor_cb_f cb)
633-
{
634-
return supervisor_children_start_enabled(udata, cb);
635-
}
636-
637631
guint
638632
supervisor_children_mark_obsolete(void)
639633
{
@@ -666,26 +660,6 @@ supervisor_children_disable_obsolete(void)
666660
return count;
667661
}
668662

669-
guint
670-
supervisor_children_kill_obsolete(void)
671-
{
672-
guint count;
673-
struct child_s *sd;
674-
675-
count = 0U;
676-
677-
FOREACH_CHILD(sd) {
678-
if (FLAG_HAS(sd,MASK_OBSOLETE)) {
679-
if (sd->pid > 0) {
680-
_child_stop(sd);
681-
count ++;
682-
}
683-
}
684-
}
685-
686-
return count;
687-
}
688-
689663
guint
690664
supervisor_children_catharsis(void *udata, supervisor_cb_f cb)
691665
{

lib/gridinit-utils.h

Lines changed: 16 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,13 @@ typedef void (supervisor_cb_f) (void *udata, struct child_info_s *ci);
7575

7676
void supervisor_children_init(void);
7777

78-
/**
79-
* Sets an optional function that will be used just after the fork
80-
*/
78+
/* Sets an optional function that will be used just after the fork */
8179
void supervisor_set_callback_postfork(supervisor_postfork_f *cb, void *udata);
8280

8381
void supervisor_children_fini(void);
8482

8583
guint supervisor_children_cleanall(void);
8684

87-
/**
88-
* @deprecated use supervisor_children_kill() instead
89-
*/
90-
guint supervisor_children_startall(void *udata, supervisor_cb_f cb);
91-
9285
void supervisor_children_stopall(guint max_retries);
9386

9487
guint supervisor_children_killall(int sig);
@@ -97,201 +90,87 @@ guint supervisor_children_catharsis(void *udata, supervisor_cb_f cb);
9790

9891
gboolean supervisor_children_register(const gchar *key, const gchar *cmd);
9992

100-
/**
101-
* Marks the services still obsolete as DISABLED and to be stopped.
102-
* Services still carry the OBSOLETE flag after this step.
103-
*/
93+
/* Marks the services still obsolete as DISABLED and to be stopped.
94+
Services still carry the OBSOLETE flag after this step. */
10495
guint supervisor_children_disable_obsolete(void);
10596

106-
/**
107-
* @deprecated will be deleted soon, please use supervisor_children_disable_obsolete() then supervisor_children_kill_disabled()
108-
*/
109-
guint supervisor_children_kill_obsolete(void);
110-
111-
/**
112-
* Mark all the services as obsolete.
113-
* This is used when reloading a configuration.
114-
*/
97+
/* Mark all the services as obsolete. This is used when reloading a config. */
11598
guint supervisor_children_mark_obsolete(void);
11699

117-
/**
118-
* Stops the UP services that are in state that does not allow them to run.
119-
*
120-
* This includes services DOWN, BROKEN, STOPPED, DISABLED.
121-
* Will send SIGKILL until expiration, then SIGTERM.
122-
*/
100+
/* Stops the UP services that are in state that does not allow them to run.
101+
This includes services DOWN, BROKEN, STOPPED, DISABLED.
102+
Will send SIGKILL until expiration, then SIGTERM. */
123103
guint supervisor_children_kill_disabled(void);
124104

125-
/**
126-
* starts allt the stopped services in a state proper to be restarted
127-
*/
105+
/* starts allt the stopped services in a state proper to be restarted */
128106
guint supervisor_children_start_enabled(void *udata, supervisor_cb_f cb);
129107

130-
/**
131-
* Sets the 'enabled' flag on the service
132-
*/
108+
/* Sets the 'enabled' flag on the service */
133109
int supervisor_children_enable(const char *key, gboolean enable);
134110

135-
/**
136-
* Sets the 'autorespawn' flag on this service
137-
*/
111+
/* Sets the 'autorespawn' flag on this service */
138112
int supervisor_children_set_respawn(const char *key, gboolean enabled);
139113

140-
/**
141-
* Marks the service to be started or stopped.
142-
*/
114+
/* Marks the service to be started or stopped. */
143115
int supervisor_children_status(const char *key, gboolean to_be_started);
144116

145-
/**
146-
* Starts a service that died too often
147-
*/
117+
/* Starts a service that died too often */
148118
int supervisor_children_repair(const char *key);
149119

150-
/**
151-
* Sets/Disable the "delayed restart" behavior for a process
152-
*/
120+
/* Sets/Disable the "delayed restart" behavior for a process */
153121
int supervisor_children_set_delay(const char *key, gboolean enabled);
154122

155-
/**
156-
* Calls supervisor_children_repair() on each broken service
157-
*/
123+
/* Calls supervisor_children_repair() on each broken service */
158124
int supervisor_children_repair_all(void);
159125

160-
/**
161-
* Restart a service
162-
*/
126+
/* Restart a service */
163127
int supervisor_children_restart(const char *key);
164128

165-
/**
166-
*
167-
*/
168129
int supervisor_children_set_limit(const gchar *key,
169130
enum supervisor_limit_e what, gint64 value);
170131

171-
/**
172-
* Runs the children list and call the callback fnction on each
173-
* element
174-
*/
132+
/* Runs the children list and call the callback fnction on each element */
175133
gboolean supervisor_run_services(void *ptr, supervisor_cb_f callback);
176134

177-
/**
178-
*
179-
* @param key
180-
* @param dir
181-
* @return
182-
*/
183135
int supervisor_children_set_working_directory(const gchar *key,
184136
const gchar *dir);
185137

186-
/**
187-
*
188-
* @param key
189-
* @param envkey
190-
* @param envval
191-
* @param separator if not 0, keep the previous value and prepends the new value
192-
* @return
193-
*/
194138
int supervisor_children_setenv(const gchar *key, const gchar *envkey,
195139
const gchar *envval, gchar separator);
196140

197141
void supervisor_children_inherit_env(const gchar *key);
198142

199-
/**
200-
*
201-
* @param key
202-
* @return
203-
*/
204143
int supervisor_children_clearenv(const gchar *key);
205144

206-
/**
207-
* @param key
208-
* @param flags
209-
* @return
210-
*/
211145
int supervisor_children_set_user_flags(const gchar *key, guint32 flags);
212146

213-
/**
214-
* @param key
215-
* @param flags
216-
* @return
217-
*/
218147
int supervisor_children_del_user_flags(const gchar *key, guint32 flags);
219148

220-
/**
221-
* @param key
222-
* @param group NULL to clear the group
223-
* @return
224-
*/
225149
int supervisor_children_set_group(const gchar *key, const gchar *group);
226150

227-
/**
228-
*
229-
* @param key
230-
* @param ci
231-
* @return
232-
*/
233151
int supervisor_children_get_info(const gchar *key, struct child_info_s *ci);
234152

235-
/**
236-
*
237-
* @param key
238-
* @param uid
239-
* @param gid
240-
* @return
241-
*/
242153
int supervisor_children_set_ids(const gchar *key, gint32 uid, gint32 gid);
243154

244155
int supervisor_children_set_delay_sigkill(const char *key, time_t delay);
245156

246157
/* Fork and pipe ----------------------------------------------------------- */
247158

248-
/**
249-
*
250-
* @param str_cmd
251-
* @return
252-
*/
253159
int command_get_pipe(const gchar *str_cmd);
254160

255161
/* Privileges -------------------------------------------------------------- */
256162

257-
/**
258-
*
259-
* @param user_name
260-
* @param group_name
261-
* @param error
262-
* @return
263-
*/
264163
gboolean supervisor_rights_init(const char *user_name, const char *group_name,
265164
GError ** error);
266165

267-
/**
268-
*
269-
* @return
270-
*/
271166
int supervisor_rights_gain(void);
272167

273-
/**
274-
*
275-
* @return
276-
*/
277168
int supervisor_rights_lose(void);
278169

279170
/* Processus limits */
280171

281-
/**
282-
*
283-
* @param what
284-
* @param value
285-
* @return
286-
*/
287172
int supervisor_limit_set(enum supervisor_limit_e what, gint64 value);
288173

289-
/**
290-
*
291-
* @param what
292-
* @param value
293-
* @return
294-
*/
295174
int supervisor_limit_get(enum supervisor_limit_e what, gint64 *value);
296175

297176
#endif

0 commit comments

Comments
 (0)