Upgrade problem because AutoInstaller can not remove .ssh directory (InstantSSH)

  • I´ve tested some plugins on i-MSCP 1.1.8.
    As i tried to upgrade to 1.1.9 i got an error message because something was wrong with the InstantSSH plugin.
    I didn´t noticed the error message but here is the log:

    Code
    1. [Sun May 25 18:01:37 2014] [debug] iMSCP::HooksManager::register: Registering listener on the 'beforeHttpdDelDmn' hook from Plugin::InstantSSH::_init
    2. [Sun May 25 18:01:37 2014] [debug] Modules::Plugin::_exec: Executing Plugin::InstantSSH::disable() action
    3. [Sun May 25 18:01:37 2014] [debug] iMSCP::Execute::execute: Executing command: /bin/df -TP '/var/www/virtual'
    4. [Sun May 25 18:01:37 2014] [debug] iMSCP::Execute::getExitCode: External command exited with value 0
    5. [Sun May 25 18:01:37 2014] [debug] iMSCP::Execute::execute: Executing command: /usr/bin/pkill -KILL -f -u vu2004 sshd
    6. [Sun May 25 18:01:37 2014] [debug] iMSCP::Execute::getExitCode: External command exited with value 1
    7. [Sun May 25 18:01:37 2014] [debug] iMSCP::Dir::remove: Removing directory /var/www/virtual/fisa4.de/.ssh
    8. [Sun May 25 18:01:37 2014] [error] iMSCP::Dir::remove: Unable to delete directory /var/www/virtual/fisa4.de/.ssh/authorized_keys: cannot unlink file: Operation not permitted
    9. [Sun May 25 18:01:37 2014] [error] iMSCP::Dir::remove: Unable to delete directory /var/www/virtual/fisa4.de/.ssh/authorized_keys: cannot restore permissions to 0100600: Operation not permitted
    10. [Sun May 25 18:01:37 2014] [error] iMSCP::Dir::remove: Unable to delete directory /var/www/virtual/fisa4.de/.ssh: cannot remove directory: Directory not empty


    I couldn't login into i-MSCP to remove the plugin, so I deleted it manually in the database.
    after that, i could upgrade i-MSCP to 1.1.9 but the .ssh folder is still there and even as root i can not delete the folder.


    chmod / chown / rm -rf ... nothing works


    greets


    FISA4

  • Hello ;


    Well, first, without the error message from installer, I cannot really say what was wrong during the update and therefore, I'll have to do a test myself to try to reproduce... You removed the plugin manually, meaning that related data were not removed by the plugin (backend side). You must so process manually..


    Here, you say that you cannot remove the .ssh directory (including its content), even as root user. It's normal because the /var/www/virtual/fisa4.de directory and the /var/www/virtual/fisa4.de/.ssh/authorized_keys file are protected (immutable bit).


    You must so remove the immutable bit on the /var/www/virtual/fisa4.de directory and also on the /var/www/virtual/fisa4.de/.ssh/authorized_keys file as follow:


    Shell-Script
    1. # chattr -i /var/www/virtual/fisa4.de# chattr -i /var/www/virtual/fisa4.de/.ssh/authorized_keys


    Once it's done, you can normally remove the directory /var/www/virtual/fisa4.de/.ssh


    Shell-Script
    1. # rm -r /var/www/virtual/fisa4.de/.ssh


    I'm surprised here because you are not a noobs. You should know about the immutable bit possibility.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @FISA4


    Can you give me the result of the following command on your system (the one on which you installed i-MSCP)


    Shell-Script
    1. # df -TP /var/www/virtual


    Thanks

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @FISA4


    Shell-Script
    1. # df -TP /var/www/virtual


    Thanks


    Code
    1. root@smurf:/# df -TP /var/www/virtual
    2. Filesystem Type 1024-blocks Used Available Capacity Mounted on
    3. /dev/simfs simfs 360654556 3908924 332457388 2% /


    EDIT:
    P.S.: It´s an OpenVZ Container.

  • @FISA4


    Ok, it's strange because the immutable flags are not supported on you file system normally. I wondering how the flag were applied... Does my previous answer helped you?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Ok got it.. In fact, simfs is not a file system... It's a map to a directory on the host (which can support immutable bit).. Well, I'll have to check that...

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • I'm installing openvz to test anyway... ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • See http://youtrack.i-mscp.net/ticket/1091 for the related ticket.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206