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…...
多场景 OkHttpClient 管理器 - Android 网络通信解决方案
下面是一个完整的 Android 实现,展示如何创建和管理多个 OkHttpClient 实例,分别用于长连接、普通 HTTP 请求和文件下载场景。 <?xml version"1.0" encoding"utf-8"?> <LinearLayout xmlns:android"http://schemas…...
《用户共鸣指数(E)驱动品牌大模型种草:如何抢占大模型搜索结果情感高地》
在注意力分散、内容高度同质化的时代,情感连接已成为品牌破圈的关键通道。我们在服务大量品牌客户的过程中发现,消费者对内容的“有感”程度,正日益成为影响品牌传播效率与转化率的核心变量。在生成式AI驱动的内容生成与推荐环境中࿰…...
【Go】3、Go语言进阶与依赖管理
前言 本系列文章参考自稀土掘金上的 【字节内部课】公开课,做自我学习总结整理。 Go语言并发编程 Go语言原生支持并发编程,它的核心机制是 Goroutine 协程、Channel 通道,并基于CSP(Communicating Sequential Processes࿰…...
CocosCreator 之 JavaScript/TypeScript和Java的相互交互
引擎版本: 3.8.1 语言: JavaScript/TypeScript、C、Java 环境:Window 参考:Java原生反射机制 您好,我是鹤九日! 回顾 在上篇文章中:CocosCreator Android项目接入UnityAds 广告SDK。 我们简单讲…...
HBuilderX安装(uni-app和小程序开发)
下载HBuilderX 访问官方网站:https://www.dcloud.io/hbuilderx.html 根据您的操作系统选择合适版本: Windows版(推荐下载标准版) Windows系统安装步骤 运行安装程序: 双击下载的.exe安装文件 如果出现安全提示&…...
以光量子为例,详解量子获取方式
光量子技术获取量子比特可在室温下进行。该方式有望通过与名为硅光子学(silicon photonics)的光波导(optical waveguide)芯片制造技术和光纤等光通信技术相结合来实现量子计算机。量子力学中,光既是波又是粒子。光子本…...
Kafka入门-生产者
生产者 生产者发送流程: 延迟时间为0ms时,也就意味着每当有数据就会直接发送 异步发送API 异步发送和同步发送的不同在于:异步发送不需要等待结果,同步发送必须等待结果才能进行下一步发送。 普通异步发送 首先导入所需的k…...
Selenium常用函数介绍
目录 一,元素定位 1.1 cssSeector 1.2 xpath 二,操作测试对象 三,窗口 3.1 案例 3.2 窗口切换 3.3 窗口大小 3.4 屏幕截图 3.5 关闭窗口 四,弹窗 五,等待 六,导航 七,文件上传 …...
MySQL 部分重点知识篇
一、数据库对象 1. 主键 定义 :主键是用于唯一标识表中每一行记录的字段或字段组合。它具有唯一性和非空性特点。 作用 :确保数据的完整性,便于数据的查询和管理。 示例 :在学生信息表中,学号可以作为主键ÿ…...
Rust 开发环境搭建
环境搭建 1、开发工具RustRover 或者vs code 2、Cygwin64 安装 https://cygwin.com/install.html 在工具终端执行: rustup toolchain install stable-x86_64-pc-windows-gnu rustup default stable-x86_64-pc-windows-gnu 2、Hello World fn main() { println…...
