[FIXED BUG] plesk repair fs doesn't set correct owner inside httpdocs

Follow

Comments

13 comments

  • Avatar
    Jerry van Kranenburg

    Do not run this script, it will break your complete plesk installation!

    There is missing a /httpdocs at the end of the chown!

    "chown -R $user.psacln $VHOST_DIR/$domain/httpdocs"

    Otherwise also all logfiles and httpdocs and httpsdocs folder will change and all sites are down.

    0
    Comment actions Permalink
  • Avatar
    Alexander Tsmokalyuk

    @Jerry We have fixed the script. Thank you for reporting.

    0
    Comment actions Permalink
  • Avatar
    Lenor

    can run your chown on Cloudlinux:

    Error: chown: ungültiger Benutzer: „+x“

     

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    @Lenor

    Hello!

    Step 3 of the resolution was updated. The correct command is:

    # chmod +x fix.sh

    0
    Comment actions Permalink
  • Avatar
    Jason Schilling

    Doesn't correct dot files.

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Jason, 

    Could you, please, provide used OS, Plesk version and give an example of a file name, which was ignored by script from workaround.

    0
    Comment actions Permalink
  • Avatar
    Gergely Nagy

    @Alexandr

    Just had to use the script (i think for some cases it is better to use the script, instead of plesk repair) and found out, the script misses those files/folders inside  h.www_root if their name starts with a dot, or is does not restores the owner inside those folders. A small fix for me was to add an extra chown before doing the "psaserv restore" :

    chown -chR "${query[0]/ /}":psacln "${query[1]/ /}"/.[0-9a-zA-Z]*

    0
    Comment actions Permalink
  • Avatar
    Artyom Baranov

    @Gergely Nagy

    Thank you for noticing it!
    The script was updated: now all chown and chmod commands are executed by `find`. It's a little bit slower but should behave better in edge cases.

    0
    Comment actions Permalink
  • Avatar
    Rob

    Is this working in Plesk Only now or do we still use this script ? a bit worried about using the script if it potentially touches any other web site.... Has Obsidian got this bug also ?

     

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello Rob

    It's expected to be fixed during this quarter.

    Usually, script doesn't cause issues. However, I would suggest making a domain back up first to be safe.

    Also, keep in mind this warning:

    Warning: The following script sets the permissions for files inside the document root to 0644. In case there are files that require specific permissions, set them manually after executing the script, or restore a subscription backup.

    0
    Comment actions Permalink
  • Avatar
    Marc

    Have tried to use the script, but I cannot start it. Is it in the wrong folder?

    /root$ fix_permissions.sh
    -bash: Zeile 12: fix_permissions.sh: Befehl nicht gefunden

    0
    Comment actions Permalink
  • Avatar
    Anzhelika Khapaknysh

    @Marc,

    Please try:

    # ./fix_permissions.sh

    I've updated the article. Thanks the notice!

    1
    Comment actions Permalink
  • Avatar
    Marc

    Great help, thanks a lot. Problem is solved now :)

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request