The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

/scripts/wwwacct modification problem

Discussion in 'General Discussion' started by alexz, Sep 3, 2005.

  1. alexz

    alexz Member

    Joined:
    Jun 20, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    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?
     
  3. alexz

    alexz Member

    Joined:
    Jun 20, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  4. alexz

    alexz Member

    Joined:
    Jun 20, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  5. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Take a look at some of my postwwwacct scripts for some samples and the variables.
    (scripts link in my sig)
     
  6. alexz

    alexz Member

    Joined:
    Jun 20, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    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 :(
     
  7. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    Just a shot in the dark . . . since your postwwwacct script doesn't do anything it probably isn't being executed, perhaps you could check the ownership and permissions?
     
  8. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    That's a possibility. The script should be owned by root and set to 700.
     
  9. alexz

    alexz Member

    Joined:
    Jun 20, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    here is my postwwwacct permissions:

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

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Try adding this line

    use CGI::Carp qw(fatalsToBrowser);

    to the script after the first line and see if it prints anything to the screen.
     
  11. alexz

    alexz Member

    Joined:
    Jun 20, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  12. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    PM me if you want me to take a look.
     
Loading...

Share This Page