How to list startup services at boot time in Fedora Linux

last updated in Categories ,

I am a new Fedora Linux desktop user. How can I list all start services in Fedora Linux using the command line? How do I use systemctl command to list all services running and enabled on Fedora Linux at startup time?

Introduction – The systemd is a service manager for Fedora Linux operating systems. When run as the first process of boot (as PID 1), it acts as init system that brings up and maintains userspace services on Fedora. One can use systemctl command to control the systemd system and service manager on Fedora Linux. This page shows how to display all startup services at boot time in Fedora Linux.

How to list startup services at boot time in Fedora

Open the terminal application. Type the following systemctl command to list running services:
systemctl -t service --state=active

Fedora Linux list all running services
Click to elage

How to list all services on Fedora

systemctl -at service
Fedora Linux list all services using systemctl command
You can use the following ls command too:
ls /etc/systemd/system/*.service
ls /usr/lib/systemd/system/*.service

How to display all enabled services using systemctl of systemd on Fedora

To list all enabled services in Fedora Linux, type:
systemctl list-unit-files --state=enabled
Fedora Linux systemctl list all services command
You can also filter out information using grep command:
systemctl list-unit-files | grep enabled
systemctl | grep running

How do I see if service named sshd enabled at boot time on Fedora?

Try the following syntax:
systemctl is-enabled {service}
systemctl is-enabled sshd.service

Sample outputs:

enabled

How to see if service is running/enabled on Fedora Linux

systemctl status {service}
systemctl status sshd.service

Is service enabled at boot time on Fedora Linux
Is sshd service enabled at boot time on my Fedora Linux box?

How do I enable service at boot time?

sudo systemctl enable {service}
sudo systemctl enable sshd.service

How do I disable service at boot time?

sudo systemctl disable {service}
sudo systemctl disable nginx.service

Stop a running service on Fedora Linux

sudo systemctl stop {service}
sudo systemctl stop nginx.service

Start a running service on Fedora Linux

sudo systemctl start {service}
sudo systemctl start nginx.service

Restart a running service on Fedora Linux

sudo systemctl restart {service}
sudo systemctl restart nginx.service

Reload a running service on Fedora Linux

sudo systemctl reload {service}
## edit file ##
sudo vi /etc/nginx/nginx.conf
## reload nginx ##
sudo systemctl reload nginx.service

How to see error messages or logs for given service name on Fedora Linux

journalctl -u {service}
journalctl -u sshd.service
journalctl -u network.service

Sample outputs:

-- Logs begin at Tue 2019-01-08 22:44:44 IST, end at Tue 2019-01-15 01:54:02 IST. --
Jan 09 00:36:41 nixcraft-asus systemd[1]: Starting OpenSSH server daemon...
Jan 09 00:36:41 nixcraft-asus sshd[7826]: Server listening on 0.0.0.0 port 22.
Jan 09 00:36:41 nixcraft-asus sshd[7826]: Server listening on :: port 22.
Jan 09 00:36:41 nixcraft-asus systemd[1]: Started OpenSSH server daemon.
Jan 09 00:46:58 nixcraft-asus sshd[8088]: Accepted password for vivek from 192.168.2.18 port 43104 ssh2
Jan 09 00:46:58 nixcraft-asus sshd[8088]: pam_unix(sshd:session): session opened for user vivek by (uid=0)
Jan 09 00:48:37 nixcraft-asus sshd[8232]: Connection closed by 192.168.2.18 port 43106 [preauth]
Jan 09 00:48:37 nixcraft-asus sshd[8234]: Connection closed by 192.168.2.18 port 43108 [preauth]
Jan 09 00:49:12 nixcraft-asus sshd[8241]: Connection closed by authenticating user root 192.168.2.18 port 43110 [preauth]
Jan 09 00:49:12 nixcraft-asus sshd[8244]: Connection closed by authenticating user root 192.168.2.18 port 43112 [preauth]
Jan 09 00:49:15 nixcraft-asus sshd[8246]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.2.18  user=root
Jan 09 00:49:15 nixcraft-asus sshd[8246]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Jan 09 00:49:17 nixcraft-asus sshd[8246]: Failed password for root from 192.168.2.18 port 43114 ssh2
Jan 09 00:49:32 nixcraft-asus sshd[8246]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"
Jan 09 00:49:34 nixcraft-asus sshd[8246]: Failed password for root from 192.168.2.18 port 43114 ssh2
Jan 09 00:51:00 nixcraft-asus sshd[8246]: Connection closed by authenticating user root 192.168.2.18 port 43114 [preauth]
Jan 09 00:51:00 nixcraft-asus sshd[8246]: PAM 1 more authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.2.18  user=root

Conclusion

And there you have it, various systemctl commands to list services at boot time running on Fedora Linux. For more information see this page here.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at www.nixcraft.com

Historical Comment Archive

1 comment

    Still, have a question? Get help on our forum!