查看安装的独立的源码包
安装xinted
[[email protected] rpm]# yum -y install xinetd
看rpm包安装的服务的自启动状态
[[email protected] rpm]# chkconfig --list
注:该输出结果只显示SysV 服务,并不包含
原生 systemd 服务。SysV 配置数据
可能被原生 systemd 配置覆盖。
要列出 systemd 服务,请执行 'systemctl list-unit-files'。
查看在具体 target 启用的服务请执行
'systemctl list-dependencies [target]'。
mysqld 0:关 1:关 2:开 3:开 4:开 5:开 6:关
netconsole 0:关 1:关 2:关 3:关 4:关 5:关 6:关
network 0:关 1:关 2:开 3:开 4:开 5:开 6:关
rabbitmq-server 0:关 1:关 2:关 3:开 4:关 5:开 6:关
redis_6379 0:关 1:关 2:开 3:开 4:开 5:开 6:关
基于 xinetd 的服务:
chargen-dgram: 关
chargen-stream: 关
daytime-dgram: 关
daytime-stream: 关
discard-dgram: 关
discard-stream: 关
echo-dgram: 关
echo-stream: 关
tcpmux-server: 关
time-dgram: 关
time-stream: 关
[[email protected] rpm]#
/etc/services 下包括所有端口的相关信息
看启动了哪些服务?
[[email protected] etc]# netstat -tlunp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 1230/redis-server 0
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:4369 0.0.0.0:* LISTEN 1758/epmd
tcp 0 0 192.168.122.1:53 0.0.0.0:* LISTEN 1681/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1116/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1118/cupsd
tcp 0 0 0.0.0.0:25672 0.0.0.0:* LISTEN 2013/beam.smp
tcp6 0 0 :::111 :::* LISTEN 1/systemd
tcp6 0 0 :::4369 :::* LISTEN 1758/epmd
tcp6 0 0 :::22 :::* LISTEN 1116/sshd
tcp6 0 0 ::1:631 :::* LISTEN 1118/cupsd
tcp6 0 0 :::5672 :::* LISTEN 2013/beam.smp
tcp6 0 0 :::3306 :::* LISTEN 1619/mysqld
udp 0 0 0.0.0.0:39561 0.0.0.0:* 712/avahi-daemon: r
udp 0 0 0.0.0.0:36901 0.0.0.0:* 921/dhclient
udp 0 0 192.168.122.1:53 0.0.0.0:* 1681/dnsmasq
udp 0 0 0.0.0.0:67 0.0.0.0:* 1681/dnsmasq
udp 0 0 0.0.0.0:68 0.0.0.0:* 921/dhclient
udp 0 0 0.0.0.0:5353 0.0.0.0:* 712/avahi-daemon: r
udp 0 0 127.0.0.1:323 0.0.0.0:* 722/chronyd
udp6 0 0 :::15428 :::* 921/dhclient
udp6 0 0 ::1:323 :::* 722/chronyd
[[email protected] etc]#
rpm包
rpm安装的服务的相关信息。
tail命令负责查看文件的信息
[[email protected] ~]$ tail /var/log/rabbitmq/[email protected]
msg_store_transient: usingrabbit_msg_store_ets_index to provide index
=INFO REPORT==== 27-May-2018::22:31:54 ===
msg_store_persistent: usingrabbit_msg_store_ets_index to provide index
=INFO REPORT==== 27-May-2018::22:31:54 ===
started TCP Listener on [::]:5672
=INFO REPORT==== 27-May-2018::22:31:54 ===
Server startup complete; 0 plugins started.
[[email protected] ~]$
使用命令启动和关闭rpm包安装的服务
[[email protected] mk]# service rabbitmq-server stop
Stopping rabbitmq-server (viasystemctl): [ 确定 ]
[[email protected] mk]# service rabbitmq-server start
Starting rabbitmq-server (viasystemctl): [ 确定 ]
[[email protected] mk]# netstat -tlunp
Active Internet connections (only servers)
查看已经开放的端口:
firewall-cmd--list-ports