summaryrefslogtreecommitdiffstats
path: root/etc/rc.banner
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-03-25 00:33:55 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-03-25 00:33:55 +0000
commit1bf57c15d2a33663d588d9183da665a5b4515bf2 (patch)
treefe22d4128f2b0d8ac209529a21f7d5898a25d369 /etc/rc.banner
parent8b9e5e68267b8c934954ab7ed1546ec1911be9b3 (diff)
downloadpfsense-1bf57c15d2a33663d588d9183da665a5b4515bf2.zip
pfsense-1bf57c15d2a33663d588d9183da665a5b4515bf2.tar.gz
If a console respawn bug is detected, slow it down.
Diffstat (limited to 'etc/rc.banner')
-rwxr-xr-xetc/rc.banner12
1 files changed, 12 insertions, 0 deletions
diff --git a/etc/rc.banner b/etc/rc.banner
index a11208a..96bbe22 100755
--- a/etc/rc.banner
+++ b/etc/rc.banner
@@ -34,6 +34,18 @@
require_once("config.inc");
require_once("functions.inc");
+ if(file_exists("/var/run/lastlogin") {
+ $last_login_time = file_get_contents("{$g['varrun_path']}/lastlogin");
+ $time_now = time();
+ if($time_now - $last_login_time < 20) {
+ log_error("Console respawn bug detected. CTRL-C to exit.");
+ sleep(600);
+ }
+ }
+ $fd = fopen("{$g['varrun_path']}/lastlogin", "w");
+ fwrite($fd, time());
+ fclose($fd);
+
$version = trim(file_get_contents("{$g['etc_path']}/version"));
$platform = trim(file_get_contents("{$g['etc_path']}/platform"));
$hostname = $config['system']['hostname'];
OpenPOWER on IntegriCloud