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.
+
--- /dev/null
+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
$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
--- /dev/null
+<?php
+
+class hostManagementServer {
+ function go() {
+ echo "running host management Server\n";
+ sleep(1000);
+ }
+
+ function isRunning()
+ {
+ // running check will be done via sem messages
+ }
+
+
+ private $sem_id = "348971983";
+}
+
+?>
\ No newline at end of file
<?php
// the main library that pulls everything together... are we going to do oo here? why am i asking this question while im coding?
+require_once "hostManagementServer.php";
+require_once "systemServer.php";
+require_once "watchDog.php";
+// now we should load the plugins?
?>
\ No newline at end of file
--- /dev/null
+<?php
+
+class systemServer {
+ function go() {
+ echo "running system Server\n";
+ sleep(1000);
+ }
+
+ function isRunning()
+ {
+ // the purpose of this function is two fold, first determines if it should be running and return true if not
+ // then checks if the ss is running or not and returns true if it is
+ }
+}
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+class watchDog {
+ function go()
+ {
+ // my job is to keep daemons running.
+ while(true) {
+ $lhms = new hostManagementServer();
+ $lss = new systemServer();
+
+ if(!$lhms->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
<?php
-// sms will start up and do two things
+// sms will start up and do two things TODO need to remove hardcoding of config.php
+require_once("../etc/config.php");
-// first it will fork the host management server, which will connect to the xmpp server and talk to system.
-// if the xmpp server is localhots or the hostname of it, it'll also spawn the system user too
+// our job is to now go into an watchdog loop
+// on first execution, this should create the ss and hms objects
+$pf3 = pcntl_fork();
+if($pf3 == -1) {
+ echo "Failed to fork\n";
+} else if($pf3) {
+ // parent
+} else {
+ // child
+ $wd = new watchDog();
+ $wd->go();
+}
?>
\ No newline at end of file