Services on Fedora 21

Yesterday, I was asked as to whether Apache webserver (httpd) was installed on a F21 Workstation installation.  The short answer is yes.  However, it’s not running by default.  So, this might be a good time to go over how Fedora has changed in respect to services.

Services used to be handled through the use of sysvinit scripts that resided in /etc/rc.d/init.d/.  Now, however, they are managed through systemd and systemctl (front-end for systemd).  So, in order to enable a service to start at boot time, you would (as root user) do:

# systemctl enable service_name.service

For httpd, it would then be this command:

# systemctl enable httpd.service

You can stop a service from running at boot time by substituting disable for enable.  In order to check on the status or to start or stop a service, (httpd, for example) you would use one of the following commands:

# systemctl start httpd

# systemctl stop httpd

# systemctl status httpd

You may have noticed that I dropped the .service from the commands….  The old ‘service httpd status’ command structure is ‘passed off’ to systemctl, as are any sysvinit scrips that haven’t been ported to systemd.  You can also still start services in /etc/rc.d/rc.local but there is no telling when that will be depreciated, or if it will.  So, the moral of the story is to start getting used to systemd.  😉