systemctl disable apache2 does nothing

Bug #1787225 reported by teo1978 on 2018-08-15
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Undecided
Unassigned
systemd (Ubuntu)
Undecided
Unassigned

Bug Description

I installed apache2 on Ubuntu 16.04, and out of the box it was enabled as a service, meaning it would automatically start at every boot. That is not what I want as this is my personal computer, not a server.

$ systemctl is-enabled apache2.service
enabled

So I ran:

$ sudo systemctl disable apache2

and this was the output:
   apache2.service is not a native service, redirecting to systemd-sysv-install
   Executing /lib/systemd/systemd-sysv-install disable apache2
   insserv: warning: current start runlevel(s) (empty) of script `apache2' overrides LSB defaults (2 3 4 5).
   insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `apache2' overrides LSB defaults (0 1 6).
   insserv: warning: current start runlevel(s) (empty) of script `apache2' overrides LSB defaults (2 3 4 5).
   insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `apache2' overrides LSB defaults (0 1 6).

Then I rebooted. I expected to find apache2 not running. Instead, it was running.
Surprisingly:

$ systemctl is-enabled apache2.service
apache2.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install is-enabled apache2
disabled

so, it shows up as disabled, yet it is started at startup.

I wonder if this is what those warnings were about. Those messages are unclear as fuck, I have no f***ing clue what they are supposed to mean. I read that the CURRENT runlevel overrides a DEFAULT. I guess that should be fine, unless what systemctl actually changes are the defaults, and those are overwritten by something else, which means that "sysctl disable" will have no effect. If that is the case, then the warning should be more explicit:
- be specific about the fact that "LSB defaults" are what the command is changing
- tell me that as a result, the services will not be disabled
- tell me WHAT is overriding the defaults that I'm attempting to change
- and/or tell me what I am supposed to do to fix the issue

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: systemd 229-4ubuntu21.4
ProcVersionSignature: Ubuntu 4.4.0-133.159-generic 4.4.134
Uname: Linux 4.4.0-133-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Aug 15 16:26:28 2018
InstallationDate: Installed on 2013-10-11 (1768 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
MachineType: Acer Aspire V3-571G
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-133-generic.efi.signed root=UUID=5830b30e-69e8-4bb4-8a2b-bc2b43c7414a ro quiet splash vt.handoff=7
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 10/15/2012
dmi.bios.vendor: Acer
dmi.bios.version: V2.07
dmi.board.asset.tag: Type2 - Board Asset Tag
dmi.board.name: VA50_HC_CR
dmi.board.vendor: Acer
dmi.board.version: Type2 - Board Version
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.version: V2.07
dmi.modalias: dmi:bvnAcer:bvrV2.07:bd10/15/2012:svnAcer:pnAspireV3-571G:pvrV2.07:rvnAcer:rnVA50_HC_CR:rvrType2-BoardVersion:cvnAcer:ct10:cvrV2.07:
dmi.product.name: Aspire V3-571G
dmi.product.version: V2.07
dmi.sys.vendor: Acer

teo1978 (teo8976) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd (Ubuntu):
status: New → Confirmed
Andreas Hasenack (ahasenack) wrote :

Thanks for filing this bug in Ubuntu.

I just repeated your steps on a xenial lxd, using apache2 2.4.18-2ubuntu3.10, and after rebooting the container, apache2 was not started. I got the same warnings that you did, however.

Furthermore, status also shows it's inactive after the reboot:
$ systemctl status apache2
● 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)

Could you please try the above status command after you reboot, see what it says? Maybe you have something else starting apache, or requiring it perhaps?

Changed in apache2 (Ubuntu):
status: New → Incomplete
Andreas Hasenack (ahasenack) wrote :

You can also check "sudo systemctl cat apache2.service", that will show if any overrides are in place.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers