Browse code

- doc updates - new makefile target: make bin (creates a binary ser distribution) - various small fixes

Andrei Pelinescu-Onciul authored on 24/09/2002 16:16:20
Showing 7 changed files
... ...
@@ -15,16 +15,12 @@ TODO
15 15
 --we'll probably go for mysql dependancy,
16 16
   then INSTALL needs to be completely
17 17
   changed
18
-  ser binds to 127.0.0.1 -- not really good for
19
-  quick-start
20
-
21 18
 
22 19
 
23 20
 Installation Notes
24 21
 
25 22
 Supported arhitectures: Linux/i386, Linux/armv4l, FreeBSD/i386, Solaris/sparc64,
26
-Win*/i386 (CYGWIN)
23
+Win*/i386 (CYGWIN) - only the core
27 24
 (for other arhitectures the Makefile must be edited)
28 25
 
29 26
 There are various configuration options defined in the Makefile.
... ...
@@ -220,46 +216,3 @@ C) Troubleshooting
220 220
 listen
221 221
 aliases
222 222
 
223
-
224
-TROUBLES
225
-
226
-In the following config, ser bound itself to /dev/lo -- not
227
-good for quick start.
228
-
229
-
230
-[jiri@cat jiri]$ hostname -a
231
-localhost.localdomain localhost 
232
-[jiri@cat jiri]$ hostname
233
-cat
234
-[jiri@cat jiri]$ 
235
-
236
-
237
-[root@cat log]# uname -a
238
-Linux cat 2.4.18-3 #1 Thu Apr 18 07:37:53 EDT 2002 i686 unknown
239
-
240
-/etc/hosts
241
-
242
-# Do not remove the following line, or various programs
243
-# that require network functionality will fail.
244
-127.0.0.1       cat     localhost.localdomain   localhost
245
-
246
-
247
-[root@cat log]# /sbin/ifconfig 
248
-eth0      Link encap:Ethernet  HWaddr 00:08:02:38:D9:A0  
249
-          inet addr:192.168.0.16  Bcast:192.168.0.255  Mask:255.255.255.0
250
-          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
251
-          RX packets:152917 errors:0 dropped:0 overruns:0 frame:0
252
-          TX packets:87759 errors:0 dropped:0 overruns:0 carrier:0
253
-          collisions:35 txqueuelen:100 
254
-          RX bytes:216441566 (206.4 Mb)  TX bytes:5542812 (5.2 Mb)
255
-          Interrupt:5 Base address:0x7000 
256
-
257
-lo        Link encap:Local Loopback  
258
-          inet addr:127.0.0.1  Mask:255.0.0.0
259
-          UP LOOPBACK RUNNING  MTU:16436  Metric:1
260
-          RX packets:162 errors:0 dropped:0 overruns:0 frame:0
261
-          TX packets:162 errors:0 dropped:0 overruns:0 carrier:0
262
-          collisions:0 txqueuelen:0 
263
-          RX bytes:10568 (10.3 Kb)  TX bytes:10568 (10.3 Kb)
264
-
265
-
... ...
@@ -83,9 +83,17 @@ static_modules:
83 83
 dbg: ser
84 84
 	gdb -command debug.gdb
85 85
 
86
-
86
+.PHONY: tar
87 87
 tar: mantainer-clean 
88
-	tar -C .. -zcf ../$(NAME)-$(RELEASE)_src.tar.gz  $(notdir $(CURDIR)) 
88
+	$(TAR) -C .. -zcf ../$(NAME)-$(RELEASE)_src.tar.gz  $(notdir $(CURDIR)) 
89
+
90
+# binary dist. tar.gz
91
+.PHONY: bin
92
+bin:
93
+	mkdir -p tmp/ser/usr/local
94
+	$(MAKE) install prefix=tmp/ser/usr/local
95
+	$(TAR) -C tmp/ser/ -zcf ../$(NAME)-$(RELEASE)_$(OS)_$(ARCH).tar.gz .
96
+	rm -rf tmp/ser
89 97
 
90 98
 
91 99
 install: all mk-install-dirs install-cfg install-bin install-modules \
... ...
@@ -8,10 +8,10 @@
8 8
 VERSION = 0
9 9
 PATCHLEVEL = 8
10 10
 SUBLEVEL = 7
11
-EXTRAVERSION = -15-tests
11
+EXTRAVERSION = -16
12 12
 
13 13
 RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
14
-OS = $(shell uname -s)
14
+OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]")
15 15
 ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ )
16 16
 
17 17
 prefix = /usr/local
... ...
@@ -28,7 +28,15 @@ modules-dir = lib/ser/modules/
28 28
 doc-dir = share/doc/ser/
29 29
 man-dir = share/man/
30 30
 
31
+
32
+ifeq ($(OS), solaris)
33
+#use GNU versions
34
+INSTALL = ginstall
35
+TAR = gtar
36
+else
31 37
 INSTALL = install 
38
+TAR= tar
39
+endif
32 40
 INSTALL-CFG = $(INSTALL) -m 644
33 41
 INSTALL-BIN = $(INSTALL) -m 755
34 42
 INSTALL-MODULES = $(INSTALL) -m 755
... ...
@@ -431,7 +439,7 @@ ifeq ($(OS), Linux)
431 431
 	#same as common
432 432
 endif
433 433
 
434
-ifeq  ($(OS), SunOS)
434
+ifeq  ($(OS), solaris)
435 435
 	ifeq ($(mode), release)
436 436
 		#use these only if you're using gcc with Solaris ld
437 437
 		#LDFLAGS=-O2 $(PROFILE)
... ...
@@ -450,7 +458,7 @@ endif
450 450
 	# -lrt needed for sched_yield
451 451
 endif
452 452
 
453
-ifeq ($(OS), FreeBSD)
453
+ifeq ($(OS), freebsd)
454 454
 
455 455
 	YACC=yacc
456 456
 	LIBS= -lfl  #dlopen is in libc
... ...
@@ -20,10 +20,12 @@ Configuration files:
20 20
 	Global parameters:
21 21
 		- debug
22 22
 		- listen
23
+		- alias
23 24
 		- port
24 25
 		- fork
25 26
 		- children_no
26 27
 		- log_stderror
28
+		- fifo
27 29
 		- loadmodule "path/modulename"
28 30
 		...
29 31
 
... ...
@@ -38,12 +40,15 @@ Configuration files:
38 38
 			- uri
39 39
 			- method
40 40
 			- src_ip
41
-			- dst_ip [not working yet]
41
+			- dst_ip
42
+			- myself
42 43
 		Rvalues:
43 44
 			- string
44 45
 			- integer
45 46
 			- ipv4 or ipv6 address
46 47
 			- netv4 or netv6 address
48
+			- myself (matches any uri or ip address the server listens on or 
49
+			 registered as an alias for the server)
47 50
 			
48 51
 	Commands:
49 52
 		- forward
... ...
@@ -1163,7 +1163,9 @@ int main(int argc, char** argv)
1163 1163
 		r++;
1164 1164
 	}
1165 1165
 	/* get ips & fill the port numbers*/
1166
+#ifdef EXTRA_DEBUG
1166 1167
 	printf("Listening on \n");
1168
+#endif
1167 1169
 	for (r=0; r<sock_no;r++){
1168 1170
 		he=resolvehost(sock_info[r].name.s);
1169 1171
 		if (he==0){
... ...
@@ -1228,8 +1230,10 @@ int main(int argc, char** argv)
1228 1228
 		strncpy(sock_info[r].port_no_str.s, port_no_str, strlen(port_no_str)+1);
1229 1229
 		sock_info[r].port_no_str.len=strlen(port_no_str);
1230 1230
 		
1231
+#ifdef EXTRA_DEBUG
1231 1232
 		printf("              %s [%s]:%s\n",sock_info[r].name.s,
1232 1233
 				sock_info[r].address_str.s, sock_info[r].port_no_str.s);
1234
+#endif
1233 1235
 	}
1234 1236
 	/* removing duplicate addresses*/
1235 1237
 	for (r=0; r<sock_no; r++){
... ...
@@ -1240,10 +1244,11 @@ int main(int argc, char** argv)
1240 1240
 						sock_info[t].address.u.addr,
1241 1241
 						sock_info[r].address.len)  == 0)
1242 1242
 				){
1243
+#ifdef EXTRA_DEBUG
1243 1244
 				printf("removing duplicate (%d) %s [%s] == (%d) %s [%s]\n",
1244 1245
 						r, sock_info[r].name.s, sock_info[r].address_str.s,
1245 1246
 						t, sock_info[t].name.s, sock_info[t].address_str.s);
1246
-				
1247
+#endif
1247 1248
 				/* add the name to the alias list*/
1248 1249
 				if ((!sock_info[t].is_ip) && (
1249 1250
 						(sock_info[t].name.len!=sock_info[r].name.len)||
... ...
@@ -45,32 +45,32 @@ struct t_stats *cur_stats, *acc_stats;
45 45
 int print_stats(  FILE *f )
46 46
 {
47 47
 	fprintf(f, "Current:\n");
48
-	fprintf(f, "# of transactions: %ld, ", 
48
+	fprintf(f, "# of transactions: %10lu, ", 
49 49
 		cur_stats->transactions );
50
-	fprintf(f, "local: %ld, ",
50
+	fprintf(f, "local: %10lu, ",
51 51
 		cur_stats->client_transactions );
52
-	fprintf(f, "waiting: %ld" CLEANUP_EOL ,
52
+	fprintf(f, "waiting: %10lu" CLEANUP_EOL ,
53 53
 		cur_stats->waiting );
54 54
 
55 55
 	fprintf(f, "Total:\n");
56
-	fprintf(f, "# of transactions: %ld,",
56
+	fprintf(f, "# of transactions: %10lu,",
57 57
 		acc_stats->transactions );
58
-	fprintf(f, " local: %ld,",
58
+	fprintf(f, " local: %10lu,",
59 59
 		acc_stats->client_transactions );
60
-	fprintf(f, " waiting: %ld" CLEANUP_EOL ,
60
+	fprintf(f, " waiting: %10lu" CLEANUP_EOL ,
61 61
 		acc_stats->waiting );
62 62
 
63
-	fprintf(f, "Replied localy: %ld" CLEANUP_EOL ,
63
+	fprintf(f, "Replied localy: %10lu" CLEANUP_EOL ,
64 64
 		acc_stats->replied_localy );
65
-	fprintf(f, "Completion status 6xx: %ld,",
65
+	fprintf(f, "Completion status 6xx: %10lu,",
66 66
 		acc_stats->completed_6xx );
67
-	fprintf(f, " 5xx: %ld,",
67
+	fprintf(f, " 5xx: %10lu,",
68 68
 		acc_stats->completed_5xx );
69
-	fprintf(f, " 4xx: %ld,",
69
+	fprintf(f, " 4xx: %10lu,",
70 70
 		acc_stats->completed_4xx );
71
-	fprintf(f, " 3xx: %ld,",
71
+	fprintf(f, " 3xx: %10lu,",
72 72
 		acc_stats->completed_3xx );
73
-	fprintf(f, "2xx: %ld" CLEANUP_EOL ,
73
+	fprintf(f, "2xx: %10lu" CLEANUP_EOL ,
74 74
 		acc_stats->completed_2xx );
75 75
 	
76 76
 	return 1;
... ...
@@ -100,5 +100,6 @@ ser gcc3.2         20             704  725       1137  1202      1460  1575
100 100
 
101 101
 stress:
102 102
 test calls: 1000000
103
-                   20          100 procs (cps)
103
+                  100          100 procs (cps)
104
+                                   107* - out of mem
104 105