ubuntu重新启动网卡_Ubuntu –启动,停止,重新启动服务

本教程介绍了在Ubuntu上管理服务的不同方法,包括使用systemctl命令和service命令来启动、停止和重启服务,如MySQL和Apache HTTP服务器。重点讲述了systemctl的使用,如检查服务状态、启动、停止和重启服务,以及处理启动/停止服务时的权限问题。
摘要由CSDN通过智能技术生成

ubuntu重新启动网卡

When an application runs in the background, it’s called a service. These are essential to run the system or our software applications. Some of the common services you will find on most of the servers are Apache, MySQL, NGINX, etc. When the system boots up, these services are configured to automatically startup.

当应用程序在后台运行时,称为服务。 这些对于运行系统或我们的软件应用程序至关重要。 在大多数服务器上可以找到的一些常见服务是Apache,MySQL,NGINX等。当系统启动时,这些服务被配置为自动启动。

I am using Ubuntu to host my websites. I also use MySQL to store all my websites data. Sometimes, I perform regular updates and it’s essential to restart these services. In this tutorial, we will learn various ways to start, stop, and restart services in Ubuntu.

我正在使用Ubuntu托管我的网站。 我还使用MySQL存储所有网站数据。 有时,我会执行定期更新,因此必须重新启动这些服务。 在本教程中,我们将学习在Ubuntu中启动,停止和重新启动服务的各种方法。

在Ubuntu上启动,停止,重新启动服务的不同方法 (Different Ways to Start, Stop, Restart Services on Ubuntu)

  1. systemctl command

    systemctl命令
  2. service command

    服务命令
  3. init scripts

    初始化脚本

使用systemctl启动,停止和重新启动Ubuntu服务 (Using systemctl to start, stop, and restart Ubuntu services)

This is the preferred way to manage Ubuntu services. If you are not sure of the service name, you can run systemctl --all command to list all the services. But, there might be hundreds of services running, so it’s better to filter the list using the grep command.

这是管理Ubuntu服务的首选方法。 如果不确定服务名称,可以运行systemctl --all命令列出所有服务。 但是,可能有数百个服务正在运行,因此最好使用grep命令过滤列表。

Let’s try to find out the service names of MySQL and Apache HTTP server.

让我们尝试找出MySQL和Apache HTTP服务器的服务名称。


# systemctl --all | grep -i mysql
  mysql.service                                                                          loaded    active   running   MySQL Community Server                                                       
# systemctl --all | grep -i apache
  apache2.service                                                                        loaded    active   running   The Apache HTTP Server                                                       
# 

So, the MySQL service name is “

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值