↑ ↓ select, Enter open, Esc close

#systemctl

19 one-liners with this tag.

All one-liners tagged systemctl

Change service settings with an override

#systemctl edit mariadb
cautionsystemd

Check the status of the Plesk core services

#systemctl status sw-engine sw-cp-server psa --no-pager
harmlessPlesk

Disable an Apache module and reload the configuration

#a2dismod autoindex && apache2ctl configtest && systemctl reload apache2
cautionApache

Enable a service and start it immediately

#systemctl enable --now fail2ban
cautionsystemd

Enable an Apache module and reload the configuration

#a2enmod headers && apache2ctl configtest && systemctl reload apache2
cautionApache

Enable an Apache site and reload

#a2ensite example.com && apache2ctl configtest && systemctl reload apache2
cautionApache

List all running systemd services

$systemctl list-units --type=service --state=running --no-pager
harmlesssystemd

List all services enabled at boot

$systemctl list-unit-files --type=service --state=enabled --no-pager
harmlesssystemd

Query uptime, memory and restart count of a service

$systemctl show php8.2-fpm -p ActiveState,ActiveEnterTimestamp,MainPID,MemoryCurrent,NRestarts
harmlesssystemd

Restart a service and check the result

#systemctl restart php8.2-fpm && systemctl is-active php8.2-fpm
cautionsystemd

Restart the Plesk panel when the interface does not load

#systemctl restart sw-engine sw-cp-server
cautionPlesk

Show a service's unit file including overrides

$systemctl cat mariadb
harmlesssystemd

Show all failed systemd units

$systemctl --failed --no-pager
harmlesssystemd

Show all systemd timers with next run time

$systemctl list-timers --all --no-pager
harmlesssystemd

Show the dependencies of a systemd unit

$systemctl list-dependencies apache2 --no-pager
harmlesssystemd

Show the full status of a systemd service

$systemctl status nginx --no-pager -l
harmlesssystemd

Stop a service and disable autostart

#systemctl disable --now cups
cautionsystemd

Test the nginx configuration and reload only on success

#nginx -t && systemctl reload nginx
cautionnginx

Test the sshd config and reload the SSH service

#sshd -t && systemctl reload ssh
cautionSSH

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.