Enabling the Service To configure a service to be automatically started at boot time, use the systemctl command in the following form: systemctlenable service_name .service The service will be started the next time you boot the system. For information on how to start the service immediately, refer to Section 7.2.2, “Running the Service” . Example 7.1. Enabling the httpd service Imagine you want to run the Apache HTTP Server on your system. Provided that you have the httpd package installed, you can enable the httpd service by typing the following at a shell prompt as root: ~]#systemctl enable httpd.service
7.1.2. Disabling the Service To disable starting a service at boot time, use the systemctl command in the following form: systemctldisable service_name .service The next time you boot the system, the service will not be started. For information on how to stop the service immediately, refer to Section 7.2.3, “Stopping the Service” . Example 7.2. Disabling the telnet service In order to secure the system, users are advised to disable insecure connection protocols such as Telnet. You can make sure that the telnet service is disabled by running the following command as root:
~]# systemctl disable telnet.service
查询状态:
To ensure optimal performance on POWER architecture, it is recommended that the irqbalance service is enabled. In most cases, this service is installed and configured to run during the Fedora 16 installation. To verify that irqbalance is running, type the following at a shell prompt:systemctl status irqbalance.service
例子:fedora17
[leosu@leo ELYMUS_work]$ sudo systemctl disable httpd.service
rm '/etc/systemd/system/multi-user.target.wants/httpd.service'
[leosu@leo ELYMUS_work]$ ls /etc/systemd/system/multi-user.target.wants/
abrt-ccpp.service acpid.service avahi-daemon.service irqbalance.service nfs-lock.service sendmail.service xinetd.service
abrtd.service arp-ethers.service crond.service mcelog.service remote-fs.target smartd.service
abrt-oops.service atd.service cups.path mdmonitor.service rpcbind.service sm-client.service
abrt-vmcore.service auditd.service gpm.service NetworkManager.service rsyslog.service sshd.service