'systemctl enable apache2' wrongly reports a failure because of update-rc.d backwards compat actions

Bug #1479826 reported by Elias Probst
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
New
Undecided
Unassigned

Bug Description

# lsb_release -rd
Description: Ubuntu 15.04
Release: 15.04

# apt-cache policy apache2
    Installed: 2.4.10-9ubuntu1
    Candidate: 2.4.10-9ubuntu1
    Version table:
  *** 2.4.10-9ubuntu1 0
             500 http://archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
             100 /var/lib/dpkg/status

# Problem description:
When using `systemctl enable apache2` to start apache2 by default on bootup, the command returns the returncode 1.
The systemd service for apache2 itself is generated by 'systemd-sysv-generator' based on /etc/init.d/apache2.

The output of `systemctl enable apache2` is:

```
Synchronizing state for apache2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d apache2 defaults
Executing /usr/sbin/update-rc.d apache2 enable
Failed to execute operation: No such file or directory
```

The content of the generated transient service unit is:

```INI
# /run/systemd/generator.late/apache2.service
# Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/apache2
Description=LSB: Apache2 web server
Before=runlevel2.target runlevel3.target runlevel4.target runlevel5.target shutdown.target
After=local-fs.target remote-fs.target network-online.target systemd-journald-dev-log.socket nss-lookup.target
Wants=network-online.target
Conflicts=shutdown.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/init.d/apache2 start
ExecStop=/etc/init.d/apache2 stop
ExecReload=/etc/init.d/apache2 reload
```

Revision history for this message
Elias Probst (eliasp) wrote :

Looks to me like this is more likely a problem in systemd-sysv-generator than apache2 itself.

affects: apache2 (Ubuntu) → systemd (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.