Notes for Ubuntu to add startup items for X-based applications

Source: Internet
Author: User
After analyzing the Ubuntu startup process, we know that there are many ways to add startup items when the system is started, such as in/etc/rcX. d/Add a script S99mystart in the directory. sh: This is the most stupid and not very reasonable method. You can also go to/etc/init. add a script in the d/directory and then automatically update the link to/etc/rcX through the command. d/. No matter how you do it, you only need to meet your specific requirements. However, when adding a startup Item for X-based applications, note the following: ------------ analyzed the Ubuntu startup process. We know there are many ways to add startup items when the system is started.
For example, adding a script S99mystart. sh to the/etc/rcX. d/directory is the most stupid and unreasonable method.
You can also add a script in the/etc/init. d/directory and then automatically update the link to/etc/rcX. d/by running the command.
No matter how you do it, you just need to meet your specific requirements.
Note the following when adding a startup Item for X-based applications:
Incorrect practice:
--------------------------
#! /Bin/sh
/Usr/bin/gtktest & (with background running)
--------------------------
In this way, the program cannot run after the system is started.
Correct practice:
---------------------------
#! /Bin/sh
Export DISPLAY =: 0.0 (the DISPLAY settings are determined by the actual situation)
/Usr/bin/gtktest & (with background running)
---------------------------
OK. Now you know the reason. You do not know the DISPLAY variable in the environment when the script is started and executed by the system. Although X has been started at this time
Therefore, we must add them on our own initiative.

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.