You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jim Jagielski <ji...@jaguNET.com> on 1997/11/05 11:11:50 UTC

[PATCH] Make FLOCK mutex work PR#1056 (Take II)

This includes the suggestions of Dean and Marc... For the nonce
I'm electing that the child _not_ create the lockfile if it doesn't
exist. We may want to think about that :/

Index: src/main/http_main.c
===================================================================
RCS file: /export/home/cvs/apachen/src/main/http_main.c,v
retrieving revision 1.243
diff -u -r1.243 http_main.c
--- http_main.c	1997/11/03 10:11:42	1.243
+++ http_main.c	1997/11/05 10:09:33
@@ -276,6 +276,8 @@
 
 #define accept_mutex_cleanup()
 
+#define accept_mutex_child_init(x)
+
 static void accept_mutex_init(pool *p)
 {
     ptrdiff_t old;
@@ -347,6 +349,8 @@
     }
 }
 
+#define accept_mutex_child_init(x)
+
 static void accept_mutex_init(pool *p)
 {
     pthread_mutexattr_t mattr;
@@ -435,6 +439,7 @@
     semctl(sem_id, 0, IPC_RMID, ick);
 }
 
+#define accept_mutex_child_init(x)
 
 static void accept_mutex_init(pool *p)
 {
@@ -508,6 +513,8 @@
 
 #define accept_mutex_cleanup()
 
+#define accept_mutex_child_init(x)
+
 /*
  * Initialize mutex lock.
  * Must be safe to call this on a restart.
@@ -563,23 +570,40 @@
 
 static int lock_fd = -1;
 
-#define accept_mutex_cleanup()
+static void accept_mutex_cleanup(void)
+{
+    unlink(lock_fname);
+}
 
 /*
  * Initialize mutex lock.
+ * Done by each child at it's birth
+ */
+static void accept_mutex_child_init(pool *p)
+{
+
+    lock_fd = popenf(p, lock_fname, O_WRONLY, 0600);
+    if (lock_fd == -1) {
+	aplog_error(APLOG_MARK, APLOG_EMERG, server_conf,
+		    "Child cannot open lock file: %s\n", lock_fname);
+	exit(1);
+    }
+}
+/*
+ * Initialize mutex lock.
  * Must be safe to call this on a restart.
  */
 static void accept_mutex_init(pool *p)
 {
 
     expand_lock_fname(p);
-    lock_fd = popenf(p, lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0644);
+    unlink(lock_fname);
+    lock_fd = popenf(p, lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0600);
     if (lock_fd == -1) {
 	aplog_error(APLOG_MARK, APLOG_EMERG, server_conf,
-		    "Cannot open lock file: %s\n", lock_fname);
+		    "Parent cannot open lock file: %s\n", lock_fname);
 	exit(1);
     }
-    unlink(lock_fname);
 }
 
 static void accept_mutex_on(void)
@@ -614,6 +638,7 @@
  * the sockets. */
 #define NO_SERIALIZED_ACCEPT
 #define accept_mutex_cleanup()
+#define accept_mutex_child_init(x)
 #define accept_mutex_init(x)
 #define accept_mutex_on()
 #define accept_mutex_off()
@@ -2623,6 +2648,7 @@
 
     /* needs to be done before we switch UIDs so we have permissions */
     reopen_scoreboard(pconf);
+    SAFE_ACCEPT(accept_mutex_child_init(pconf));
 
 #ifdef MPE
     /* Only try to switch if we're running as MANAGER.SYS */
-- 
====================================================================
      Jim Jagielski            |       jaguNET Access Services
     jim@jaguNET.com           |       http://www.jaguNET.com/
            "Look at me! I'm wearing a cardboard belt!"

Re: Related-Project admission request

Posted by Rob Hartill <ro...@imdb.com>.
On Wed, 5 Nov 1997, Giovanni Maruzzelli wrote:

> Hi Apache Group Members and followers,
 

 
> ========================================================================
> TEXT OF THE ANNOUNCE
> 
> November 5th 1997
> 
> Matrice srl Proudly Announces:
> 
> 	Pre-Beta distribution of Matrice W3 System for Linux (x86)
> 	(Apache-based, MySQL backed webserving solution)
 
> After some two years of development and testing, Matrice W3 System
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

really ?

we must make it easier for people to write modules  >;-)



Related-Project admission request

Posted by Giovanni Maruzzelli <ma...@matrice.it>.
Hi Apache Group Members and followers,

We are a startup company located in the horrible Milano in the beatyful
Italy. 

We've developed a product, named Matrice W3 System, that is a software
package that comprises an installation utility, a Web Server that uses
Apache with Ben Laurie patches for SSL as code base, a cgi for the
configuration of the web server, an ODBC Driver Manager (only for the Unix
version), a SQL rdbms, a win32 odbc driver for the database, an Unix
odbc driver for the database (for the unix version), a win95 application
for accounting, statistics and billing purposes.

After the pre-beta and beta periods, we want to sell the package.

In the pre-beta and beta periods no source code will be made available to
the public, and in the commercial period we will give full source codes
(for all the apps that comprises the package), only to whom buys the
"developer licence", that will cost far more than the "normal" licence.
The developer licence will entitle the buyer to modify the package for
internal use only, not to disclose the source code to third parties nor to
redistribute the package or parts of it.

The Matrice W3 System includes the original Apache Group documentation
for the Apache Web Server in addition to the documentation of what is
specific of our implementation, and to the documentation of the database,
etc...

We follow the statements in the LICENCE for giving credit to the
Apache Group and Project for the code base, and our implementation will
return "Matrice/x.xx Apache/x.x.x Ben/x.x.x" in the replies.

We are about to start with the international distribution of the pre-beta
version of Matrice W3 System, while we have yet done some test
distribution for italian speaking people to test the installation
procedures.

The primary purposes for our package is the sale of informations or of the
access to applications online.
Side effects (on which we put confiance) are the access control, and the
marketing analisys of the traffic.

The package is robust and stable, is running since October 1996 at the
Sole 24 Ore site (www.ilsole24ore.it) that is the major financial
newspaper in Italy, where it manages also the sale of database accesses
("Banche Dati On Line").


We would like to be enclosed in the "Related Project" page on the Apache
Group Web Server


Thanks in advance,

	Giovanni Maruzzelli

P.S. it follows a very short description of the web server part of the
package. Obviously we can give much more informations, and also give
directly the package and his documentation.

P.P.S it follows the announce sent to this and other mailing lists and
newsgroups 
==========================================================================
DESCRIPTION OF THE WEB SERVER


We developed two modules on top of the apache code base (and a bunch of
utilities these modules use), that do their job at the authorization and
logging level, checking trough ODBC the account of end users and writing
the transaction in the database. 

In addition to that, we slightly modified the mod_cgi.c and util_script.c.

mod_cgi.c in our package calls one of our function to build an md5 hash of
the request, complete of POST or GET arguments, that we use as an
indicator of what the user really ask the CGI (to compute a period of
grace during which you are allowed to ask the same request without be
accounted again). 

util_script.c in our package makes one read_table more on the mime headers
results of the CGI, searching for the MIME header "Matrice: ".

If this header is present, mod_cgi.c redirects the request in a way that
our modules are utilised again, using the information in the "Matrice: " 
header as override for the settings as cost for document, etc.  that are
written in the config file of the web server.

========================================================================
TEXT OF THE ANNOUNCE

November 5th 1997

Matrice srl Proudly Announces:

	Pre-Beta distribution of Matrice W3 System for Linux (x86)
	(Apache-based, MySQL backed webserving solution)



After some two years of development and testing, Matrice W3 System
(MWS) is available for you to try and/or download at :

		http://www.matrice.it/beta_eng.html

MWS is a complete solution for your web presence that enables you to access
control, tracking, accounting, billing, marketing analyse the end user's
accesses to your site.

Matrice W3 System is running since 1996 the Sole 24 Ore web site 
http://www.ilsole24ore.it, the most important Italian financial newspaper 
(more than 1500 thousand hits/day, just asked) where notably it manages
the for pay accesses to "Banche Dati Online", the premium financial and
economic data-base, in addition to all the traffic for registered and
unregistered users.

Never dreamed of a package that gives you the power, reliability and 
throughput of Apache, with the ease of a graphical web based interface to 
manage all of its features (and vhosts) with simple point and click, with
the added security of SSL v3 encryption, intertwined (through ODBC) to your
database engine of choice to manage authorization, intranet security, selling
information with 7 different accounting models, graphical and tabular
analisys of end-users activity, deep marketing stats, reports on banners and
advertising redemption, down to printing the invoices or usage reports for
your subscribers?

MWS comprises 6 major components:

	-an SSL v3 capable WebServer (based on and compatible with Apache)

	-a graphic HTML interface to configure and manage the server (via SSL)

	-an Office 97 based application for data entry, end users management, 
	 statistic reports, marketing analisys, accounting and billing

	-a relational SQL database (mySQL) on which the contracts, end users,
	 accesses, transactions data reside

	-an installation utility

	-documentation

This pre-beta release of Matrice W3 System is a bit rough, not for the 
fainted-hearts.

This release is only for Linux on Intel machines with kernel 2.0 or later,
and will stop working January the first 1998.

The data-entry, accounting, statistics application needs a Win95 machine 
(connected through a LAN to the Linux machine) to run on.

Releases for other operating systems (also for NT) will be announced in the
next weeks.

Press contacts:
		e-mail:	info@matrice.it
		fax:	+39 2 2952 0528

==============================================================================
Matrice W3 System contains code developed by the Apache Group for the Apache
HTTPD Project (http://www.apache.org/).

Matrice W3 System contains code developed by Ben Laurie for use in the Apache-
SSL HTTP Project (http://www.algroup.co.uk/Apache-SSL/).

Matrice W3 System contains code developed by Eric Young and Tim Hudson for use
in the SSLeay projecti (http://www.cryptsoft.com/).

Matrice W3 System is distributed with the MySQL relational Database engine
developed by TCX DataConsult AB (http://www.tcx.se/).

Matrice srl (http://www.matrice.it/) is an Italian company, based in Milano,
dedicated to provide its customers with technologies and solutions for 
industry grade Internet/intranet presence.


=============================================================================


 
          ***********************************************
          *                                             *
          *                                             *
          *    MATRICE srl                              *
          *    Information Technology Solutions         *
          *                                             *
          *    Giovanni Maruzzelli                      *
          *                                             *
          *                                             *
          *    tel. (+39)(2)2952 0481                   *
          *    fax  (+39)(2)2952 0528                   *
          *    maruzz@matrice.it                        *
          *    http://www.matrice.it                    *
          ***********************************************