Linux系统服务管理
服务命令比较
操作 | Linux 6 | Linux7 |
服务开机自动启动 | chkconfig --level 35 iptables on | systemctl enable firewalld.service |
服务器开机不自动启动 | chkconfig --level 35 iptables off | systemctl disable firewalld.service |
加入自定义服务 | chkconfig --add aaa | systemctl load aaa.service |
删除服务 | chkconfig --del aaa | 停止服务,删除相应的配置文件 |
显示所有已经启动的服务 | chkconfig -- list | systemctl list-unis --type=service |
启动服务 | service iptables start | systemctl start firewalld.service |
停止服务 | service iptables stop | systemctl stop firewalld.service |
服务状态 | service iptables status | systemctl status firewalld.service |
重启服务 | service iptables restart | systemctl restart firewalld.service |
Linux 6
[root@mysql57 ~]# service iptables status
iptables: Firewall is not running.[root@mysql57 ~]# service iptables start
iptables: Applying firewall rules: [ OK ]
[root@mysql57 ~]# service iptables status
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
2 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
3 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
5 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT)
num target prot opt source destination
1 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
[root@mysql57 ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
[root@mysql57 ~]# service iptables status
iptables: Firewall is not running.[root@mysql57 ~]# chkconfig --list | more
NetworkManager 0:off 1:off 2:off 3:off 4:off 5:off 6:off
abrt-ccpp 0:off 1:off 2:off 3:on 4:off 5:on 6:off
abrtd 0:off 1:off 2:off 3:on 4:off 5:on 6:off
acpid 0:off 1:off 2:on 3:on 4:on 5:on 6:off
atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
blk-availability 0:off 1:on 2:on 3:on 4:on 5:on 6:off
bluetooth 0:off 1:off 2:off 3:on 4:on 5:on 6:off
certmonger 0:off 1:off 2:off 3:on 4:on 5:on 6:off
cpuspeed 0:off 1:on 2:on 3:on 4:on 5:on 6:off
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
cups 0:off 1:off 2:on 3:on 4:on 5:on 6:off
dnsmasq 0:off 1:off 2:off 3:off 4:off 5:off 6:off
firstboot 0:off 1:off 2:off 3:off 4:off 5:off 6:off
haldaemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off
htcacheclean 0:off 1:off 2:off 3:off 4:off 5:off 6:off
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ip6tables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
irqbalance 0:off 1:off 2:off 3:on 4:on 5:on 6:off
kdump 0:off 1:off 2:off 3:off 4:off 5:off 6:off
lvm2-monitor 0:off 1:on 2:on 3:on 4:on 5:on 6:off
mdmonitor 0:off 1:off 2:on 3:on 4:on 5:on 6:off
messagebus 0:off 1:off 2:on 3:on 4:on 5:on 6:off
netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off
netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nfs 0:off 1:off 2:off 3:off 4:off 5:off 6:off
nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off
ntpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
ntpdate 0:off 1:off 2:off 3:off 4:off 5:off 6:off
oddjobd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
portreserve 0:off 1:off 2:on 3:on 4:on 5:on 6:off
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off
psacct 0:off 1:off 2:off 3:off 4:off 5:off 6:off
quota_nld 0:off 1:off 2:off 3:off 4:off 5:off 6:off35启动级别关闭自启动
[root@mysql57 ~]# chkconfig --level 35 iptables off[root@mysql57 ~]# ls /etc/init.d/
abrt-ccpp cups irqbalance nfslock rngd spice-vdagentd
abrtd dnsmasq kdump ntpd rpcbind sshd
abrt-oops firstboot killall ntpdate rpcgssd sssd
acpid functions lvm2-lvmetad oddjobd rpcidmapd sysstat
atd haldaemon lvm2-monitor ohasd rpcsvcgssd udev-post
auditd halt mdmonitor portreserve rsyslog wdaemon
autofs htcacheclean messagebus postfix sandbox winbind
blk-availability httpd netconsole psacct saslauthd wpa_supplicant
bluetooth init.ohasd netfs quota_nld single ypbind
certmonger init.tfa network rdisc smartd
cpuspeed ip6tables NetworkManager restorecond snmpd
crond iptables nfs rhnsd snmptrapd
Linux 7
[root@mysql57 ~]# cd /etc/systemd/system/
basic.target.wants/
bluetooth.target.wants/
default.target.wants/
dev-virtio\x2dports-org.qemu.guest_agent.0.device.wants/
getty.target.wants/
graphical.target.wants/
local-fs.target.wants/
multi-user.target.wants/
network-online.target.wants/
printer.target.wants/
remote-fs.target.wants/
sockets.target.wants/
sysinit.target.wants/
systemd-remount-fs.service.wants/
system-update.target.wants/
timers.target.wants/
vmtoolsd.service.requires/
[root@mysql57 ~]# cd /etc/systemd/system/
[root@mysql57 system]# ls
basic.target.wants
bluetooth.target.wants
dbus-org.bluez.service
dbus-org.fedoraproject.FirewallD1.service
dbus-org.freedesktop.Avahi.service
dbus-org.freedesktop.ModemManager1.service
dbus-org.freedesktop.nm-dispatcher.service
default.target
default.target.wants
dev-virtio\x2dports-org.qemu.guest_agent.0.device.wants
display-manager.service
getty.target.wants
graphical.target.wants
local-fs.target.wants
multi-user.target.wants
network-online.target.wants
printer.target.wants
remote-fs.target.wants
sockets.target.wants
sysinit.target.wants
systemd-remount-fs.service.wants
system-update.target.wants
timers.target.wants
vmtoolsd.service.requires[root@mysql57 system]# cd multi-user.target.wants/
[root@mysql57 multi-user.target.wants]# ls
abrt-ccpp.service initial-setup-reconfiguration.service remote-fs.target
abrtd.service irqbalance.service rhel-configure.service
abrt-oops.service ksm.service rngd.service
abrt-vmcore.service ksmtuned.service rpcbind.service
abrt-xorg.service libstoragemgmt.service rsyslog.service
atd.service libvirtd.service smartd.service
auditd.service mcelog.service sshd.service
avahi-daemon.service mdmonitor.service sysstat.service
brandbot.path ModemManager.service tuned.service
crond.service NetworkManager.service vdo.service
cups.path nfs-client.target vmtoolsd.service
cups.service oracleasm.service
firewalld.service postfix.service[root@mysql57 multi-user.target.wants]# cd ..
[root@mysql57 system]# find ./ -name fire*
./multi-user.target.wants/firewalld.service
[root@mysql57 system]# cd multi-user.target.wants/[root@mysql57 multi-user.target.wants]# cd /usr/lib/systemd/
[root@mysql57 systemd]# ls
catalog systemd-coredump systemd-shutdown
import-pubring.gpg systemd-cryptsetup systemd-shutdownd
ntp-units.d systemd-fsck systemd-sleep
ol-consolebaud systemd-hibernate-resume systemd-socket-proxyd
rhel-autorelabel systemd-hostnamed systemd-sysctl
rhel-configure systemd-importd systemd-sysv-install
rhel-dmesg systemd-initctl systemd-timedated
rhel-dmraid-activation systemd-journald systemd-udevd
rhel-domainname systemd-localed systemd-update-done
rhel-import-state systemd-logind systemd-update-utmp
rhel-loadmodules systemd-machined systemd-user-sessions
rhel-readonly systemd-machine-id-commit systemd-vconsole-setup
scripts systemd-modules-load system-generators
system systemd-pstore system-preset
systemd systemd-pull system-shutdown
systemd-ac-power systemd-quotacheck system-sleep
systemd-activate systemd-random-seed user
systemd-backlight systemd-readahead user-generators
systemd-binfmt systemd-remount-fs user-preset
systemd-bootchart systemd-reply-password
systemd-cgroups-agent systemd-rfkill[root@mysql57 systemd]# systemctl status firewalld.service
实际加载的/usr/lib/systemd/system/firewalld.service
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)Active: active (running) since Tue 2022-08-23 13:05:37 CST; 12min agoDocs: man:firewalld(1)Main PID: 1026 (firewalld)Tasks: 2CGroup: /system.slice/firewalld.service└─1026 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopidAug 23 13:05:36 mysql57.example.com systemd[1]: Starting firewalld - dynamic firewal.....
Aug 23 13:05:37 mysql57.example.com systemd[1]: Started firewalld - dynamic firewall...n.
Aug 23 13:05:37 mysql57.example.com firewalld[1026]: WARNING: AllowZoneDrifting is en....
Hint: Some lines were ellipsized, use -l to show in full.[root@mysql57 system]# ls | grep firewalld
firewalld.service
[root@mysql57 system]# pwd
/usr/lib/systemd/system关闭防火墙
[root@mysql57 system]# systemctl stop firewalld.service disable
[root@mysql57 system]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.启动防护墙,开机不启动因为是disabled
[root@mysql57 system]# systemctl start firewalld.service
[root@mysql57 system]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: active (running) since Tue 2022-08-23 15:14:24 CST; 2s agoDocs: man:firewalld(1)Main PID: 4701 (firewalld)Tasks: 4CGroup: /system.slice/firewalld.service├─4701 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid├─4729 /usr/sbin/modprobe nf_conntrack├─4730 sh -c /usr/sbin/modprobe --ignore-install nf_conntrack && /usr/sb...└─4731 /usr/sbin/modprobe --ignore-install nf_conntrackAug 23 15:14:19 mysql57.example.com systemd[1]: Starting firewalld - dynamic firewal.....
Aug 23 15:14:24 mysql57.example.com systemd[1]: Started firewalld - dynamic firewall...n.
Aug 23 15:14:25 mysql57.example.com firewalld[4701]: WARNING: AllowZoneDrifting is en....
Hint: Some lines were ellipsized, use -l to show in full.
相关文章:
Linux系统服务管理
服务命令比较 操作 Linux 6 Linux7 服务开机自动启动 chkconfig --level 35 iptables on systemctl enable firewalld.service 服务器开机不自动启动 chkconfig --level 35 iptables off systemctl disable firewalld.service 加入自定义服务 chkconfig --add aaa s…...

C#之控制台版本得贪吃蛇
贪吃蛇小时候大家都玩过,具体步骤如下: 1.给游戏制造一个有限得空间。 2.生成墙壁,小蛇碰撞到墙壁或者咬到自己的尾巴,游戏结束。 3.生成随机的食物。 4.吃掉食物,增加自身的体长,并生成新的食物。 具体代码如下&…...

ffplay数据结构分析(一)
本文为相关课程的学习记录,相关分析均来源于课程的讲解,主要学习音视频相关的操作,对字幕的处理不做分析 下面我们对ffplay的相关数据结构进行分析,本章主要是对PacketQueue的讲解 struct MyAVPacketList和PacketQueue队列 ffp…...

JavaWeb学习|JSP相关内容
1.什么是JSP Java Server Pages: Java服务器端页面,也和Servlet一样,用于动态Web技术! 最大的特点: 。写JSP就像在写HTML 。区别: 。HTML只给用户提供静态的数据 。JSP页面中可以嵌入JAVA代码,为用户提供动态数据 JSP最终也会被转换成为一…...

Springboot后端通过路径映射获取本机图片资源
项目场景: 项目中对图片的处理与查看是必不可少的,本文将讲解如何通过项目路径来获取到本机电脑的图片资源 如图所示,在我的本机D盘的图片测试文件夹(文件夹名字不要有中文)下有一些图片, 我们要在浏览器上访问到这些图片&#…...

【IDEA + Spark 3.4.1 + sbt 1.9.3 + Spark MLlib 构建鸢尾花决策树分类预测模型】
决策树进行鸢尾花分类的案例 背景说明: 通过IDEA Spark 3.4.1 sbt 1.9.3 Spark MLlib 构建鸢尾花决策树分类预测模型,这是一个分类模型案例,通过该案例,可以快速了解Spark MLlib分类预测模型的使用方法。 依赖 ThisBuild /…...

亚马逊 EC2服务器下部署java环境
1. jdk 1.8 安装 1.1 下载jdk包 官网 Java Downloads | Oracle tar.gz 包 下载下来 1.2 本地连接 服务器 我用的是亚马逊的ec2 系统是 ubuntu 的 ssh工具是 Mobaxterm , 公有dns 创建实例时的秘钥 链接 Mobaxterm 因为使用的 ubuntu 所以登录的 名称 就是 ubuntu 然后 …...

CTF流量题解http1.pcapng
使用Wireshark工具打开流量文件http1.pcapng,如下图所示。 在过滤检索栏输入http,wireshark自动进行过滤。...
若依vue前端有全局用户信息变量吗
"若依"是一个基于SpringBoot和Vue的前后端分离的开源项目。在前端Vue部分,全局用户信息通常保存在Vuex中,Vuex是Vue.js的状态管理模式。它提供了一个集中式存储来管理所有组件的状态,并以相应的规则保证状态以一种可预测的方式发生…...

什么是Milvus
原文出处:https://www.yii666.com/blog/393941.html 什么是Milvus Milvus 是一款云原生向量数据库,它具备高可用、高性能、易拓展的特点,用于海量向量数据的实时召回。 Milvus 基于 FAISS、Annoy、HNSW 等向量搜索库构建,核心是…...

如何快速实现三菱FX3U程序的无线下载?
1.系统概述 三菱PLC FX3u可以使用专用下载线通过计算机串口下载程序,同样也可以使用自制下载线缆,连接无线模块 DTD435M进行远程无线下载程序,计算机端采用RS232或者RS485 将计算机端与无线模块连接,PLC端同样使用RS232转RS485将…...

Flink源码之RPC
Flink是一个典型的Master/Slave分布式实时处理系统,分布式系统组件之间必然涉及通信,也即RPC,以下图展示Flink组件之间的关系: RPCGateWay 一般RPC框架可根据用户业务类生成客户端和服务器端通信底层代码,此时只需定…...

【LeetCode 75】第二十四题(2390)从字符串中移除星号
目录 题目: 示例: 分析: 代码运行结果: 题目: 示例: 分析: 题目给我们一个字符串,然后字符串中包含星号*,要求每个星号消除一个从星号左边起最近的一个字符…...

通向架构师的道路之weblogic的集群与配置
一、Weblogic的集群 还记得我们在第五天教程中讲到的关于Tomcat的集群吗? 两个tomcat做node即tomcat1, tomcat2,使用Apache HttpServer做请求派发。 现在看看WebLogic的集群吧,其实也差不多。 区别在于: Tomcat的集群的实现为两个物理上…...

SpringBoot 项目创建与运行
一、Spring Boot 1、什么是Spring Boot?为什么要学 Spring Boot Spring 的诞生是为了简化 Java 程序的开发的,而 Spring Boot 的诞生是为了简化 Spring 程序开发的。 Spring Boot 翻译一下就是 Spring 脚手架 盖房子的这个架子就是脚手架,…...

FOHEART H1数据手套:连接虚拟与现实,塑造智能交互新未来
在全新交互时代背景中,数据手套无疑是一种重要的科技产物。它不仅彻底改变了我们与虚拟世界的互动方式,更为我们提供了一种全新、更为直观的交互形式。 FOHEART H1数据手套结合了虚拟现实、手势识别等高新技术,用先进的传感技术和精准的数据…...
MyBatis学习笔记3
日志 1.日志工厂 如果一个数据库的操作,出现了异常,我们需要排错。日志就是最好的工具。 日志工厂:SLF4JLOG4J(掌握)LOG4J2JDK_LOGGINGCOMMONS_LOGGINGSTDOUT_LOGGING(掌握)NO_LOGGING 2.分页 减少数据…...
ES6学习-Symbol
Symbol 数据类型Symbol,表示独一无二的值。 对象的属性名可有两种类型,一种是原来的字符串,另一种是新增的 Symbol 类型 可以保证不与其他属性名产生冲突。 let s1 Symbol() let s2 Symbol() console.log(s1, s2, s1 s2)//Symbol() Sy…...

【Redis】使用Docker镜像配置集群时的Operation timed out问题
不知道有没有小伙伴跟我一样是使用的Docker镜像进行Redis集群案例模拟的(三台虚拟机确实带不动 ),然后我遇到了一个问题:Could not connect to Redis at 172.17.0.2:6379: Operation timed out 172.17.0.2是我其中一个Redis实例的…...

Java 生产初学常用注解
目录 0. 基础语法逻辑运算符继承抛出异常获取数据方式泛型 1. 接收前端数据(controller)mybatis1. QueryWrapper获取和赋值 2. service 层注解 3. Dao 层(与数据库交互)3.1 mybatis-plus中BaseMapper 4. ELK框架es配置sql参数logs…...
vscode里如何用git
打开vs终端执行如下: 1 初始化 Git 仓库(如果尚未初始化) git init 2 添加文件到 Git 仓库 git add . 3 使用 git commit 命令来提交你的更改。确保在提交时加上一个有用的消息。 git commit -m "备注信息" 4 …...
SkyWalking 10.2.0 SWCK 配置过程
SkyWalking 10.2.0 & SWCK 配置过程 skywalking oap-server & ui 使用Docker安装在K8S集群以外,K8S集群中的微服务使用initContainer按命名空间将skywalking-java-agent注入到业务容器中。 SWCK有整套的解决方案,全安装在K8S群集中。 具体可参…...

无法与IP建立连接,未能下载VSCode服务器
如题,在远程连接服务器的时候突然遇到了这个提示。 查阅了一圈,发现是VSCode版本自动更新惹的祸!!! 在VSCode的帮助->关于这里发现前几天VSCode自动更新了,我的版本号变成了1.100.3 才导致了远程连接出…...

【MATLAB代码】基于最大相关熵准则(MCC)的三维鲁棒卡尔曼滤波算法(MCC-KF),附源代码|订阅专栏后可直接查看
文章所述的代码实现了基于最大相关熵准则(MCC)的三维鲁棒卡尔曼滤波算法(MCC-KF),针对传感器观测数据中存在的脉冲型异常噪声问题,通过非线性加权机制提升滤波器的抗干扰能力。代码通过对比传统KF与MCC-KF在含异常值场景下的表现,验证了后者在状态估计鲁棒性方面的显著优…...
django blank 与 null的区别
1.blank blank控制表单验证时是否允许字段为空 2.null null控制数据库层面是否为空 但是,要注意以下几点: Django的表单验证与null无关:null参数控制的是数据库层面字段是否可以为NULL,而blank参数控制的是Django表单验证时字…...

解析奥地利 XARION激光超声检测系统:无膜光学麦克风 + 无耦合剂的技术协同优势及多元应用
在工业制造领域,无损检测(NDT)的精度与效率直接影响产品质量与生产安全。奥地利 XARION开发的激光超声精密检测系统,以非接触式光学麦克风技术为核心,打破传统检测瓶颈,为半导体、航空航天、汽车制造等行业提供了高灵敏…...
提升移动端网页调试效率:WebDebugX 与常见工具组合实践
在日常移动端开发中,网页调试始终是一个高频但又极具挑战的环节。尤其在面对 iOS 与 Android 的混合技术栈、各种设备差异化行为时,开发者迫切需要一套高效、可靠且跨平台的调试方案。过去,我们或多或少使用过 Chrome DevTools、Remote Debug…...

Cilium动手实验室: 精通之旅---13.Cilium LoadBalancer IPAM and L2 Service Announcement
Cilium动手实验室: 精通之旅---13.Cilium LoadBalancer IPAM and L2 Service Announcement 1. LAB环境2. L2公告策略2.1 部署Death Star2.2 访问服务2.3 部署L2公告策略2.4 服务宣告 3. 可视化 ARP 流量3.1 部署新服务3.2 准备可视化3.3 再次请求 4. 自动IPAM4.1 IPAM Pool4.2 …...
华为OD最新机试真题-数组组成的最小数字-OD统一考试(B卷)
题目描述 给定一个整型数组,请从该数组中选择3个元素 组成最小数字并输出 (如果数组长度小于3,则选择数组中所有元素来组成最小数字)。 输入描述 行用半角逗号分割的字符串记录的整型数组,0<数组长度<= 100,0<整数的取值范围<= 10000。 输出描述 由3个元素组成…...
[USACO23FEB] Bakery S
题目描述 Bessie 开了一家面包店! 在她的面包店里,Bessie 有一个烤箱,可以在 t C t_C tC 的时间内生产一块饼干或在 t M t_M tM 单位时间内生产一块松糕。 ( 1 ≤ t C , t M ≤ 10 9 ) (1 \le t_C,t_M \le 10^9) (1≤tC,tM≤109)。由于空间…...