Setting the boot-up from Ubuntu

Source: Internet
Author: User
Tags locale set time

This shows that Ubunturh Chkconfig Command!

Some gadgets are available to manage the startup options for Ubuntu :
gadgets rcconf :
# sudo apt-get rcconf
#sudo apt-get install rcconf
Root run: #sudo rcconf
more full-featured tools : sysv-rc-conf
#sudo apt-get Update
#sudo apt-get install sysv-rc-conf
Run: #sudo sysv-rc-conf
You can also join the startup program directly, such as adding/etc/init.d/red5 to the system autostart list:
#sudo sysv-rc-conf Red5 on
Other ways to use see: google::ubuntu::sysv-rc-conf command usage

You can also directly modify
directly to the/ETC/RC0.D ~/etc/rc6.d and/ETC/RCS.D, the beginning of the start, the beginning of the expressionK does not start,
For example: To turn off the Red5 boot automatically, just #sudo mv/etc/rc2.d/s20red5/etc/rc2.d/k20red5.

Ubuntu Auto Start Program

First of all, the Linux random Startup service program is in/ETC/INIT.D this folder, the files are all script files (the script is simply to run the program to write to a file, so that the system can be executed sequentially, Similar to Windows Autorun.dat file), in addition to/etc This folder also has such as the name RC1.D, rc2.d to Rc6.d folder, these are different Linux runlevel, we generally enter the X Windows multi-user RunLevel is level 5th, which is rc5.d, the script file under this folder is the service program that starts randomly when you run level 5th. It is important to note that the files under each RC (1-6). D folder are actually a soft connection to the files in the/etc/init.d folder (similar to the shortcuts in Windows), that is, under the/etc/init.d folder is the full service program, and each RC ( 1-6). d only link it to its own boot needs the appropriate service program!

To start SCIM (a program), we first want to know where the SCIM program, with locate command can be found, SCIM in/usr/bin/scim here, where USR is the user's, bin in Linux represents the program can be executed. In this way, I can write a script, put it into the/etc/init.d, and then make a corresponding soft link in the RC5.D.

This script is actually very simple, just two lines:

#!/bin/bash

/usr/bin/scim

The first line is to declare what terminal runs the script, and the second line is the command to run.

It is also important to note that in RC5.D, each link name is the beginning of S or K, the start of the system is to start randomly, K start is not randomly started. In this way, you can know, if I want to start a random service, the first letter of its name K to the S can be, of course, the conversion of S to K, the service can not be started randomly. Therefore, I have to name this link sxxx, so that the system can let it start randomly.

Under RH, Rc.local is the last script file that is started by default, so
If you want to start randomly, there is another way to add/USR/BIN/SCIM to the tail of the rc.local, and that's it.

Linux Auto-Start Program

1. Automatically run the program when booting up

After Linux is loaded, it initializes hardware and device drivers and then runs the first process init. Init continues the boot process based on the configuration file, starting other processes. Typically, modifications are placed in/ETC/RC or/etc/rc.d or/ETC/RC?. The script file in the D directory allows Init to start other programs automatically. For example: Edit the/etc/rc.d/rc.local file (usually the last script launched by the system), add a line "Xinit" or "startx" at the end of the file, and you can enter X-window directly after booting.

2. Run programs automatically when you log on

When a user logs on, bash first automatically executes a global logon script created by the system administrator:/ect/profile. Bash then looks for one of three special files in the user start directory:/.bash_profile,/.bash_login,/.profile, but only one that was first found.
As a result, you can automatically run certain programs (similar to DOS Autoexec.bat) when a user logs on by simply adding a command to the above file according to the actual need.

3. Run program automatically when logging out

When you log out, Bash automatically executes a personal logout logon script,/.bash_logout. For example, by adding the command "Tar-cvzf c.source.tgz *.c" to/.bash_logout, the "tar" command is automatically backed up *.c files each time you log out.

4. Run programs automatically on a regular basis

Linux has a daemon called Crond, and the main function is to periodically check the contents of a set of command files in the/var/spool/cron directory and execute the commands in those files at a set time. Users can create, modify, and delete these command files through the crontab command.

For example, to establish a file Crondfile, the content is "XX 9 Jan * happybirthday", after running the "crontab cronfile" command, the system automatically executes the "HappyBirthday" program ("*") every 23rd 9:00 The day of the week.

5. Run the program automatically once

Timed execution command at is similar to Crond (but it executes only once): the command executes at a given time, but does not automatically repeat. The general format of the AT command is: at [-F file] time, all commands given in the file are executed at the specified times. You can also enter commands directly from the keyboard:

$ at 12:00
At>mailto Roger-s″have a lunch″< plan.txt
At>ctr-d
Job 1 at 2000-11-09 12:00
2000-11-09 12:00 automatically sends a message titled "Have a Lunch" to the content of the Plan.txt file to Roger. 9 12:00
2000-11-09 12:00 automatically sends a message titled "Have a Lunch", content for Plan.txt file content to Roger. Er Ger Er

Ubuntu boot automatically mounts windows partition

To mount NTFS-formatted partitions, you need to ntfs-3g this software. It is short and powerful.
NTFS-3G is an open source software that supports reading and writing NTFS-formatted partitions under Windows. It's very fast, and it's safe. It supports Windows 2000, XP, and 2003, and supports all POSIX-compliant disk operations.

The first thing to edit is Sources.list
#sudo gedit/etc/apt/sources.list

Ubuntu drapper add:
Deb Http://givre.cabspace.com/ubuntu/dapper main Main-all
Deb Http://ntfs-3g.sitesweetsite.info/ubuntu/dapper main Main-all
Deb http://flomertens.keo.in/ubuntu/ Dapper main Main-all

Ubuntu edgy add:
Deb http://givre.cabspace.com/ubuntu/edgy main
Deb Http://ntfs-3g.sitesweetsite.info/ubuntu/edgy main
Deb http://flomertens.keo.in/ubuntu/edgy main

The must also import Gpg-key, so you can:
#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 source now:
#sudo aptitude Update

Formal Installation

Run under "terminal":
#sudo Apt-get Install ntfs-3g

Configure NTFS-3G

First look at the partition type of some hard disk partitions
#sudo fdisk-l

You can now modify the/etc/fstab to automatically mount the NTFS partition when Ubuntu starts. But first, please back up this file:
#sudo Cp/etc/fstab/etc/fstab.bak

Set up a mount point, for example, mounted under/media/windows
#sudo mkdir/media/windows

You can now add the following in the/etc/fstab
/dev/hda1/media/ntfs-3g Defaults,locale=zh_cn.utf8 0 0
Make changes according to your own circumstances.

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 locales
#locale-A

If you do not want to restart, you can
#sudo umount-a
#sudo mount-a

Last command to mount a FAT partition
#sudo mount/dev/hda3/media/windows/-T Vfat-o iocharset=utf8,umask=000

Of course, you can add it in/etc/fstab.
/dev/hda3/media/windows vfat iocharset=utf8,umask=000 0 0

OpenFire with Ubuntu Auto-start

OpenFire By default, it is not started randomly. In order to solve the trouble of manually starting each time, I wrote a script, placed in the/ETC/INIT.D directory
#sudo Vim/etc/init.d/openfire
The contents are as follows:

#!/bin/sh

Openfire_start () {
/etc/openfire/bin/openfire start
}

Openfire_stop () {
/etc/openfire/bin/openfire stop
}

Case $ in
Start
Openfire_start
;;
Stop
Openfrie_stop
;;
*)
Echo ' Usage:openfire start|stop '
;;
Esac

Setting the boot-up from Ubuntu

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.