主页 > imtoken钱包怎么激活 > 如何防止服务在 Linux 中启动

如何防止服务在 Linux 中启动

imtoken钱包怎么激活 2023-10-30 05:07:15

linux设置开机服务自动启动/关闭自动启动命令 [root@localhost ~]# chkconfig --list 显示开机后可以自动启动的服务 [root@localhost ~]# chkconfig --add *** 添加开机自动启动* ** service [root@localhost ~]# chkconfig --del *** 删除自启动 *** service [root@localhost ~]# setup 可以在shell图形终端配置的命令,去service和select [root@localhost ~ ]# ntsysv 在shell终端图形中配置启动服务命令etc怎么开机启动,选项没有上面那么多。 setup、rc.local和chkconfig可以通过三种方式设置。 第一)输入#setup命令进入系统服务菜单,选择你要启动的服务比如httpd,然后重启机器或者/etc/rc.d./init.d/httpdstart 第二)把/etc/rc.d/rc.local文件中的startup命令,这样每次启动服务时都会自动启动。 比如apache,编译apache后,会在安装目录的bin下生成apachectl文件。 这是一个启动脚本。 我们只需要将这条命令添加到 rc.local 即可(suse 没有 rc.local 。

SUSE 可以通过这种方式定义自己的脚本。 如果想在切换运行级别前后运行自己的脚本,可以单独创建:/etc/init.d/before.local/etc/init.d/after.local) echo /usr/local/apache /bin/apachectl>> /etc/rc.d/rc.local,设置服务自动启动的方法是在rc.local中添加一些类似如下的脚本:#sshd/usr/local/sbin/sshd #proftpd/usr/local/sbin/proftpd#apache/home/apache/bin/apachectl start#mysql/home/mysql/bin/safe_mysqld --port=3306 &#start oracle8i listener firstssu - oracle - c 'lsnrctl start' #start oracle8isu - oracle -c 'dbstart' 第三)通过chkconfig 命令。 使用 chkconfig 命令将某项服务添加到系统的各个运行级别。 步骤如下: 1. 创建启动脚本。 对于apache、mysql、ssh等软件都是自己带的。 我们只需要稍微修改一下,让它支持chkconfig。 92## 描述:自动化一个带ipchains的包过滤防火墙。#chkconfig:后面定义的启动服务的操作级别(例子中启动2345是为了改变服务),以及关闭和启动服务的顺序,(上例中关闭服务的顺序使用8,启动顺序为92) descriptions:服务的描述(上例中是ipchains包过滤),可以改成你想要的,执行cp your修改后的脚本/etc/rc.d/init .d/脚本名 chmod 700 /etc/rc.d/init.d/脚本名 chkconfig --add 脚本名 例如:添加到linux启动进程中etc怎么开机启动,只运行在 level 3, level 5 [root@Tester init .d]/sbin/chkconfig --add apache-httpd[root@Tester i nit.d]/sbin/chkconfig --level 35 apache-httpdon 就可以了,我们的服务会在每次服务器重启时自动启动和关闭