projects
/
webmin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bbc3db4
)
Background dovecot to prevent hang at startup
author
Jamie Cameron
<jcameron@webmin.com>
Sat, 13 Aug 2011 22:23:00 +0000
(15:23 -0700)
committer
Jamie Cameron
<jcameron@webmin.com>
Sat, 13 Aug 2011 22:23:00 +0000
(15:23 -0700)
dovecot/dovecot-lib.pl
patch
|
blob
|
history
diff --git
a/dovecot/dovecot-lib.pl
b/dovecot/dovecot-lib.pl
index
e04d607
..
988d19c
100755
(executable)
--- a/
dovecot/dovecot-lib.pl
+++ b/
dovecot/dovecot-lib.pl
@@
-308,8
+308,12
@@
sub start_dovecot
{
local $script = &get_initscript();
local $cmd = $script ? "$script start" : $config{'dovecot'};
-local $out = &backquote_logged("$cmd 2>&1 </dev/null");
-return $? ? "<pre>$out</pre>" : undef;
+local $temp = &transname();
+&system_logged("$cmd >$temp 2>&1 </dev/null &");
+sleep(1);
+local $out = &read_file_contents($temp);
+&unlink_file($temp);
+return &is_dovecot_running() ? undef : "<pre>$out</pre>";
}
# apply_configration()