Ubuntu upstart startup

Source: Internet
Author: User

After the system is upgraded from Ubuntu 9.04 to 9.10, the console of the system cannot be used, and the vbox must execute 'sudo/etc/init after each system restart. d/vboxdrv setup re-compile the kernel. As there is no inconvenience in other aspects, we can endure these two small problems.

Recently, if you want to install the official NV driver and disable X for installation, you have to deal with this problem.

The first thing that comes to mind is the problem that occurs during the startup process. Ubuntu uses upstart to guide the system. For details about the upstart process, refer to upstart: Ubuntu event-based startup process. Enter the command "runlevel" in the system terminal to return the result unknown. If yes, "N 2" should be returned. The default runlevel of Ubuntu is 2. In/etc/event. d/file and/etc/rc2.d and/etc/rc. after checking the files in the d directory, runlevel is found at/etc/event. d/RC-default is set in the file, that is, telint 2.

Enter the command 'telint2' in the system terminal and you will find that the "login:" prompt appears in Terminal 1. From/etc/event. d/RC2: Enter the command 'sudo/etc/init. after D/RC 2 ', a bunch of initialization information is displayed, including vbox information. By the way, the cups service must be manually started every time you use a printer. We suspect that upstart does not execute these scripts normally. The log output is added to the preceding two scripts and is not executed at all.

As a result, I began to suspect that there was a problem with upstart, So I upgraded upstart from the default upstart_0.6.3-11 of 9.10 to the upstart_0.6.5-3 (which can be downloaded from the http://archive.ubuntu.com/ubuntu/pool/main/u/upstart/, and may need to download a domestic file SC itself online ), after installation, the problem persists. So I came back and suspected it was a problem with the configuration file. Download from a foreign Forum

Upstart_0.3.9-8_i386.deb, upstart-compat-sysv_0.3.9-8_i386.deb, upstart-logd_0.3.9-8_i386.deb, system-services_0.3.9-8_i386.deb four files, and then use the command 'dpkg-x xx. deb dir' decompress these files to a directory, and then the subdirectory ETC/event under the directory. all the configuration files in D/are copied to the system '/etc/event. d/'directory, the problem persists after restart.

But from the http://archive.ubuntu.com/ubuntu/pool/main/u/upstart/ you can see upstart version 0. 6. * Only one file exists, and version 0.3 * has four files. Therefore, it is suspected that major modifications to Versions later than version 0.6 may not be used again. d/, I am cautious, and do not dare to delete/etc/event directly on the local machine. d/directory to test. So after lunch, a 9.10 ISO was installed on the vbox, and no/etc/event. d/directory was found in the newly installed 9.10, proving that the previous speculation was correct.

The/etc/directory is the directory where the startup configuration file exists, and the rest is the file under the/etc/init/directory, the MD5 comparison found that the host system and vbox in the 9.10/etc/init/rc-sysinit.conf is different, view the rc-sysinit.conf file found that the beginning of the "env default_runlevel = 2" configuration instructions, and finally have

The commond of "telinit" $ {default_runlevel} "is suspected to be a problem in this file. Change "env default_runlevel = 2" in vbox 9.10 to "env default_runlevel = 3" and then reboot. Run runlevel to get the returned value "N 3 ". It can be determined that the script is not correctly executed in the host, so the rc-sysinit.conf is copied from vbox 9.10 to the host, restart the host everything works.

Conclusion upstart 0.6 * and later versions only have one file. The/etc/event. d/function is removed and moved to/etc/init.

 

Two rc-sysinit.conf comparison

Incorrect rc-sysinit.conf on host

# RC-sysinit-System V initialisation compatibility <br/> # This task runs the old system V-style system initialisation scripts, <br/> # and enters the default runlevel when finished. <br/> description "System V initialisation compatibility" <br/> author "Scott James remnant <scott@netsplit.com>" <br/> Start on filesystem <br/> stop on runlevel <br /> # default runlevel, this may be overriden on the kernel command-line <br/> # or by faking an old/etc/inittab entry <br/> env default_runlevel = 2 <br/> # There can be no previous runlevel here, but there might be old <br/> # Information in/var/run/utmp that we pick up, and we don't want <br/> # That. <br/> # These override that <br/> env runlevel = <br/> env prevlevel = <br/> task <br/> script <br/> # Check for default runlevel in/etc/inittab <br/> If [-r/etc/inittab] <br/> then <br/> eval "$ (sed-NRE 's/^ [^ #] [^:] * :( [0-6ss]): initdefault :. */default_runlevel = "/1";/P'/etc/inittab | true) "<br/> fi <br/> # Check kernel command-line for typical arguments <br/> for ARG in $ (CAT/proc/cmdline) <br/> DO <br/> case "$ {Arg}" in <br/>-B | emergency) <br/> # Emergency shell <br/> [-n "$ {from_single_user_mode}"] | sulogin <br/>; <br/> [0123456ss]) <br/> # override runlevel <br/> default_runlevel = "$ {Arg}" <br/>; <br/>-S | Single) <br/> # single user mode <br/> [-n "$ {from_single_user_mode}"] | default_runlevel = S <br/> ;; <br/> esac <br/> done <br/> # Run the system initialisation scripts <br/> [-n "$ {from_single_user_mode}"] |/etc/init. d/RCS <br/> # Switch into the default runlevel <br/> telinit "$ {default_runlevel}" <br/> End Script 

 

Correct rc-sysinit.conf

# RC-sysinit-System V initialisation compatibility <br/> # This task runs the old system V-style system initialisation scripts, <br/> # and enters the default runlevel when finished. <br/> description "System V initialisation compatibility" <br/> author "Scott James remnant <scott@netsplit.com>" <br/> Start on filesystem <br/> stop on runlevel <br /> # default runlevel, this may be overriden on the kernel command-line <br/> # or by faking an old/etc/inittab entry <br/> env default_runlevel = 2 <br/> # There can be no previous runlevel here, but there might be old <br/> # Information in/var/run/utmp that we pick up, and we don't want <br/> # That. <br/> # These override that <br/> env runlevel = <br/> env prevlevel = <br/> task <br/> script <br/> # Check for default runlevel in/etc/inittab <br/> If [-r/etc/inittab] <br/> then <br/> eval "$ (sed-NRE 's/^ [^ #] [^:] * :( [0-6ss]): initdefault :. */default_runlevel = "/1";/P'/etc/inittab | true) "<br/> fi <br/> # Check kernel command-line for typical arguments <br/> for ARG in $ (CAT/proc/cmdline) <br/> DO <br/> case "$ {Arg}" in <br/>-B | emergency) <br/> # Emergency shell <br/> [-n "$ {from_single_user_mode}"] | sulogin <br/>; <br/> [0123456ss]) <br/> # override runlevel <br/> default_runlevel = "$ {Arg}" <br/>; <br/>-S | Single) <br/> # single user mode <br/> [-n "$ {from_single_user_mode}"] | default_runlevel = S <br/> ;; <br/> esac <br/> done <br/> # Run the system initialisation scripts <br/> [-n "$ {from_single_user_mode}"] |/etc/init. d/RCS <br/> # Switch into the default runlevel <br/> telinit "$ {default_runlevel}" <br/> End Script 

The only difference between the two files is 9th rows. The normal file contains start on filesystem, And the problematic file contains start on filesystem and net-device-up iface = lo. Therefore, we suspect that upstart is not started at all.

I searched the internet for a bug, but I went through the wall. It was speechless.

 

 

 

 

 

 

 

 

 

 

 

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.