First, all the services started randomly in linux are in/etc/init. d. All the files in this folder are script files (in simple words, the script program writes the program to be run to a file so that the system can execute it in order, similar to windows autorun. in addition, there are folders such as rc1.d, rc2.d to rc6.d In the/etc folder. These are different runlevels in linux. Generally, Xwindows users first, all the services started randomly in linux are in/etc/init. d. All the files in this folder are script files (in simple words, the script program writes the program to be run to a file so that the system can execute it in order, similar to windows autorun. in addition, there are folders such as rc1.d, rc2.d to rc6.d In the/etc folder, which are different runlevels in linux, generally, the running level of multiple users in X windows is 5th. , That is, rc5.d. The script file in this folder is the service program to be randomly started when the script file is run at level 5th. Note that in each rc (1-6 ). the files in the d folder are all/etc/init. A soft connection to the files in the d folder (similar to the shortcut in windows), that is, in/etc/init. the d folder contains all the service programs, and each rc (1-6 ). d. Only link it to start the desired service program!
To start scim (a program), we first need to know where the scim program is. We can use the locate command to find it. scim is in/usr/bin/scim, the usr table indicates that the user belongs to the user, and bin indicates that the program can be executed in linux. In this way, I can write a script program, put it in/etc/init. d, and then make a corresponding soft link in rc5.d.
This script is actually very simple, just two lines:
#! /Bin/bash
/Usr/bin/scim
The first line is to declare the terminal used to run the script, and the second line is the command to run.
Note that in rc5.d, the name of each link starts with S or K, K starts with a random start. In this case, you can know which service I want to start at random, and change the first letter K to S. Of course, after changing S to K, this service cannot be started randomly. Therefore, we need to name this link SXXX so that the system can start it at random.
In RH, rc. local is the last script file started by default. Therefore, if you want to start it at random, another method is in rc. add/usr/bin/scim to the end of the local file.
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