Articles in this section

Different operations on Plesk for Linux server fail: /usr/sbin/usermod execution failed: usermod: user is currently used by process

kb: bug kb: fixed Plesk for Linux

Applicable to:

  • Plesk for Linux

Symptoms

  • On a Plesk for Linux server, different operations like:

    • renaming the subscription's system user in Domains > example.com > Hosting & DNS > Hosting;
    • modifying settings of an additional FTP user in Domains > example.com > FTP;
    • renaming a domain;
    • restoring a Plesk backup;
    • deleting a web user;

    fail with the error like below which can be also found in the log file /var/log/plesk/panel.log and/or in the "Network" tab of the browser's DevTools:

    Internal server error


    SysUser::update() failed: Unable to execute usermng: usermng: /usr/sbin/usermod execution failed: usermod: user johndoe is currently used by process 4758 usermng: Unable to modify user: johndoe


    Unable to execute usermng: usermng: /usr/sbin/userdel execution failed: userdel: user johndoe is currently used by process 4382 usermng: Unable to delete user: johndoe


    usermod: user johndoe is currently used by process 2367804
    usermng: Unable to modify user: johndoe

  • The PHP handler FPM application is set as a PHP handler in the menu Domains > example.com > PHP.

Cause

Product issue:

  • #PPPM-10717 "Fixed the issue where renaming subscription system users and additional FTP users could sometimes fail with the “user xxx is currently used by process xxxxx” error."
    Fixed in:

Resolution

Please consider updating your server:

Workaround

Until the bug is fixed, use the workaround:

  1. Log in to Plesk.

  2. Perform one of the following actions in each domain of the affected subscription:

    • Change the PHP handler to FastCGI application: go to Domains > example.com > PHP and in the option run PHP as, change the handler from FPM application to FastCGI application, and click OK or Apply at the bottom of the page.

      Untitled.png

    • Disable PHP: go to Domains > example.com > PHP, disable the option PHP support, and click OK or Apply at the bottom of the page.

  3. Suspend the affected subscription.

  4. Connect to the server using SSH.

  5. If Cgroups Manager is installed and enabled, disable it:

    # plesk sbin resctrl --disable

  6. Execute the following command, replacing $username with the name of the subscription's system user:

    # killall -TERM -u $username; sleep 1; killall -KILL -u $username

    Note: to find the subscripton's system user name, check the field Username under System user's credentials in the menu Domains > example.com > Hosting & DNS > Hosting.

  7. In the Plesk interface, perform the operation that was failing.

  8. Revert changes made in steps 2, 3, and 5.

    Note: for reverting step 5, execute the command plesk sbin resctrl --enable.

OLD, was replaced by request from R&D, email thread "[KB update request] 12377460666775 - usermod: user is currently used by process".

old w/a

Until the bug is fixed, use the workaround:

  1. Log in to Plesk.

  2. Go to Domains > example.com > PHP Settings and switch the PHP handler from FPM to CGI/FastCGI one.
    Untitled.png

    Note: If only FPM by nginx is present in Domains > example.com > PHP Settings, enable the option Proxy Mode in Domains > example.com > Apache and nginx Settings.

    Screenshot_1.png

  3. Perform the operation that was failing.

  4. Set PHP-FPM handler back in Domains > example.com > PHP Settings

  5. If the issue still persists, temporarily suspend the subscription and try again.

Was this article helpful?

Comments

2 comments
Date Votes
  • Sorry but the resolution in the article is misleading. usedmod fails because the user has active processes.

    Resolution:

    ssh into plesk and execute the following command to terminate user processes.

    sudo killall -s TERM -u username

    After user processes are terminated usermod won't fail anymore.

    0
  • None of the solutions in this article worked for us. It appears that Plesk is spawning a user process *just* prior to trying to change the username on the subscription/system user. Selman's solution above only worked when we triggered the username change, then repeatedly ran the command while the change was in progress and did so until success.

    0

Please sign in to leave a comment.