Bug #11180
openFiler run action for files on sync that wan't been modified
0%
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
      
      Updated by DRago_Angel [InV@DER] almost 5 years ago
      
    
    Sorry "wan't been modified" -> "wasn't been modified" typo.
      
      Updated by Viktor Gurov almost 5 years ago
      
    
    
    
      
      Updated by DRago_Angel [InV@DER] almost 5 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.
      
      Updated by Viktor Gurov almost 5 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
      
      Updated by DRago_Angel [InV@DER] almost 5 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.
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:
- file permissions
 - content
 - 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?
      
      Updated by Renato Botelho almost 5 years ago
      
    
    DRago_Angel [InV@DER] wrote:
Hi Viktor, thank you. Fix for this bug working. Tested:
But found another 2 cases:
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.
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:
- file permissions
 - content
 - 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.
      
      Updated by Renato Botelho almost 5 years ago
      
    
    - Status changed from New to Feedback
 - Assignee set to Viktor Gurov
 
PR has been merged. Thanks!
      
      Updated by DRago_Angel [InV@DER] almost 5 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.