Skip to content

Commit cddd060

Browse files
author
Webslice
committed
#5218 remove chattr +i
If the plugin runs at the end, and you are deleting a Site, the deletion will not run completely because the trigger file still exists
1 parent 7e2ceca commit cddd060

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

server/plugins-available/incron_plugin.inc.php renamed to server/plugins-available/z_incron_plugin.inc.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
* configuration which will take care of reloading the php-fpm pool when the file /private/php-fpm.reload is touched.
66
* Projects which use deployment tools can use this to reload php-fpm to clear the opcache at deploy time, without
77
* requiring superuser privileges.
8+
*
9+
* The plugin is called `z_incron_plugin` because plugins are executed alphabetically, and this plugin can only run
10+
* when apache2/nginx plugins have already run so the directories and user/group exist.
811
*/
9-
class incron_plugin {
12+
class z_incron_plugin {
1013

11-
var $plugin_name = 'incron_plugin';
12-
var $class_name = 'incron_plugin';
14+
var $plugin_name = 'z_incron_plugin';
15+
var $class_name = 'z_incron_plugin';
1316

1417
function onInstall() {
1518
global $conf;
@@ -111,7 +114,6 @@ private function createTriggerFile($triggerFile, $systemUser, $systemGroup) {
111114
}
112115

113116
exec(sprintf('chown %s:%s %s', $systemUser, $systemGroup, $triggerFile));
114-
exec(sprintf('chattr +i %s', $triggerFile));
115117

116118
$app->log(sprintf('Ensured incron trigger file "%s"', $triggerFile), LOGLEVEL_DEBUG);
117119
}
@@ -128,7 +130,6 @@ private function deleteIncronConfiguration($systemUser) {
128130
private function deleteTriggerFile($triggerFile) {
129131
global $app;
130132

131-
exec(sprintf('chattr -i %s', $triggerFile));
132133
unlink($triggerFile);
133134

134135
$app->log(sprintf('Deleted incron trigger file "%s"', $triggerFile), LOGLEVEL_DEBUG);

0 commit comments

Comments
 (0)