GoAdmio

checkid

Recreate the system/FTP user of every hosted account that is missing from the server, then restart PHP-FPM

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

Every GoAdmio account has a system user, which is also its FTP user, and PHP-FPM runs the account's site as that user. If the user is missing from the server, for example after the system user list was restored from an older state or after a migration, the site and its FTP login stop working.

/go/checkid finds these accounts and repairs them. For every hosted domain it:

The command does not renumber user IDs or group IDs, and it does not change IDs of users that already exist.


Quick start

/go/checkid

Syntax

/go/checkid

The command takes no options or arguments. If you run it without root, it re-runs itself with sudo.


Options

None. Any arguments you pass are ignored. The command always checks every folder in /home that has a www folder.


Output

The command prints nothing when every user exists. For each user it recreates, it prints one line:

Fix example.com (example.com)

The text in parentheses is the username stored for the domain.

Each run also adds a line to /var/log/go/checkid.log.


Examples

# Check all accounts and repair missing users
/go/checkid
# Confirm that a user exists afterwards
id example.com
# Back up the shadow file before a run
cp -a /etc/shadow /root/shadow.bak

Troubleshooting

Symptom Likely cause Fix
Nothing is printed Every account's user already exists. Nothing to do.
A Fix line appears on every run The user cannot be created, for example because the stored username is not valid. Check the username with username, and read /var/log/go/checkid.log.
Fix <domain> () with empty parentheses The folder has a www directory but no matching row in the GoAdmio database. Remove the leftover folder, or add the account again with create.
The site gives permission errors after the repair The files on disk are owned by a different numeric user ID than the new user has. Run fix to repair file and folder permissions.
A domain is skipped /home/<domain>/www does not exist. Check that the account exists.

Details

What it does, in order

  1. Logs the run to /var/log/go/checkid.log.
  2. Goes through every folder in /home. It skips folders without a www folder.
  3. For each domain, reads the Username from the Site table in /var/lib/sqlite/site.db.
  4. Checks the user with id. If the user exists, it moves on to the next domain.
  5. If the user does not exist:
    1. prints Fix <domain> (<username>)
    2. deletes the line that starts with <username>: from /etc/shadow
    3. creates the user again with the internal adduser helper
  6. If at least one user was recreated, restarts PHP-FPM with fpm, with the note | Executed by checkid.

Safety

[!WARNING] The command edits /etc/shadow directly. Make a copy before you run it on a server with many accounts.

Known issues


See also

Command Description
fix Fix GoAdmio file and folder permissions
create Create a GoAdmio account from the command line
username Change the GoAdmio account username
fpm Restart all installed PHP-FPM versions on your server
recover Restore a deleted account from its latest snapshot
serversync Back up and migrate a GoAdmio server with all configurations