GoAdmio

suspend

Suspend a hosting account: flag the site and its mailboxes as suspended, rebuild the web server configuration, and reload

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


Overview

/go/suspend marks a hosting account as suspended. It:

To lift a suspension, use unsuspend.

fixquota runs this command for accounts whose hosting has expired.

[!WARNING] The command doesn't check its argument. Run it without a domain and it calls apache and nginx with no argument. Those commands work on the whole server. See Syntax.


Quick start

/go/suspend example.com

Syntax

/go/suspend <domain> [reason]
Form Behavior
/go/suspend <domain> Suspends the account.
/go/suspend <domain> "<reason>" Same. The reason is only written to the log.

Always pass the domain. An empty domain makes the script run apache and nginx without an argument, and still print the success message.


Arguments

Argument Required Default Notes
<domain> Yes — The account's primary domain, as stored in GoAdmio. It is not checked.
[reason] No — A text such as `

The command has no --option flags.


Output

Outcome What you get
Any run Account <domain> has been suspended and the output of the web server commands.

The message is printed even if the domain doesn't exist, because nothing is checked. The exit code is the one of the last reload.

Logging

Every run is appended to /var/log/go/suspend.log, with all arguments, so the reason appears there.


Examples

# Suspend an account
/go/suspend example.com
# Suspend with a reason that is written to the log
/go/suspend example.com "| Abuse report 4711"
# Lift the suspension
/go/unsuspend example.com
# Check the flag
sqlite3 /var/lib/sqlite/site.db "SELECT Domain, Suspend FROM Site WHERE Domain='example.com'"

Troubleshooting

Symptom Likely cause Fix
The website still works after suspending The web server configuration wasn't rebuilt or reloaded. Run conf, then reload.
Email still works The script sets the mailbox flags but doesn't rebuild the mail configuration. Rebuild it with vmail and doveconf, and check whether mail is blocked.
The account owner can still use FTP, SSH, or cron The script doesn't touch them. Disable them separately, for example with shell and permission.
The success message appeared for a domain that doesn't exist Nothing is checked. Check the domain with the account list.
The command was run with no domain apache and nginx ran with no argument. Check the web server configuration, and rebuild it with conf if needed.
The reason isn't visible in the panel It is only logged. Read /var/log/go/suspend.log.
It is slow when many accounts are suspended in a row Each run rebuilds two configurations and reloads the web server twice. Suspend fewer accounts at a time.

Details

What it does

  1. Logs the call, and looks up the account's username (it isn't used afterwards).
  2. Sets Suspend to 1 for the domain in the Site table, and for every mailbox of the domain in the Mail table.
  3. Rebuilds the virtual host configuration with apache and nginx, then reloads PHP-FPM and the web server with reload.
  4. Prints Account <domain> has been suspended.
  5. Reloads again with reload.

What the visitors then see is decided by the configuration that apache and nginx write for a suspended account.

flowchart TD
    A["suspend domain"] --> B["Set Suspend flag on the site and its mailboxes"]
    B --> C["apache and nginx: rebuild vhosts"]
    C --> D["reload"]
    D --> E["Print message"]
    E --> F["reload again"]

Notes for maintainers

Issue Why it matters Suggested fix
The domain isn't checked An empty domain runs apache and nginx with no argument, which work on the whole server, and a wrong domain prints a false success message. Exit unless the domain is in the Site table.
The success message is always printed Callers like fixquota can't tell whether it worked. Print it only when the flag was set and the configuration was rebuilt.
Only the website and the mailbox flags are touched FTP, SSH, cron jobs, and running processes keep working unless they read the flag themselves. Disable them here, or document who does.
The mail system isn't rebuilt Mailboxes may stay active until the mail maps are rebuilt. Call the mail rebuild commands, or confirm that they read the flag live.
reload runs twice The web server is reloaded twice for one suspension. Keep one reload at the end.
The reason argument is ignored It is not stored with the account. Store it, and show it in the panel.
fixquota calls it on every run for expired accounts Each call rebuilds two configurations and reloads twice. Skip accounts that are already suspended.
Username is read but never used Dead code. Remove it.
The domain goes straight into SQL and is unquoted in commands A quote or space breaks the command. Validate against ^[a-z0-9.-]+$.
There is no root check Fails when not run as root (the log line uses sudo, but the rest depends on the caller). Re-run through sudo at the top, like most other commands.

See also

Command Description
unsuspend Unsuspend a GoAdmio account via the command line
fixquota Recalculate every account's disk and bandwidth usage, block FTP uploads over the disk quota, and suspend expired accounts
renew Update the hosting expiry date in GoAdmio
expire Check hosting and domain expiry dates and send email/WhatsApp notifications
delete Delete a GoAdmio account from the command line
conf Rebuild the Apache/Nginx configuration in GoAdmio
reload Reload PHP-FPM and the active web server