From: paulr Date: Sat, 26 Jun 2010 17:07:19 +0000 (+1000) Subject: added some code for actually starting some stuff! X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=1aaffed55883b756a7adca132a7bb3871e1dda4d;p=xmppcentral.git added some code for actually starting some stuff! --- diff --git a/design/beginnings b/design/beginnings index 56497c9..4630c59 100644 --- a/design/beginnings +++ b/design/beginnings @@ -38,4 +38,5 @@ i.e. from hostname to user: log messages of importance (crash errors, filesystem i.e. from system to user: log messages of importance (creation/deleteion of users and stuff). -lets start with that, and see where it takes us. \ No newline at end of file +lets start with that, and see where it takes us. + diff --git a/design/install.txt b/design/install.txt new file mode 100644 index 0000000..26a672b --- /dev/null +++ b/design/install.txt @@ -0,0 +1,20 @@ +Installation/setup +================== + +install will be a simple case of: +1) wget http://masterserver:8101/install.sh +2) sh install.sh + +the master server will run a small web server on 8101 that only sends out that install file (no matter what you type). The install will then do whats needed to +install the appropriate files into their right locations on the server, then setup the server + +to then setup the server, the server will xmpp chat as guest to the master server asking it to setup a computer account for it. the master server will then send +a pin code to a user id on the xmpp server which will then need to be typed in during install to validate the computer. + +for eg: +sh install.sh +type in the name of a user for pin code auth: paulr + master server -> paulr "pin code is 123456" +type in pin code when received: 123456 +verifying pin code... +code verified, computer account created. \ No newline at end of file diff --git a/etc/config.php b/etc/config.php index 8652167..bf118fe 100644 --- a/etc/config.php +++ b/etc/config.php @@ -6,4 +6,9 @@ $XMPP_DOMAIN="localhost"; $XMPP_SYSTEM_PASSWORD="password"; $XMPP_HOSTNAME_PASSWORD="password"; +$PLUGIN_DIRECTORY="../plugins"; +$LIB_PATH="../lib"; + +require_once("$LIB_PATH/lib.php"); + ?> \ No newline at end of file diff --git a/lib/hostManagementServer.php b/lib/hostManagementServer.php new file mode 100644 index 0000000..ab85b07 --- /dev/null +++ b/lib/hostManagementServer.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/lib/lib.php b/lib/lib.php index cdd96b9..ac66ba4 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -1,6 +1,10 @@ \ No newline at end of file diff --git a/lib/systemServer.php b/lib/systemServer.php new file mode 100644 index 0000000..8535ab6 --- /dev/null +++ b/lib/systemServer.php @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/lib/watchDog.php b/lib/watchDog.php new file mode 100644 index 0000000..a488950 --- /dev/null +++ b/lib/watchDog.php @@ -0,0 +1,50 @@ +isRunning()) { + startHMS(); + } + + if(!$lss->isRunning()) { + startSS(); + } + } + } + + function startHMS() + { + $pf = pcntl_fork(); + if($pf == -1) { + echo "Failed to fork\n"; + } else if($pf) { + // parent + } else { + // child + $hms = new hostManagementServer(); + $hms->go(); + } + } + + function startSS() + { + $pf2 = pcntl_fork(); + if($pf2 == -1) { + echo "Failed to fork\n"; + } else if($pf2) { + // parent + } else { + // child + $ss = new systemServer(); + $ss->go(); + } + } +} + +?> \ No newline at end of file diff --git a/sms/sms.php b/sms/sms.php index 4ac0d58..46ec901 100644 --- a/sms/sms.php +++ b/sms/sms.php @@ -1,9 +1,20 @@ go(); +} ?> \ No newline at end of file