[Bug 1575572] Re: apache2 fails to start if installed via cloud config (on Xenial)
Martin Pitt
martin.pitt at ubuntu.com
Fri Apr 29 09:13:19 UTC 2016
I had a closer look how systemd emulates the old runlevels. systemd-
update-utmp-runlevel.service runs after graphical.target, multi-
user.target etc. started (After=runlevel1.target runlevel2.target
runlevel3.target runlevel4.target runlevel5.target, those are activated
in multi-user.target etc.). src/update-utmp/update-utmp.c determines
which runlevel to report in get_current_runlevel() using this table:
static const struct {
const int runlevel;
const char *special;
} table[] = {
/* The first target of this list that is active or has
* a job scheduled wins. We prefer runlevels 5 and 3
* here over the others, since these are the main
* runlevels used on Fedora. It might make sense to
* change the order on some distributions. */
{ '5', SPECIAL_GRAPHICAL_TARGET },
{ '3', SPECIAL_MULTI_USER_TARGET },
{ '1', SPECIAL_RESCUE_TARGET },
But targets only have states "dead" and "active", unlike units there is
no "activating". So we cannot use this approach to see if multi-
user.target *will* be active (or not) at some point in the future if we
just made it past basic.target. So fixing this in systemd itself will
require larger architectural changes which we presumably don't want in
an SRU (and maybe also don't want at all, as sysvinit and its runlevel
concept haven't mapped well to parallel/dynamic init systems such as
upstart or systemd).
Therefore I'd rather fix this in invoke-rc.d -- use runlevel only for
SysVinit, and drop the whole runlevel and /etc/rc?.d/ parsing stuff
under systemctl and just use "systemctl is-enabled" to determine whether
to start a service or not. That avoids the guesswork on both sides, is
structurally much simpler, and more robust.
** Changed in: systemd (Ubuntu)
Status: Triaged => Won't Fix
** Changed in: systemd (Ubuntu)
Assignee: Martin Pitt (pitti) => (unassigned)
** Changed in: init-system-helpers (Ubuntu)
Importance: Low => High
** Changed in: init-system-helpers (Ubuntu)
Status: Confirmed => In Progress
** Changed in: init-system-helpers (Ubuntu)
Assignee: (unassigned) => Martin Pitt (pitti)
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1575572
Title:
apache2 fails to start if installed via cloud config (on Xenial)
Status in cloud-init package in Ubuntu:
Confirmed
Status in init-system-helpers package in Ubuntu:
In Progress
Status in systemd package in Ubuntu:
Won't Fix
Bug description:
Using the following cloud config, apache2 will fail to start on
installation on Xenial:
#cloud-config
packages:
- apache2
See for example:
$ gcloud compute instances create xenial-$(date +%y%m%d-%H%M) --image ubuntu-1604-xenial-v20160420c --image-project ubuntu-os-cloud --metadata-from-file user-data=cloud-config
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
xenial-160427-1050 europe-west1-d n1-standard-1 10.240.0.7 104.155.86.94 RUNNING
$ ssh ubuntu at 104.155.86.94 systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: inactive (dead)
Docs: man:systemd-sysv-generator(8)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1575572/+subscriptions
More information about the foundations-bugs
mailing list