This note is a long time after the completion of the project, sorting out the data when the accidental discovery, the operation of the Linux for the winning Kylin, the project needs to start the boot, the llinux is not familiar with, find the Linux service self-starting settings. Several times only to find the solution. Record for reference
The operating system comes with services such as SSH, FTP and so on are self-starting, we can also in this way to let their own development program boot.
1 Enter the Linux interface to open the terminal
Input vi/etc/rc.d/rc.local
Press the keyboard insert key to manipulate the file
Write the following code in the file
Touch/var/lock/subsys/local
Path to the folder where the CD executable file resides
Exprot display=:120
./starup.sh executable File
Press the ESC key to enter: Wq command to exit Edit settings OK to restart
2 If there is no rc.local file in the system, it can be set up in the following way.
First, enter chkconfig in the command box to see which services are self-booting in the system.
Then create a script under/ETC/INIT.D
Write a name in the script, like Local.
#! /bin/bash
#chkcofig: 345 61 61 345 is the start level, 85 and 15 are the start priority, the priority is off, and the following is the description.
#description: Apache
Touch/var/lock/subsys/local
Path to the folder where the CD executable file resides
Exprot display=:120
./starup.sh executable File
Save and exit
In command terminal write Chkconfig--add local first, add as system service, note that add front has two bars
Then enter Chkconfig--list if a local instruction script has been added to the boot start operation
Set the startup level for the newly added local script
Chkconfig--level + Local on (description,3 level represents start in command line mode,5 level represents start in graphical interface, on = open)
To this setting OK to restart
Linux Registration Service Tutorials