Skip to content

Commit 1ae20c3

Browse files
author
Till Brehm
committed
Merge branch 'lazy_umount' into 'master'
added -l to umount commands the log folder is not deleted, because the **umount** command needs to be lazy, that's why we added the **-l** argument. ``` Tue Mar 21 23:59:01 UTC 2017 umount: /home/0/57/log: target is busy Tue Mar 21 23:59:01 UTC 2017 (In some cases useful info about processes that Tue Mar 21 23:59:01 UTC 2017 use the device is found by lsof(8) or fuser(1).) Tue Mar 21 23:59:01 UTC 2017 rm: cannot remove '/home/0/57/log': Device or resource busy ``` See merge request !561
2 parents a63d158 + f202bcf commit 1ae20c3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ function update($event_name, $data) {
643643

644644
//* Unmount the old log directory bfore we move the log dir
645645
//exec('fuser -km '.escapeshellcmd($old_dir.'/log'));
646-
exec('umount '.escapeshellcmd($data['old']['document_root'].'/log'));
646+
exec('umount -l '.escapeshellcmd($data['old']['document_root'].'/log'));
647647

648648
//* Create new base directory, if it does not exist yet
649649
if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
@@ -726,7 +726,7 @@ function update($event_name, $data) {
726726

727727
//* Unmount log directory
728728
//exec('fuser -km '.escapeshellarg($data['old']['document_root'].'/'.$old_log_folder));
729-
exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$old_log_folder));
729+
exec('umount -l '.escapeshellarg($data['old']['document_root'].'/'.$old_log_folder));
730730
}
731731

732732
//* Create the log dir if nescessary and mount it
@@ -2084,12 +2084,12 @@ function delete($event_name, $data) {
20842084
foreach($log_folders as $log_folder){
20852085
//if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
20862086
//exec('fuser -km '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
2087-
exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
2087+
exec('umount -l '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
20882088
}
20892089
} else {
20902090
//if($app->system->is_mounted($data['old']['document_root'].'/'.$log_folder)) exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
20912091
//exec('fuser -km '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
2092-
exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder).' 2>/dev/null');
2092+
exec('umount -l '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
20932093
}
20942094

20952095
// remove letsencrypt if it exists (renew will always fail otherwise)

0 commit comments

Comments
 (0)