Set Automatic startup (rc. local) In Debian)

Source: Internet
Author: User
In Debian, set the Automatic startup (rc. local) -- Linux Release Technology-Debian information. The following is a detailed description. Versions earlier than Debian 4.0 are not like Linux such as Redhat and do not have rc. local file. To enable the startup of a script, you need to build your own rc. local, and you have to set the startup level to be useful.

The Debian system defines 7 running levels from 0 to 6, corresponding to/etc/rc0.d... scripts in the seven directories of/etc/rc6.d. The default running level is 5, which means the following:

Runlevel 0: Shut down and shut down all programs. If the kernel supports APM, the host power can be automatically disabled.
Runlevel 1: in single-user mode, a root shell and read-only file system are provided for system recovery.
Runlevel 2, 3, 4, 5: multi-user mode, set by the user.
Runlevel 6: similar to level 0, it restarts the computer.

Instance, we want to set/usr/bin/vncserver as start-up, you can perform the following operations:
Debian: // touch/etc/init. d/rc. local // create the rc. local file under init. d In debian's initial directory

Write the following content in the rc. local file:
#! /Bin/sh
/Usr/bin/vncserver
Debian: // # chmod + x/etc/init. d/rc. local // give the file executable permission
Debian: // # update-rc.d rc. local start 99 2 3 4 5. stop 01 0 1 6. // set the startup level (required)

To delete the startup level of the script, perform the following operations:
Debian: # update-rc.d-f rc. local remove

In this way, vncserver boot is completed in debian 4.0 and earlier versions.

In Debian 4.0, we will find that the rc. local file already exists in the/etc/init. d directory, and the startup permission has been set. Open this file to understand that the content to be described in this file is to run/etc/rc. local script. We write/usr/bin/vncserver to/etc/rc. the startup item can be added before the EXIT 0 line in the local script.
Related Article

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.