Two Methods for adding boot items in Linux

Source: Internet
Author: User

Two Methods for adding boot items in Linux
1. Edit the/etc/rc. local file.
Vim/etc/rc. local


#! /Bin/sh
#
# This script will be executed * after * all the other init scripts.
# You can put your own initialization stuff in here if you don't
# Want to do the full Sys V style init stuff.

Touch/var/lock/subsys/local
# Add the program you want to start or execute the command at the end of the file (before exit 0) (the executed program requires an absolute path, except for the system environment variables ),
For example/Usr/local/thttpd/sbin/thttpd-C/usr/local/thttpd/etc/thttpd. conf2. Write a shell script by yourself.

Put the written script (. sh file) to the directory./Etc/profile. d/,

After the system starts, all shell scripts in the directory will be automatically executed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.