/[smeserver]/rpms/smeserver-php/sme10/smeserver-php-3.0.0-bz11287-pooldir.patch
ViewVC logotype

Annotation of /rpms/smeserver-php/sme10/smeserver-php-3.0.0-bz11287-pooldir.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Sun Feb 21 05:26:30 2021 UTC (3 years, 9 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-php-3_0_0-44_el7_sme, smeserver-php-3_0_0-47_el7_sme, smeserver-php-3_0_0-31_el7_sme, smeserver-php-3_0_0-25_el7_sme, smeserver-php-3_0_0-28_el7_sme, smeserver-php-3_0_0-45_el7_sme, smeserver-php-3_0_0-48_el7_sme, smeserver-php-3_0_0-43_el7_sme, smeserver-php-3_0_0-46_el7_sme, smeserver-php-3_0_0-41_el7_sme, smeserver-php-3_0_0-30_el7_sme, smeserver-php-3_0_0-29_el7_sme, smeserver-php-3_0_0-42_el7_sme, smeserver-php-3_0_0-24_el7_sme, smeserver-php-3_0_0-34_el7_sme, smeserver-php-3_0_0-37_el7_sme, smeserver-php-3_0_0-40_el7_sme, smeserver-php-3_0_0-35_el7_sme, smeserver-php-3_0_0-26_el7_sme, smeserver-php-3_0_0-32_el7_sme, smeserver-php-3_0_0-38_el7_sme, smeserver-php-3_0_0-27_el7_sme, smeserver-php-3_0_0-39_el7_sme, smeserver-php-3_0_0-36_el7_sme, smeserver-php-3_0_0-33_el7_sme, HEAD
* Sun Feb 21 2021 Jean-Philipe Pialasse <tests@pialasse.com> 3.0.0-24.sme
- allow php-pool-dirs to run from generik event [SME: 11287]

1 jpp 1.1 diff -Nur smeserver-php-3.0.0.old/root/etc/e-smith/events/actions/php-pool-customs smeserver-php-3.0.0/root/etc/e-smith/events/actions/php-pool-customs
2     --- smeserver-php-3.0.0.old/root/etc/e-smith/events/actions/php-pool-customs 2021-02-21 00:19:19.175000000 -0500
3     +++ smeserver-php-3.0.0/root/etc/e-smith/events/actions/php-pool-customs 2021-02-21 00:22:17.981000000 -0500
4     @@ -4,6 +4,7 @@
5     use warnings;
6     use File::Path qw(make_path remove_tree);
7     use esmith::ConfigDB;
8     +use esmith::util;
9    
10     my $pool_db = esmith::ConfigDB->open_ro('php') || esmith::ConfigDB->create('php');
11    
12     @@ -16,9 +17,12 @@
13     "/var/lib/php/$key/wsdlcache",
14     "/var/lib/php/$key/opcache",
15     "/var/lib/php/$key/tmp" );
16     - make_path( @dirs, {
17     - owner => 'root',
18     - group => 'www'
19     - });
20     + for (@dirs){
21     + esmith::util::chownFile("root", "www", $_) if -e $_;
22     + make_path( $_, {
23     + owner => 'root',
24     + group => 'www'
25     + }) unless -e $_;
26     + }
27     chmod 0770, @dirs;
28     }
29     diff -Nur smeserver-php-3.0.0.old/root/etc/e-smith/events/actions/php-pool-dirs smeserver-php-3.0.0/root/etc/e-smith/events/actions/php-pool-dirs
30     --- smeserver-php-3.0.0.old/root/etc/e-smith/events/actions/php-pool-dirs 2021-02-21 00:19:19.321000000 -0500
31     +++ smeserver-php-3.0.0/root/etc/e-smith/events/actions/php-pool-dirs 2021-02-21 00:21:57.740000000 -0500
32     @@ -4,39 +4,49 @@
33     use warnings;
34     use esmith::AccountsDB;
35     use File::Path qw(make_path remove_tree);
36     +use esmith::util;
37    
38     my $a = esmith::AccountsDB->open_ro || die "Couldn't open the accounts database\n";
39    
40     my $event = shift;
41     -my $pool = shift;
42     +my $apool = shift;
43    
44     -die "Missing pool name argument" unless $pool;
45     +my @pools = (defined $apool && $a->get($apool) ) ? map { $a->get($_); } $apool : ( $a->get_all_by_prop(type => "ibay" ) , $a->get_all_by_prop(type => "share" ));# unless $acc;
46    
47     -my $acc = $a->get($pool);
48     -
49     -die "$pool not found in the account database\n" unless $acc;
50     -my $type = $acc->prop('type');
51     -my $dyn = 'disabled';
52     -if ( $type eq "ibay") {
53     - $dyn = $acc->prop('CgiBin') || 'disabled';
54     -}
55     -else {
56     - $dyn = $acc->prop('DynamicContent') || 'disabled';
57     -}
58     -
59     -if ($dyn =~ m/^enabled|on|1|yes$/ && $event ne 'share-delete'){
60     - my @dirs = ( "/var/log/php/$pool",
61     +foreach my $acc (@pools){
62     + my $pool = $acc->key;
63     + my $type = $acc->prop('type');
64     + my $dyn = 'disabled';
65     + if ( $type eq "ibay") {
66     + $dyn = $acc->prop('CgiBin') || 'disabled';
67     + }
68     + else {
69     + $dyn = $acc->prop('DynamicContent') || 'disabled';
70     + }
71     +
72     + if ($dyn =~ m/^enabled|on|1|yes$/ && $event ne 'share-delete' && $event ne 'ibay-delete'){
73     + my @dirs = ( "/var/log/php/$pool",
74     "/var/lib/php/$pool/session",
75     "/var/lib/php/$pool/wsdlcache",
76     "/var/lib/php/$pool/opcache",
77     "/var/lib/php/$pool/tmp" );
78     - make_path( @dirs, {
79     - owner => 'root',
80     - group => 'www'
81     - });
82     - chmod 0770, @dirs;
83     + # create dir if does not exist; set owner and group if create it
84     + # does not change ownership if folder already exists
85     + for (@dirs){
86     + esmith::util::chownFile("root", "www", $_) if -e $_;
87     + make_path( $_, {
88     + owner => 'root',
89     + group => 'www'
90     + }) unless -e $_;
91     + }
92     + chmod 0770, @dirs;
93     + }
94     }
95     -else{
96     - remove_tree( ( "/var/log/php/$pool",
97     - " /var/lib/php/$pool/" ) );
98     +
99     +if ( defined $event && defined $apool && ($event eq 'share-delete' || $event eq 'ibay-delete') ) {
100     + my $acc = $a->get($apool);
101     + die "$apool not found in the account database\n" unless $acc;
102     + remove_tree( "/var/log/php/$apool",
103     + "/var/lib/php/$apool" );
104     }
105     +

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed