Fedora 16: 服务

来自Shiyin's note
跳到导航 跳到搜索

服务的启动,停止都通过systemctl来完成

  • 查看包含Network的服务
systemctl | grep Network

得到

sys-devi...et-eth0.device loaded active plugged       82577LC Gigabit Network Connection
NetworkManager.service    loaded active running       Network Manager
network.target            loaded active active        Network
  • 停止
systemctl stop NetworkManager.service
  • 还有status,reload,start等,具体可-h
  • 开机启动
systemctl enable NetworkManager.service

service启动时间

  • systemd-analyze blame

returns a list of various services launched at boot and the time it took to launch them and do their thing in milliseconds.

  • systemd-analyze plot > plot.svg

creates a graphic plot of the latest boot in SVG format.

  • systemctl stop SERVICENAME.service and systemctl disable SERVICENAME.service

stop a running service and disable it at boot respectively.


fedora 15的服务自动启动

以mysqld为例

  1. 确保/etc/rc.d/init.d/mysqld 存在,用service mysqld start能够正常启动
  2. 运行命令:chkconfig --add mysqld
  3. 运行命令: chkconfig --level 345 mysqld on
  • 启动的level含义
0:停机
1:单用户形式,只root进行维护
2:多用户,不能使用net file system
3:完全多用户
5:图形化
4:安全模式
6:重启
  • chkconfig的用法
 chkconfig –list [name]
 chkconfig –add name
 chkconfig –del name
 chkconfig [--level levels] name <on|off|reset>
 chkconfig [--level levels] name