centos7 的系统服务

今天兴趣来了,打算安装ftp玩一玩,当用yum安装配置好之后,打算弄一个启动脚本加入系统服务,之后就可以service  vsftpd start 了;

但是突然有一个想法,如果不引入脚本,要怎么启动呢,以前的centos版本,当安装一个新的服务后,一般都会在/etxc/init.d下生成一个启动脚本,之后直接 chkconfig --add service 进去就好,但是现在服务不会在/etc/init.d/下生成;

我上网查了查也没查出来,就自己想于是我chkconfig  --list 了一下,发现了另一个现实系统服务的命令systemctl ,大家可以man一下好好看看他的用法;

于是我用systemctl list-unit-files 搜索出了,ftpd的服务名字

之后用了systemctl  start   vsftpd.service 将ftpd服务启动了起来。

有遇到和我一样的问题的朋友,可以参谋参谋,嘿嘿

时间: 2024-08-13 18:44:32

centos7 的系统服务的相关文章

CentOS7添加自定义系统服务

目录 一.编写Oracle数据库启动/重启/关闭的脚本 1.启动Oracle数据库的shell脚本 2.重启Oracle数据库的shell脚本 3.关闭Oracle数据库的shell脚本 二.编写自定义服务的配置文件 1.Unit部分 2.Service部分 3.Install部分 4.重启行为 三.使用自定义的服务 1.重新加载服务配置文件 2.启动/停止/启重oracle服务 3.把oracle服务设置为开机/关机自启动/停止 4.查看Oracle实例启动/停止的日志 四.版权声明 Cent

CentOS7管理系统服务命令systemd

首先系统启动流程: POST --> Boot Sequeue(BIOS) --> Bootloader(MBR) --> Kernel(ramdisk) --> rootfs --> /sbin/init init: CentOS 5: SysV init CentOS 6:Upstart CentOS 7:Systemd Systemd的新特性: 系统引导时实现服务并行启动: 按需激活进程: 系统状态快照: 基于依赖关系定义服务控制逻辑 核心概念:unit unit由其相

Linux开机启动程序rc.local

目录 1./etc/rc.local是/etc/rc.d/rc.local的软链接 2.rc.local文件的原始内容 3.rc.local文件的配置 4.应用经验 5.版权声明 在CentOS7中,实现开机启动程序主要有两种方法: 1)把要启动的程序配置成自定义的系统服务,该方法我已经介绍过,请阅读:CentOS7添加自定义系统服务. 2)在/etc/rc.local脚本文件中编写启动程序的脚本,本文将详细介绍这种方法. 1./etc/rc.local是/etc/rc.d/rc.local的软

关于CentOS7将服务添加为系统服务

先介绍一下CentOS7下系统的服务启动关闭的变化 service  服务名  start/stop/status  ==  systemctl    start/stop/status    服务名 chkconfig  --list  == systemctl   list-units-type chkconfig    服务名 on/off       ==   systemctl  enable/disable   服务名(具体的级别看配置文件) 2.  要将某个服务添加为系统服务(以n

centos7用shell创建守护进程,并设置为系统服务,开机自动启动

首先是创建shell守护进程:(shouhu.sh) #!/bin/bash test(){         while true         do                 ls ./  >> 123.txt                 sleep 5                              done } case $1 in start)         path="/root/shouhu.pid"         if [ -f $p

CentOS7中将Mysql添加为系统服务

如果是自己通过tar包安装的Mysql,不会自动添加到系统服务中,可通过如下方式,自己添加. 在/usr/lib/systemd/system目录下增加mysql.service,内容如下 [Unit] Description=Mysql After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/usr/local/mysql/data/XXX.pid

编写简单的CentOS7系统服务文件

编写一个无线循环的脚本, 并且将输出写入到/var/log/helloworld.log文件中. [[email protected] ~]# mkdir /home/zhengtong/20151109/ [[email protected] ~]# cd /home/zhengtong/20151109/ [[email protected] 20151109]# vim helloworld.sh #!/bin/bash # __author__ = 'zhengtong' while [

CentOS7添加Nginx为系统服务

1.编辑系统服务 vim /usr/lib/systemd/system/nginx.service  [unit] Description=Web Service After=network.target [Service] PIDFile=/var/run/nginx.pid ExecStart=/usr/local/nginx/sbin/nginx ExecStop=/usr/local/nginx/sbin/nginx -s stop ExecReload=/usr/local/ngin

CentOS7利用systemctl添加自定义系统服务

CentOS 7的服务systemctl脚本存放在:/usr/lib/systemd/,有系统(system)和用户(user)之分,需要开机不登陆就能运行的程序,存在系统服务里,即:/usr/lib/systemd/system目录下 每一个服务以.service结尾,一般会分为3部分:[Unit].[Service]和[Install],我写的这个服务用于开机运行tomcat项目: [plain] vim /usr/lib/systemd/system/tomcat.service [pla