Convert SystemV services to Upstart jobs in "main" (take 2)

Registered by James Hunt

= Problem Statement =

At present, there are 101 SystemV services in the Precise main archive that have not yet been converted to Upstart jobs(*). This needs to be recified.

= Important services that need conversion =

This is a selected list, but the following are important services that we could start with:

- rabbitmq
- open-iscsi
- bind9
- apache
- postfix
- puppet
- postgresql
- tomcat6
- memcached

= Rationale for Change =

- Upstart is our init system of choice (SystemV is considered legacy).
- Although Upstart does handle SystemV jobs, undesirable behaviour can and does result when there exist relationships between SystemV and Upstart jobs.
- Upstart jobs are easier to maintain than SystemV jobs.
- Upstart jobs are simpler than SystemV jobs.
- Upstart jobs place the burden of managing certain repeated tasks on Upstart, rather than requiring each SystemV service to re-invent the wheel (often badly).
- We wish to segregate SystemV jobs from Upstart jobs to optimize system shutdown.
- See http://upstart.ubuntu.com/cookbook/#critique-of-the-system-v-init-system
- To allow Upstart to be fully integrated into Debian, SysV services scripts *and* Upstart job files need to exist for a package.

= Proposal =

- Muster Community interest in an effort to port the remaining SystemV jobs to Upstart: It's a great way to learn Upstart!
- Consider having an online sprint to concentrate on this activity for a few days(?)
- Identify individuals who can help out when questions arise (jamesodhunt, spamaps, vorlon, etc?)
- Leverage the work done in Fedora to migrate away from SystemV.
- Concentrate on the most popular services first.
- Review all Upstart jobs.
- Thorough testing required.

= Questions =

- Aside from time, what is slowing down the conversion activity?:
  - lack of examples? (We can blog and provide wiki examples)
  - lack of familiarity with upstart job syntax? (We can hold education sessions)
  - lack of ability to test the Upstart job versus the SysV service? (QA may be able to help here?)
  - concerns over migration to "alternative init systems"? (there are no plans to switch)
  - other?

= See Also =

https://blueprints.launchpad.net/ubuntu/+spec/foundations-o-upstart-convert-main-initd-to-jobs

(*) - this number has fallen from the 122 SysV services in natty, so the number is falling slowly :)

Blueprint information

Status:
Not started
Approver:
Steve Langasek
Priority:
Medium
Drafter:
James Hunt
Direction:
Approved
Assignee:
James Hunt
Definition:
Approved
Series goal:
Accepted for precise
Implementation:
Unknown
Milestone target:
milestone icon ubuntu-12.04-beta-1

Related branches

Sprints

Whiteboard

(Paste of http://summit.ubuntu.com/uds-p/meeting/19553/foundations-p-upstart-convert-main-initd-to-jobs/)

 * Confusion over sysv vs. upstart
 * Convert vs. enhancing rc to emit jobs
   * emitting will add complexity / confusion
   * conversion will allow pushing upstart jobs back to debian as upstart becomes acceptible in Debian -- slangasek is working on this currently and expects compatibility soon
* startpar updated in Debian to resolve LSB dependencies if upstart job is present
* apparmor-policies loads as sysvinit script and misses smbd/nmbd startup
  * not converted to upstart for various reasons
    * boot speed?
    * mechanical difficulties
* apparmor profiles outside package could be loaded by service specific "start on starting x" jobs
* init scripts with custom actions
  * defer to later
* High Priority
  * apparmor sysv converted (apparmor-profiles also ships job file)
  * vlan
  *
* General Focus
  * Known racey startup services
  * locally accessed services (BIND, NIS, etc)
LSB-init "$named" maps to name service job
Users need help writing upstart jobs -- assert tests in pre-start

________________________________________________________________________

Observations:

Cookbook should help identify examples (good *and* bad are important). Give actual example of good job (by linking to bzr branch version for a pkg maybe?)

Work items for precise-alpha-2:
[jamesodhunt] Update cookbook on how to write an Upstart job (using upstart-events(8), etc): DONE
[jamesodhunt] Add "initctl emit starting TYPE=SYSV" and equivalent stopping event to /etc/init.d/rc.
[jamesodhunt] post to ubuntu-devel with links to docs on conversion process.
obtain a list of SysV services with additional commands (aside from "start", "stop", "restart", "status"). These *could* be problematic to convert to Upstart jobs (Oh to have an OpenGrok server)

Work items for ubuntu-12.04-beta-1:
[jamesodhunt] new initctl command to kill a "stuck job" (bug #406397)
[jamesodhunt] Investigate upstart bug highlighted by cups job (bug #855010)
[clint-fewbar] burndown graph of progress
[jdstrand] Document why apparmor cannot be converted to Upstart: DONE
[clint-fewbar] abstract job to represent named

Work items:
[stgraber] vlan package needs to be "eventified" (stgraber has complex networks for testing): DONE
make /etc/init.d/network do "ifdown -a && ifup -a"

(?)

Work Items