From 2d3d121453b19003c6454e7c6b4ed98164e7d531 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Mon, 23 Nov 2009 16:28:57 +0200 Subject: Limit number of instances for inetd-style components. * src/pies.c (component_keywords): New keyword `max-instances'. * src/pies.h (struct component): New member: max_instances. * src/progman.c (struct prog): Rename count to failcount. All uses changed. New members num_instances and listener. (progman_accept): Keep track of the number of instances. Deny connection if it is greater than max_instances (unless the latter is 0). (progman_cleanup): Keep track of the number of instances in inetd listeners. --- src/pies.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pies.h') diff --git a/src/pies.h b/src/pies.h index 3917e48..02211a2 100644 --- a/src/pies.h +++ b/src/pies.h @@ -151,6 +151,7 @@ struct component gl_list_t prereq; /* Prerequisites */ gl_list_t depend; /* Dependency targets */ int flags; /* CF_ bitmask */ + size_t max_instances; /* Maximum number of running instances */ char *rmfile; /* Try to remove this file before starting */ struct pies_privs privs; /* UID/GIDS+groups to run under */ mode_t umask; /* Umask to install before starting */ -- cgit v1.2.1