banner



How Do You Repair The Init Startup Services For Ubuntu 14.04

Tag/tag.png

Style Cleanup Required
This article does not follow the manner standards in the Wiki Guide. More info...

Tag/tag.png

Content Cleanup Required
This commodity should be cleaned-upwards to follow the content standards in the Wiki Guide. More info...

# This material should probably be merged with UpstartHowto

Contents

  1. Since Ubuntu 6.10 (Edgy Eft)
    1. Directories and Configs
    2. Using Services
    3. Other Upstart Commands
    4. Writing Services
    5. List of init scripts
    6. Links

Since Ubuntu 6.10 (Edgy Eft)

Since the introduction of Upstart some time in 2006, or more than relevantly 9.10 Karmic where about of the system services were converted, the kick procedure inverse somewhat. The post-obit data is tested on 11.04 Natty:

Directories and Configs

  • /etc/init is where the upstart init configs live. While they are not scripts themselves, they essentially execute whatever is required to supervene upon sysvinit scripts.

  • /etc/init.d is where all the traditional sysvinit scripts and the backward compatible scripts for upstart alive. The astern uniform scripts basically run service myservice starting time instead of doing anything themselves. Some just prove a notice to use the "service" command.

  • /etc/init/rc-sysinit.conf controls execution of traditional scripts added manually or with update-rc.d to traditional runlevels in /etc/rc*

  • /etc/default has configuration files allowing you to control the behaviour of both traditional sysvinit scripts and new upstart configs.

Using Services

Please annotation that by and large, you can utilize either traditional sysvinit scripts and the methods of working with them as well as the new upstart configs and the command: "service" interchangeably. It is however recommended yous apply the new upstart methods which are both forward and astern compatible.

Starting a Service

          # Traditional:          /etc/init.d/myservice start          # Upstart          service myservice start

Stopping a Service

          # Traditional:          /etc/init.d/myservice end          # Upstart          service myservice stop

Getting a list of Services

          # Traditional:          ls /etc/init.d          # Upstart:          service --status-all
  • Notation: Upstart method volition show both traditional and upstart services.

Adding a Service to Default runlevels

          # Traditional          update-rc.d apache2 defaults
  • Upstart: there is no concept of runlevels, everything is event driven with dependencies. You would add an upstart config to /etc/init and potentially source a config file in /etc/default to allow users to override default behaviour.

Removing a Service from Default runlevels

          # Traditional - Something forth the lines of          rm /etc/rc*/*myscript
  • Upstart: If no config is available in /etc/default, edit config in /etc/init

Other Upstart Commands

Controlling Services - interchangeable with the "service" command

  • initctl - can employ in place of "service" with the commands bellow. Run initctl help.

  • offset - start a service

  • stop - end a service

  • reload - sends a SIGHUP signal to running process

  • restart - restarts a service without reloading its chore config file

  • status - requests status of service

Rebooting and Powering off the system

  • halt - shutdown the system then power off

  • poweroff - shutdown the system so power off

  • reboot - reboot the organization

  • shutdown - bring the system downward

Misc Upstart Commands - you generally don't use these directly

  • init - Upstart process management daemon

  • runlevel - Backward compatibility with traditional runlevels

  • telinit - Backward compatibility with traditional runlevels

  • upstart-udev-bridge - Bridge betwixt upstart and udev

Writing Services

The near electric current reference for job/service definition is available in the man page for init, available by running human being 5 init. There are also some very useful pointers in The Upstart Cookbook.

Here is an instance of a simple upstart job config: /etc/init/myservice.conf

          # myservice - myservice job file                    description "my service description"          author "Me <myself@i.com>"                    # Stanzas          #          # Stanzas control when and how a procedure is started and stopped          # Run across a listing of stanzas hither: http://upstart.ubuntu.com/wiki/Stanzas#respawn                    # When to start the service          start on runlevel [2345]                    # When to stop the service          terminate on runlevel [016]                    # Automatically restart procedure if crashed          respawn                    # Essentially lets upstart know the procedure will detach itself to the background          wait fork                    # Run earlier process          pre-start script                    [ -d /var/run/myservice ] || mkdir -p /var/run/myservice                    echo "Put bash code here"          stop script                    # Outset the procedure          exec myprocess

Helpful Tips

  1. initctl list shows new services straight away, service command might non!

  2. Check /var/log/syslog, it will show clues as to what went wrong.

  3. All scripts default to running with errexit (set up -e), and then any non-zero exit status will cause errors. In pre-starting time, this means the service won't start.
  4. if you want to burn events from your legacy sysvinit scripts, for example postgres, you can add the following:
    • 'initctl emit starting-postgresql' in /etc/init.d/postgresql just before the service is started
    • 'initctl emit started-postgresql' but after
    • Equally well as 'initctl emit stopping-postgresql' and 'initctl emit stopped-postgresql
    • Then yous tin can employ 'commencement on started-postgresql' and 'finish on stopping-postgresql' in your job.

See Upstart Getting Started for more than details virtually upstart.

[For more details about Ubuntu transitioning abroad from the sysv init organization. Run into upstart.]

Listing of init scripts

see InitScriptList

  • http://www.wlug.org.nz/update-rc.d%288%29

  • http://tinyurl.com/5dock

  • http://world wide web.debian.org/doctor/debian-policy/ch-opersys.html#s-sysvinit

  • UpstartHowto

How Do You Repair The Init Startup Services For Ubuntu 14.04,

Source: https://help.ubuntu.com/community/UbuntuBootupHowto

Posted by: olaguebrid1984.blogspot.com

0 Response to "How Do You Repair The Init Startup Services For Ubuntu 14.04"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel