put dx.pl into an explicit handle sub
[spider.git] / perl / cluster.pl
1 #!/usr/bin/env perl
2 #
3 # This is the DX cluster 'daemon'. It sits in the middle of its little
4 # web of client routines sucking and blowing data where it may.
5 #
6 # Hence the name of 'spider' (although it may become 'dxspider')
7 #
8 # Copyright (c) 1998 Dirk Koopman G1TLH
9 #
10 #
11 #
12
13 package main;
14
15 require 5.10.1;
16 use warnings;
17
18 use vars qw($root $is_win $systime $lockfn @inqueue $starttime $lockfn @outstanding_connects
19                         $zombies @listeners $lang $myalias @debug $userfn $clusteraddr
20                         $clusterport $mycall $decease $routeroot $me $reqreg $bumpexisting
21                         $allowdxby $dbh $dsn $dbuser $dbpass $do_xml $systime_days $systime_daystart
22                         $can_encode $maxconnect_user $maxconnect_node $idle_interval $log_flush_interval
23                         $broadcast_debug 
24                    );
25
26 $lang = 'en';                                   # default language
27 $clusteraddr = '127.0.0.1';             # cluster tcp host address - used for things like console.pl
28 $clusterport = 27754;                   # cluster tcp port
29 $yes = 'Yes';                                   # visual representation of yes
30 $no = 'No';                                             # ditto for no
31 $user_interval = 11*60;                 # the interval between unsolicited prompts if no traffic
32
33 # make sure that modules are searched in the order local then perl
34 BEGIN {
35         umask 002;
36
37         # take into account any local::lib that might be present
38         eval {
39                 require local::lib;
40         };
41         import local::lib unless ($@);
42
43         # root of directory tree for this system
44         $root = "/spider";
45         $root = $ENV{'DXSPIDER_ROOT'} if $ENV{'DXSPIDER_ROOT'};
46
47         unshift @INC, "$root/perl";     # this IS the right way round!
48         unshift @INC, "$root/local";
49
50         # do some validation of the input
51         die "The directory $root doesn't exist, please RTFM" unless -d $root;
52         die "$root/local doesn't exist, please RTFM" unless -d "$root/local";
53         die "$root/local/DXVars.pm doesn't exist, please RTFM" unless -e "$root/local/DXVars.pm";
54
55         # create some directories
56         mkdir "$root/local_cmd", 02774 unless -d "$root/local_cmd";
57
58         # locally stored data lives here
59         my $local_data = "$root/local_data";
60         mkdir $local_data, 02774 unless -d $local_data;
61
62         # try to create and lock a lockfile (this isn't atomic but
63         # should do for now
64         $lockfn = "$root/local_data/cluster.lck";       # lock file name
65         if (-w $lockfn) {
66                 open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!";
67                 my $pid = <CLLOCK>;
68                 if ($pid) {
69                         chomp $pid;
70                         if (kill 0, $pid) {
71                                 warn "Lockfile ($lockfn) and process $pid exist, another cluster running?\n";
72                                 exit 1;
73                         }
74                 }
75                 unlink $lockfn;
76                 close CLLOCK;
77         }
78         open(CLLOCK, ">$lockfn") or die "Can't open Lockfile ($lockfn) $!";
79         print CLLOCK "$$\n";
80         close CLLOCK;
81
82         $is_win = ($^O =~ /^MS/ || $^O =~ /^OS-2/) ? 1 : 0; # is it Windows?
83         $systime = time;
84         
85 }
86
87 use DXVars;
88 use SysVar;
89
90 use strict;
91
92 use Mojolicious 7.26;
93
94 use Mojo::IOLoop;
95
96 use DXDebug;
97 use Msg;
98 use IntMsg;
99 use Internet;
100 use Listeners;
101 use ExtMsg;
102 use AGWConnect;
103 use AGWMsg;
104 use DXLog;
105 use DXLogPrint;
106 use DXUtil;
107 use DXChannel;
108 use DXUser;
109 use DXM;
110 use DXCommandmode;
111 use DXProtVars;
112 use DXProtout;
113 use DXProt;
114 use DXMsg;
115 use DXCron;
116 use DXConnect;
117 use DXBearing;
118 use DXDb;
119 use DXHash;
120 use DXDupe;
121 use Script;
122 use Prefix;
123 use Spot;
124 use Bands;
125 use Keps;
126 use Minimuf;
127 use Sun;
128 use Geomag;
129 use CmdAlias;
130 use Filter;
131 use AnnTalk;
132 use BBS;
133 use WCY;
134 use BadWords;
135 use Timer;
136 use Route;
137 use Route::Node;
138 use Route::User;
139 use Editable;
140 use Mrtg;
141 use USDB;
142 use UDPMsg;
143 use QSL;
144 use DXXml;
145 use DXSql;
146 use IsoTime;
147 use BPQMsg;
148
149 use Data::Dumper;
150 use IO::File;
151 use Fcntl ':flock';
152 use POSIX ":sys_wait_h";
153 use Version;
154 use Web;
155
156 use Local;
157
158
159 @inqueue = ();                                  # the main input queue, an array of hashes
160 $systime = 0;                                   # the time now (in seconds)
161 $starttime = 0;                 # the starting time of the cluster
162 @outstanding_connects = ();     # list of outstanding connects
163 @listeners = ();                                # list of listeners
164 $reqreg = 0;                                    # 1 = registration required, 2 = deregister people
165 $bumpexisting = 1;                              # 1 = allow new connection to disconnect old, 0 - don't allow it
166 $allowdxby = 0;                                 # 1 = allow "dx by <othercall>", 0 - don't allow it
167 $maxconnect_user = 3;                   # the maximum no of concurrent connections a user can have at a time
168 $maxconnect_node = 0;                   # Ditto but for nodes. In either case if a new incoming connection
169                                                                 # takes the no of references in the routing table above these numbers
170                                                                 # then the connection is refused. This only affects INCOMING connections.
171 $idle_interval = 0.500;         # the wait between invocations of the main idle loop processing.
172 $log_flush_interval = 2;                # interval to wait between log flushes
173
174 our $ending;                                    # signal that we are ending;
175 our $broadcast_debug;                   # allow broadcasting of debug info down "enhanced" user connections
176 our $clssecs;                                   # the amount of cpu time the DXSpider process have consumed
177 our $cldsecs;                                   # the amount of cpu time any child processes have consumed
178
179
180 # send a message to call on conn and disconnect
181 sub already_conn
182 {
183         my ($conn, $call, $mess) = @_;
184
185         $conn->disable_read(1);
186         dbg("-> D $call $mess\n") if isdbg('chan');
187         $conn->send_now("D$call|$mess");
188         sleep(2);
189         $conn->disconnect;
190 }
191
192 # handle incoming messages
193 sub new_channel
194 {
195         my ($conn, $msg) = @_;
196         my ($sort, $call, $line) = DXChannel::decode_input(0, $msg);
197         return unless defined $sort;
198
199         my ($dxchan, $user);
200         
201         if (is_webcall($call) && $conn->isa('IntMsg')) {
202                 my $newcall = find_next_webcall();
203                 unless ($newcall) {
204                         already_conn($conn, $call, "Maximum no of web connected connects ($Web::maxssid) exceeded");
205                         return;
206                 }
207                 $call = $newcall;
208                 $user = DXUser::get_current($call);
209                 unless ($user) {
210                         $user = DXUser->new($call);
211                         $user->sort('W');
212                         $user->wantbeep(0);
213                         $user->name('web');
214                         $user->qth('on the web');
215                         $user->homenode($main::mycall);
216                         $user->lat($main::mylatitude);
217                         $user->long($main::mylongitude);
218                         $user->qra($main::mylocator);
219                 }
220                 $conn->conns($call);
221                 $dxchan = Web->new($call, $conn, $user);
222                 $dxchan->enhanced(1);
223                 $dxchan->ve7cc(1);
224                 $msg =~ s/^A#WEB|/A$call|/;
225                 $conn->send_now("C$call");
226         } else {
227                 # "Normal" connections
228                 unless (is_callsign($call)) {
229                         already_conn($conn, $call, DXM::msg($lang, "illcall", $call));
230                         return;
231                 }
232
233                 # set up the basic channel info for "Normal" Users
234                 # is there one already connected to me - locally?
235         
236                 $user = DXUser::get_current($call);
237                 $dxchan = DXChannel::get($call);
238                 if ($dxchan) {
239                         if ($user && $user->is_node) {
240                                 already_conn($conn, $call, DXM::msg($lang, 'conother', $call, $main::mycall));
241                                 return;
242                         }
243                         if ($bumpexisting) {
244                                 my $ip = $dxchan->hostname;
245                                 $dxchan->send_now('D', DXM::msg($lang, 'conbump', $call, $ip));
246                                 LogDbg('DXCommand', "$call bumped off by $ip, disconnected");
247                                 $dxchan->disconnect;
248                         } else {
249                                 already_conn($conn, $call, DXM::msg($lang, 'conother', $call, $main::mycall));
250                                 return;
251                         }
252                 }
253                 
254                 # (fairly) politely disconnect people that are connected to too many other places at once
255                 my $r = Route::get($call);
256                 if ($conn->{sort} && $conn->{sort} =~ /^I/ && $r && $user) {
257                         my @n = $r->parents;
258                         my $m = $r->isa('Route::Node') ? $maxconnect_node : $maxconnect_user;
259                         my $c = $user->maxconnect;
260                         my $v;
261                         $v = defined $c ? $c : $m;
262                         if ($v && @n >= $v) {
263                                 my $nodes = join ',', @n;
264                                 LogDbg('DXCommand', "$call has too many connections ($v) at $nodes - disconnected");
265                                 already_conn($conn, $call, DXM::msg($lang, 'contomany', $call, $v, $nodes));
266                                 return;
267                         }
268                 }
269                 
270                 # is he locked out ?
271                 my $basecall = $call;
272                 $basecall =~ s/-\d+$//;
273                 my $baseuser = DXUser::get_current($basecall);
274                 my $lock = $user->lockout if $user;
275                 if ($baseuser && $baseuser->lockout || $lock) {
276                         if (!$user || !defined $lock || $lock) {
277                                 my $host = $conn->peerhost;
278                                 LogDbg('DXCommand', "$call on $host is locked out, disconnected");
279                                 $conn->disconnect;
280                                 return;
281                         }
282                 }
283
284                 if ($user) {
285                         $user->{lang} = $main::lang if !$user->{lang}; # to autoupdate old systems
286                 } else {
287                         $user = DXUser->new($call);
288                 }
289
290                 # create the channel
291                 if ($user->is_node) {
292                         $dxchan = DXProt->new($call, $conn, $user);
293                 } elsif ($user->is_user) {
294                         $dxchan = DXCommandmode->new($call, $conn, $user);
295                 } else {
296                         die "Invalid sort of user on $call = $sort";
297                 }
298                 
299                 # check that the conn has a callsign
300                 $conn->conns($call) if $conn->isa('IntMsg');
301         }
302         
303
304         # set callbacks
305         $conn->set_error(sub {my $err = shift; LogDbg('DXCommand', "Comms error '$err' received for call $dxchan->{call}"); $dxchan->disconnect(1);});
306         $conn->set_on_eof(sub {$dxchan->disconnect});
307         $conn->set_rproc(sub {my ($conn,$msg) = @_; $dxchan->rec($msg);});
308         if ($sort eq 'W') {
309                 $dxchan->enhanced(1);
310                 $dxchan->sort('W');
311         }
312         $dxchan->rec($msg);
313 }
314
315
316 sub login
317 {
318         return \&new_channel;
319 }
320
321 our $ceasing;
322
323 # cease running this program, close down all the connections nicely
324 sub cease
325 {
326         my $dxchan;
327
328         cluck("ceasing") if $ceasing; 
329         
330         return if $ceasing++;
331         
332         unless ($is_win) {
333                 $SIG{'TERM'} = 'IGNORE';
334                 $SIG{'INT'} = 'IGNORE';
335         }
336
337         DXUser::sync;
338
339         if (defined &Local::finish) {
340                 eval {
341                         Local::finish();   # end local processing
342                 };
343                 dbg("Local::finish error $@") if $@;
344         }
345
346
347         # disconnect AGW
348         AGWMsg::finish();
349         BPQMsg::finish();
350
351         # disconnect UDP customers
352         UDPMsg::finish();
353
354         # end everything else
355         DXUser::finish();
356         DXDupe::finish();
357
358         # close all databases
359         DXDb::closeall;
360
361         # close all listeners
362         foreach my $l (@listeners) {
363                 $l->close_server;
364         }
365
366         LogDbg('cluster', "DXSpider V$version, build $build (git: $gitversion) ended");
367         dbg("bye bye everyone - bye bye");
368         dbgclose();
369         Logclose();
370
371         $dbh->finish if $dbh;
372
373         unlink $lockfn;
374 }
375
376 # the reaper of children
377 sub reap
378 {
379         my $cpid;
380         while (($cpid = waitpid(-1, WNOHANG)) > 0) {
381                 dbg("cpid: $cpid") if isdbg('reap');
382 #               Msg->pid_gone($cpid);
383                 $zombies-- if $zombies > 0;
384         }
385         dbg("cpid: $cpid") if isdbg('reap');
386 }
387
388 # this is where the input queue is dealt with and things are dispatched off to other parts of
389 # the cluster
390
391 sub uptime
392 {
393         my $t = $systime - $starttime;
394         my $days = int $t / 86400;
395         $t -= $days * 86400;
396         my $hours = int $t / 3600;
397         $t -= $hours * 3600;
398         my $mins = int $t / 60;
399         return sprintf "%d %02d:%02d", $days, $hours, $mins;
400 }
401
402 sub AGWrestart
403 {
404         AGWMsg::init(\&new_channel);
405 }
406
407
408 sub setup_start
409 {
410
411         #############################################################
412         #
413         # The start of the main line of code
414         #
415         #############################################################
416
417         $starttime = $systime = time;
418         $systime_days = int ($systime / 86400);
419         $systime_daystart = $systime_days * 86400;
420         $lang = 'en' unless $lang;
421
422         unless ($DB::VERSION) {
423                 $SIG{INT} = $SIG{TERM} = \&cease;
424         }
425
426         # open the debug file, set various FHs to be unbuffered
427         dbginit($broadcast_debug ? \&DXCommandmode::broadcast_debug : undef);
428         foreach (@debug) {
429                 dbgadd($_);
430         }
431         STDOUT->autoflush(1);
432
433         
434         # try to load the database
435         if (DXSql::init($dsn)) {
436                 $dbh = DXSql->new($dsn);
437                 $dbh = $dbh->connect($dsn, $dbuser, $dbpass) if $dbh;
438         }
439
440         # try to load Encode and Git
441         {
442                 local $^W = 0;
443                 my $w = $SIG{__DIE__};
444                 $SIG{__DIE__} = 'IGNORE';
445                 eval { require Encode; };
446                 unless ($@) {
447                         import Encode;
448                         $can_encode = 1;
449                 }
450                 eval { require Git; };
451                 unless ($@) {
452                         import Git;
453                 
454                         # determine the real version number
455                         my $repo = Git->repository(Directory => "$root/.git");
456                         if ($repo) {
457                                 my $desc = $repo->command_oneline(['describe', '--long'], STDERR => 0);
458                                 if ($desc) {
459                                         my ($v, $s, $b, $g) = $desc =~ /^([\d.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/;
460                                         $version = $v;
461                                         $build = $b || 0;
462                                         $gitversion = "$g\[r]";
463                                 }
464                         }
465                 }
466                 $SIG{__DIE__} = $w;
467         }
468
469         # try to load XML::Simple
470         DXXml::init();
471
472         # banner
473         my ($year) = (gmtime)[5];
474         $year += 1900;
475         LogDbg('cluster', "DXSpider V$version, build $build (git: $gitversion) started");
476         dbg("Copyright (c) 1998-$year Dirk Koopman G1TLH");
477
478         # load Prefixes
479         dbg("loading prefixes ...");
480         dbg(USDB::init());
481         my $r = Prefix::init();
482         confess $r if $r;
483
484         # load band data
485         dbg("loading band data ...");
486         Bands::load();
487
488         # initialise User file system
489         dbg("loading user file system ...");
490         DXUser::init(1);
491
492         # look for the sysop and the alias user and complain if they aren't there
493         {
494                 die "\$myalias \& \$mycall are the same ($mycall)!, they must be different (hint: make \$mycall = '${mycall}-2';). Oh and don't forget to rerun create_sysop.pl!" if $mycall eq $myalias;
495                 my $ref = DXUser::get($mycall);
496                 die "$mycall missing, run the create_sysop.pl script and please RTFM" unless $ref && $ref->priv == 9;
497                 my $oldsort = $ref->sort;
498                 if ($oldsort ne 'S') {
499                         $ref->sort('S');
500                         dbg "Resetting node type from $oldsort -> DXSpider ('S')";
501                 }
502                 $ref = DXUser::get($myalias);
503                 die "$myalias missing, run the create_sysop.pl script and please RTFM" unless $ref && $ref->priv == 9;
504                 $oldsort = $ref->sort;
505                 if ($oldsort ne 'U') {
506                         $ref->sort('U');
507                         dbg "Resetting sysop user type from $oldsort -> User ('U')";
508                 }
509         }
510
511         # start listening for incoming messages/connects
512         dbg("starting listeners ...");
513         my $conn = IntMsg->new_server($clusteraddr, $clusterport, \&login);
514         $conn->conns("Server $clusteraddr/$clusterport using IntMsg");
515         push @listeners, $conn;
516         dbg("Internal port: $clusteraddr $clusterport using IntMsg");
517         foreach my $l (@main::listen) {
518                 no strict 'refs';
519                 my $pkg = $l->[2] || 'ExtMsg';
520                 my $login = $l->[3] || 'login';
521
522                 $conn = $pkg->new_server($l->[0], $l->[1], \&{"${pkg}::${login}"});
523                 $conn->conns("Server $l->[0]/$l->[1] using ${pkg}::${login}");
524                 push @listeners, $conn;
525                 dbg("External Port: $l->[0] $l->[1] using ${pkg}::${login}");
526         }
527
528         dbg("AGW Listener") if $AGWMsg::enable;
529         AGWrestart();
530
531         dbg("BPQ Listener") if $BPQMsg::enable;
532         BPQMsg::init(\&new_channel);
533
534         dbg("UDP Listener") if $UDPMsg::enable;
535         UDPMsg::init(\&new_channel);
536
537         # load bad words
538         dbg("load badwords: " . (BadWords::load or "Ok"));
539
540         # prime some signals
541         unless ($DB::VERSION) {
542                 $SIG{INT} = $SIG{TERM} = sub { $ending = 10; };
543         }
544
545         unless ($is_win) {
546                 $SIG{HUP} = 'IGNORE';
547                 $SIG{CHLD} = sub { $zombies++ };
548
549                 $SIG{PIPE} = sub {      dbg("Broken PIPE signal received"); };
550                 $SIG{IO} = sub {        dbg("SIGIO received"); };
551                 $SIG{WINCH} = $SIG{STOP} = $SIG{CONT} = 'IGNORE';
552                 $SIG{KILL} = 'DEFAULT'; # as if it matters....
553
554                 # catch the rest with a hopeful message
555                 for (keys %SIG) {
556                         if (!$SIG{$_}) {
557                                 #               dbg("Catching SIG $_") if isdbg('chan');
558                                 $SIG{$_} = sub { my $sig = shift;       DXDebug::confess("Caught signal $sig");  };
559                         }
560                 }
561         }
562
563         # start dupe system
564         dbg("Starting Dupe system");
565         DXDupe::init();
566
567         # read in system messages
568         dbg("Read in Messages");
569         DXM->init();
570
571         # read in command aliases
572         dbg("Read in Aliases");
573         CmdAlias->init();
574
575         # initialise the Geomagnetic data engine
576         dbg("Start WWV");
577         Geomag->init();
578         dbg("Start WCY");
579         WCY->init();
580
581         # initial the Spot stuff
582         dbg("Starting DX Spot system");
583         Spot->init();
584
585         # initialise the protocol engine
586         dbg("Start Protocol Engines ...");
587         DXProt->init();
588
589         # put in a DXCluster node for us here so we can add users and take them away
590         $routeroot = Route::Node->new($mycall, $version*100+5300, Route::here($main::me->here)|Route::conf($main::me->conf));
591         $routeroot->do_pc9x(1);
592         $routeroot->via_pc92(1);
593
594         # make sure that there is a routing OUTPUT node default file
595         #unless (Filter::read_in('route', 'node_default', 0)) {
596         #       my $dxcc = $main::me->dxcc;
597         #       $Route::filterdef->cmd($main::me, 'route', 'accept', "node_default call $mycall" );
598         #}
599
600         # read in any existing message headers and clean out old crap
601         dbg("reading existing message headers ...");
602         DXMsg->init();
603         DXMsg::clean_old();
604
605         # read in any cron jobs
606         dbg("reading cron jobs ...");
607         DXCron->init();
608
609         # read in database desriptors
610         dbg("reading database descriptors ...");
611         DXDb::load();
612
613         # starting local stuff
614         dbg("doing local initialisation ...");
615         QSL::init(1);
616         if (defined &Local::init) {
617                 eval {
618                         Local::init();
619                 };
620                 dbg("Local::init error $@") if $@;
621         }
622
623
624         # this, such as it is, is the main loop!
625         dbg("orft we jolly well go ...");
626         my $script = new Script "startup";
627         $script->run($main::me) if $script;
628
629         #open(DB::OUT, "|tee /tmp/aa");
630 }
631
632 our $io_disconnected;
633
634 sub idle_loop
635 {
636         BPQMsg::process();
637
638         if (defined &Local::process) {
639                 eval {
640                         Local::process();       # do any localised processing
641                 };
642                 dbg("Local::process error $@") if $@;
643         }
644
645         while ($ending) {
646                 my $dxchan;
647
648                 dbg("DXSpider Ending $ending");
649
650                 unless ($io_disconnected++) {
651
652                         # disconnect users
653                         foreach $dxchan (DXChannel::get_all_users) {
654                                 $dxchan->disconnect;
655                         }
656
657                         # disconnect nodes
658                         foreach $dxchan (DXChannel::get_all_nodes) {
659                                 next if $dxchan == $main::me;
660                                 $dxchan->disconnect(2);
661                         }
662                         $main::me->disconnect;
663                 }
664
665                 Mojo::IOLoop->stop if --$ending <= 0;
666         }
667 }
668
669 sub per_sec
670 {
671         my $timenow = time;
672
673         reap() if $zombies;
674         $systime = $timenow;
675         my $days = int ($systime / 86400);
676         if ($systime_days != $days) {
677                 $systime_days = $days;
678                 $systime_daystart = $days * 86400;
679         }
680         IsoTime::update($systime);
681         DXCron::process();      # do cron jobs
682         DXCommandmode::process(); # process ongoing command mode stuff
683         DXXml::process();
684         DXProt::process();              # process ongoing ak1a pcxx stuff
685         DXConnect::process();
686         DXMsg::process();
687         DXDb::process();
688         DXUser::process();
689         DXDupe::process();
690         DXCron::process();                      # do cron jobs
691         IsoTime::update($systime);
692         DXProt::process();                      # process ongoing ak1a pcxx stuff
693         DXConnect::process();
694         DXUser::process();
695         AGWMsg::process();
696         
697         Timer::handler();
698         DXLog::flushall();
699 }
700
701 sub per_10_sec
702 {
703
704 }
705
706
707 sub per_minute
708 {
709
710 }
711
712 sub per_10_minute
713 {
714
715 }
716
717 sub per_hour
718 {
719
720 }
721
722 sub per_day
723 {
724
725 }
726
727 sub start_node
728 {
729         dbg("Before Web::start_node");
730
731         Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
732
733         dbg("After Web::start_node");
734 }
735
736 setup_start();
737
738 my $main_loop = Mojo::IOLoop->recurring($idle_interval => \&idle_loop);
739 my $log_flush_loop = Mojo::IOLoop->recurring($log_flush_interval => \&DXLog::flushall);
740 my $cpusecs_loop = Mojo::IOLoop->recurring(5 => sub {my @t = times; $clssecs = $t[0]+$t[1]; $cldsecs = $t[2]+$t[3]});
741 my $persec =  Mojo::IOLoop->recurring(1 => \&per_sec);
742 my $per10sec =  Mojo::IOLoop->recurring(10 => \&per_10_sec);
743 my $permin =  Mojo::IOLoop->recurring(60 => \&per_minute);
744 my $per10min =  Mojo::IOLoop->recurring(600 => \&per_10_minute);
745 my $perhour =  Mojo::IOLoop->recurring(3600 => \&per_hour);
746 my $perday =  Mojo::IOLoop->recurring(86400 => \&per_day);
747
748 start_node();
749
750 cease(0);
751
752 exit(0);
753