/scripts/wwwacct modification problem

alexz

Member
Jun 20, 2005
13
0
151
Hi,
I am trying to modify my wwwacct script, to change the permissions of "public_html" of new accounts, it was discussed here:
http://forums.cpanel.net/showthread.php?t=40360&
The newly modified wwwacct works fine, does what I need it to do, but the problem is,
after a while it gets owerwritten back to old version, as if I never modifyed it.
Does anyone know why is it happening? How can I make permanent changes to wwwacct ?
I never had this problem on my old 2 servers, but on this new one something keeps owerwriting my modifyed wwwacct...
Thank you
Alex
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,465
30
473
Go on, have a guess
Whenever you run upcp (e.g. when it runs overnight) it will replace any modified scripts. If you want to have code run after wwwacct then you should create a new script called /scripts/postwwwacct and chmod +x it and it will be run after wwwacct, i.e. put your chmod into that file after creating it. That said, why are you changing the default public_html permissions?
 

alexz

Member
Jun 20, 2005
13
0
151
Thank you for your reply,
I need it for my php scripts, they need to be able to create new files in newly created accounts.
Strange thing is, on my other servers modified wwwacct is never owerwritten, it just stays the way I need it. :(
How can I disable runing of upcp completely?
If its not possible to do that, can I use wwwacct variables in postwwwacct?
Will this work in postwwwacct?

chmod(0777,"$mnt/$user/public_html");

Thank you,
Alex
 

alexz

Member
Jun 20, 2005
13
0
151
Tryed to create postwwwacct, but it does not seem to execute... :(((
here it is:
--------------------------------------------------------
#!/usr/bin/perl
chmod(0777,"$mnt/$user/public_html");
mkdir("$mnt/$user/public_html/zz",0755);
-------------------------------------------------------
last line, mkdir, is just to see if its working, but it does not work :(
it does not create public_html/zz :(

ps. I did chmod it +x
 

alexz

Member
Jun 20, 2005
13
0
151
Thank you, I checked the scripts, and changed my postwwwacct to:
------------------------
#!/usr/bin/perl
print "Creating ZZ dir\n";
chmod(0777,"/home/$ARGV[1]/public_html");
mkdir("/home/$ARGV[1]/public_html/zz",0755);
------------------------
But it still does not work, it does not print anything, and it does not create public_html/zz :(
 

alexz

Member
Jun 20, 2005
13
0
151
here is my postwwwacct permissions:

-rwxr-xr-x 1 root root 134 Sep 3 12:49 postwwwacct*
 

alexz

Member
Jun 20, 2005
13
0
151
I've tried that and it still does not seem to work :(

I've disabled cron job for "upcp", and everything seems to be fine now, my modified wwwacct
is not overwritten anymore, but I wonder, does "upcp" do something usefull?
Is it not a good idea to disable it?
Thanks a lot to all replyed
Alex