Set boot auto-start items in ubuntu

Source: Internet
Author: User

Set the boot auto-start item in ubuntu. You can use some gadgets to manage the startup options of Ubuntu: tool rcconf: # sudo apt-get rcconf # sudo apt-get install rcconfroot. Run the following command: # sudo rcconf: sysv-rc-conf # sudo apt-get update # sudo apt-get install sysv-rc-conf: # sudo sysv-rc-conf can also be directly added to the Startup Program, for example,/etc/init. d/red5 is added to the Automatic startup list of the system: # sudo sysv-rc-conf red5 on. For other usage methods, see google: Ubuntu :: you can also directly change the sysv-rc-conf command to/etc/rc0.d ~ /Etc/rc6.d and/etc/rc. something under d, starting with S indicates start, and starting with K indicates not start. For example, if you want to disable auto start of Red5, you only need to # sudo mv/etc/rc2.d/S20red5/etc/rc2.d/K20red5. Ubuntu automatically starts first, and 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 started randomly when the script file is 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 :#! The first line of/bin/bash/usr/bin/scim is to declare the terminal on which the script is run, and the second line is the command to be 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. Linux auto-Start Program 1. After the program is automatically run at startup Linux is loaded, it initializes the hardware and device drivers, and then runs the first process init. Init starts other processes based on the configuration file. Normally, the modification is placed in/etc/rc or/etc/rc. d or/etc/rc ?. The script file in the d directory can enable init to automatically start other programs. For example, edit/etc/rc. d/rc. local file (this file is usually the last script started by the system). Add "xinit" or "startx" at the end of the file to directly enter the X-Window after the file is started. 2. When a user logs on to the system automatically, bash automatically runs the global logon script:/ect/profile created by the system administrator. Bash then searches for one of the three special files in sequence in the user's starting Directory:/. bash_profile,/. bash_login, And/. profile, but only executes the first one found. Therefore, you only need to add commands to the above files as needed to automatically run certain programs (similar to Autoexec. bat in DOS) during user logon ). 3. When a program is automatically run to log out, bash automatically runs the personal logout script/. bash_logout. For example /. in bash_logout, add the command tar-cvzf c. source. tgz *. c, the "tar" command is automatically executed every time you log out to back up *. c file. 4. the program runs automatically on a regular basis. In Linux, a daemon called crond is used to periodically check the contents of a group of command files in the/var/spool/cron directory, and execute the commands in these files at the specified time. You can use the crontab command to create, modify, and delete these command files. For example, create a crondFile with the content "00 9 23 Jan * HappyBirthday". After running the "crontab cronFile" command, every time the system automatically executes the "HappyBirthday" program at AM on March 23, lunar January ("*" indicates that no matter the day of the day is the day of the week ). 5. timed Automatic Running of the program a scheduled command at is similar to crond (but it only runs once): The command is executed at a given time, but not automatically repeated. The at command is generally in the format of at [-f file] time. All commands in the file are executed at the specified time. You can also enter the command $ at 12 directly from the keyboard: 00at> mailto Roger-s "Have a lunch" <plan.txt at> Ctr-DJob 1 at 2000-11-09-11-09 automatically sends an email titled "Have a lunch”, which contains the plan.txt File Content roger .? At a.m.-11-a.m., an email titled "Have a lunch.pdf, containing the plan.txt file is automatically sent to Roger. Er. Ger. Er. Ubuntu boot automatic mount windows partition to mount NTFS format partition, need NTFS-3g this software. It is short and powerful. NTFS-3g is an open source software that supports reading and writing NTFS format partitions under Windows. It is fast and secure. It supports Windows 2000, XP, and 2003, and supports all POSIX-compliant disk operations. Edit sources first. list # sudo gedit/etc/apt/sources. listUbuntu Drapper Add: deb http://givre.cabspace.com/ubuntu/ dapper main-alldeb http://ntfs-3g.sitesweetsite.info/ubuntu/ dapper main-alldeb http://flomertens.keo.in/ubuntu/ dapper main-all Ubuntu Edgy Add: deb http://givre.cabspace.com/ubuntu/ edgy maindeb http://ntfs-3g.sitesweetsite.info/ubuntu/ edgy maindeb http://flomertens.keo.in/ubuntu/ Edgy main must also import GPG-Key, which can be as follows: # wget http://flomertens.keo.in/ubuntu/givre_key.asc-O-| sudo apt-key add-# wget http://givre.cabspace.com/ubuntu/givre_key.asc-O-| sudo apt-key add-update the source now: # sudo aptitude update is officially installed and run under the "terminal: # sudo apt-get install ntfs-3g configuration NTFS-3g first look at some hard disk partition type # sudo fdisk-l now you can modify/etc/fstab, to automatically mount the NTFS partition when Ubuntu is started. But first back up this file: # sudo cp/etc/fstab. bak to create a mount point, such as mounted under/media/windows # sudo mkdir/media/windows can now add/dev/hda1/media/ntfs-3g ults behind/etc/fstab, locale = zh_CN.utf8 0 0 according to your own situation. Some examples Mount/dev/hda3 Add/dev/hda3/media/windows ntfs-3g ro, locale = zh_CN.utf8, uid = 1000 0 0 about your locale you can use the following command to view all locale # locale-a if you do not want to restart, you can # sudo umount-a # sudo mount-a command for mounting the last FAT partition # sudo mount/dev/hda3/media/windows/-t vfat-o iocharset = utf8, umask = 000 of course, you can add/dev/hda3/media/windows vfat iocharset = utf8 in/etc/fstab, umask = 000 0 0Openfire with Ubuntu automatically starting openfire by default, it is not started randomly. To solve the problem of Manual start every time, I wrote a script, which is placed in/etc/init. d directory # sudo vim/etc/init. d/openfire :#! /Bin/shopenfire_start () {/etc/openfire/bin/openfire start} openfire_stop () {/etc/openfire/bin/openfire stop} case $1 instart) openfire_start ;; stop) openfrie_stop; *) echo 'usage: openfire start | stop'; esac

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.