-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherror.php
More file actions
106 lines (81 loc) · 2.35 KB
/
Copy patherror.php
File metadata and controls
106 lines (81 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
include "config.php";
include "layout.class.php";
include "bartlby-ui.class.php";
$btl = new BartlbyUi($Bartlby_CONF, false, false);
$layout= new Layout();
$layout->setTitle("Error");
$layout->OUT .= "<script>
function doRetry() {
document.location.href='start.php';
}
function doStartup() {
document.location.href='error.php?msg=BARTLBY::START';
}
function doSHMClean() {
document.location.href='error.php?msg=BARTLBY::SHMCLEAN';
}
</script>
";
$layout->Table("100%");
switch ($_GET[msg]) {
case 'BARTLBY::LOGIN':
$omsg = "Login failed <br><a href='index.php'>Go to login page</A>";
break;
case 'BARTLBY::SHMCLEAN';
$r=bartlby_shm_destroy($btl->CFG);
$omsg = "SHM cleaned($r)";
break;
case 'BARTLBY::SHM::STALE':
$omsg .= "it looks that there is a shared memory segment set up, wich is assigned to this bartlby instance<br>";
$omsg .= "but the process is not found, or eather your kernel doesnt have /proc/ FS support<br>";
$omsg .= "<input type=button value='remove shared memory segment' onClick='doSHMClean();'>";
break;
case 'BARTLBY::START':
//Set Env
//Call bartlby.startup start
$base_dir=bartlby_config($btl->CFG, "basedir");
if(!$base_dir) {
$omsg="basedir config not set";
} else {
$cmd="export BARTLBY_HOME='$base_dir'; cd \$BARTLBY_HOME; ./bartlby.startup restartwithout 2>&1";
$fp=popen($cmd, "r");
while(!feof($fp)) {
$omsg .= fgets($fp, 1024);
}
pclose($fp);
/*
if(preg_match("/PIDFILE:.*exists/", $omsg)) {
$pid_file=bartlby_config($btl->CFG, "pidfile_dir");
$omsg .= "<br>retrying after pid file deletion (" . $pid_file . "/bartlby.pid)<br>";
unlink($pid_file . "/bartlby.pid");
$fp=popen($cmd, "r");
$omsg .= fgets($fp, 1024);
pclose($fp);
}*/
}
break;
case 'BARTLBY::NOT::RUNNING':
$omsg = "Bartlby doesnt seem to be running<br><input type=button value='try to startup bartlby' onClick='doStartup();'>";
break;
default:
$omsg="ERROR is undefined";
}
$omsg =$btl->FinScreen(str_replace("::", "_", $_GET[msg]));
$layout->Tr(
$layout->Td(
Array(
0=>$omsg
)
)
);
$layout->Tr(
$layout->Td(
Array(
0=>"<input type=button value='retry' onClick='doRetry();'>"
)
)
);
$layout->TableEnd();
$layout->display();
?>