#systemctl
19 one-liners with this tag.
All one-liners tagged systemctl
Change service settings with an override
#systemctl edit mariadb
Check the status of the Plesk core services
#systemctl status sw-engine sw-cp-server psa --no-pager
Disable an Apache module and reload the configuration
#a2dismod autoindex && apache2ctl configtest && systemctl reload apache2
Enable a service and start it immediately
#systemctl enable --now fail2ban
Enable an Apache module and reload the configuration
#a2enmod headers && apache2ctl configtest && systemctl reload apache2
Enable an Apache site and reload
#a2ensite example.com && apache2ctl configtest && systemctl reload apache2
List all running systemd services
$systemctl list-units --type=service --state=running --no-pager
List all services enabled at boot
$systemctl list-unit-files --type=service --state=enabled --no-pager
Query uptime, memory and restart count of a service
$systemctl show php8.2-fpm -p ActiveState,ActiveEnterTimestamp,MainPID,MemoryCurrent,NRestarts
Restart a service and check the result
#systemctl restart php8.2-fpm && systemctl is-active php8.2-fpm
Restart the Plesk panel when the interface does not load
#systemctl restart sw-engine sw-cp-server
Show a service's unit file including overrides
$systemctl cat mariadb
Show all failed systemd units
$systemctl --failed --no-pager
Show all systemd timers with next run time
$systemctl list-timers --all --no-pager
Show the dependencies of a systemd unit
$systemctl list-dependencies apache2 --no-pager
Show the full status of a systemd service
$systemctl status nginx --no-pager -l
Stop a service and disable autostart
#systemctl disable --now cups
Test the nginx configuration and reload only on success
#nginx -t && systemctl reload nginx
Test the sshd config and reload the SSH service
#sshd -t && systemctl reload ssh