-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Process Samba spool ASAP, in order to prevent loosing the spooled tas…
…ks (stored in tmpfs) on reboot Fixes #224
- Loading branch information
Showing
8 changed files
with
75 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# cifs client workaround | ||
# Ref: http://blog.dhampir.no/content/cifs-vfs-no-response-for-cmd-n-mid | ||
@reboot root /sbin/modprobe cifs enable_oplocks=n; if [ -x /proc/fs/cifs/OplockEnabled ]; then echo 0 > /proc/fs/cifs/OplockEnabled; fi | ||
@reboot root /usr/bin/greyhole --create-mem-spool >/dev/null | ||
@reboot root /usr/bin/greyhole --boot-init | ||
@reboot root /sbin/modprobe cifs enable_oplocks=n; if [ -x /proc/fs/cifs/OplockEnabled ]; then echo 0 > /proc/fs/cifs/OplockEnabled; fi | ||
@reboot root /usr/bin/greyhole --create-mem-spool >/dev/null | ||
@reboot root /usr/bin/greyhole --boot-init | ||
* * * * * root /usr/bin/greyhole --process-spool --keepalive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/* | ||
Copyright 2020 Guillaume Boudreau | ||
This file is part of Greyhole. | ||
Greyhole is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
Greyhole is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with Greyhole. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
require_once('includes/CLI/AbstractCliRunner.php'); | ||
|
||
class ProcessSpoolCliRunner extends AbstractCliRunner { | ||
public function run() { | ||
global $argv; | ||
$start = time(); | ||
while (time() - $start < 55) { | ||
SambaSpool::parse_samba_spool(); | ||
if (!array_contains($argv, '--keepalive')) { | ||
return; | ||
} | ||
if (time() - $start >= 55) { | ||
break; | ||
} | ||
sleep(5); | ||
} | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,5 @@ end script | |
|
||
post-stop script | ||
rm -f /var/run/greyhole.pid | ||
/usr/bin/greyhole --process-spool >/dev/null | ||
end script |