Project

General

Profile

Actions

Bug #11180

open

Filer run action for files on sync that wan't been modified

Added by DRago_Angel [InV@DER] almost 4 years ago. Updated almost 4 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
Viktor Gurov
Category:
Filer
Target version:
-
Start date:
12/21/2020
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

You have for example 2 files:
1. unbound mod.py which then run command: `unbound-control -c /var/unbound/unbound.conf reload` and have Execute mode in `background`
2. some bash.sh scripts with Execute mode in `Do not run this script`

On update of any bash.sh script Filer run `unbound-control -c /var/unbound/unbound.conf reload`. Why?


Files

18.diff (2.54 KB) 18.diff Viktor Gurov, 12/31/2020 02:10 AM
Actions #1

Updated by DRago_Angel [InV@DER] almost 4 years ago

Sorry "wan't been modified" -> "wasn't been modified" typo.

Actions #3

Updated by DRago_Angel [InV@DER] almost 4 years ago

Hi Viktor, can you please provide diff -u ? I can check fix and provide feedback. Thank you for fix and also wish you happy new year.

Actions #4

Updated by Viktor Gurov almost 4 years ago

DRago_Angel [InV@DER] wrote:

Hi Viktor, can you please provide diff -u ? I can check fix and provide feedback. Thank you for fix and also wish you happy new year.

ok, please check

Actions #5

Updated by DRago_Angel [InV@DER] almost 4 years ago

Hi Viktor, thank you. Fix for this bug working. Tested:
1. modified file without script action - another files actions not triggered.
2. created 2 test sh scripts via filer, each of them do echo to another files and action trigger them selfs. Saved one of them - second isn't triggered.

But found another 2 cases:
1. when you say filer create file for directory that not exists yet on pfSense - it not create this directory and of course not create file. Also here is question mark - we have file permissions settings, but not user and group owner, as well we do not have settings for folder, if we want create folder which is missing - we need know which permissions it must have. Need to track what last folder in path exist and not touch it permissions, create folders via mkdir -p to end, but do chown & chmod -R on first not existing folder before do chown and chmod on file.
2. when file not modified action still triggered, it would be cool to check:
  1. file permissions
  2. content
  3. file action type and content

and run action only if any of them was been changed compared to previous ones. E.g. like Ansible or Chef do, state: changed - trigger action, state: unchanged - no action taken :).

I think this both cases need dedicated issues. What you think?

Actions #6

Updated by Renato Botelho almost 4 years ago

DRago_Angel [InV@DER] wrote:

Hi Viktor, thank you. Fix for this bug working. Tested:
1. modified file without script action - another files actions not triggered.
2. created 2 test sh scripts via filer, each of them do echo to another files and action trigger them selfs. Saved one of them - second isn't triggered.

But found another 2 cases:
1. when you say filer create file for directory that not exists yet on pfSense - it not create this directory and of course not create file. Also here is question mark - we have file permissions settings, but not user and group owner, as well we do not have settings for folder, if we want create folder which is missing - we need know which permissions it must have. Need to track what last folder in path exist and not touch it permissions, create folders via mkdir -p to end, but do chown & chmod -R on first not existing folder before do chown and chmod on file.
2. when file not modified action still triggered, it would be cool to check:
  1. file permissions
  2. content
  3. file action type and content

and run action only if any of them was been changed compared to previous ones. E.g. like Ansible or Chef do, state: changed - trigger action, state: unchanged - no action taken :).

I think this both cases need dedicated issues. What you think?

yes, please open new tickets for other issues.

Actions #7

Updated by Renato Botelho almost 4 years ago

  • Status changed from New to Feedback
  • Assignee set to Viktor Gurov

PR has been merged. Thanks!

Actions #8

Updated by DRago_Angel [InV@DER] almost 4 years ago

Renato Botelho wrote:

PR has been merged. Thanks!

Hi, Thank you! I created new issues and also want ask you or Viktor to check in first time https://redmine.pfsense.org/issues/10426 this issue in filer, I think this one most easy to fix.

Actions

Also available in: Atom PDF