apparmor-profile-load returns 1 if apparmor not installed

Bug #1521931 reported by Pavel Volkovitskiy
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
init-system-helpers (Ubuntu)
Invalid
Low
Unassigned
Wily
Fix Released
Undecided
Unassigned
rsyslog (Ubuntu)
New
Low
Unassigned
Wily
New
Undecided
Unassigned
upstart (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

==============================================================================
[ SRU Justification ]
1. Impact: users with upstart and without apparmor have init jobs failing to start
2. Test case: apt-get purge apparmor; apt-get install upstart-sysv; apt-get install rsyslog
 rsyslog will fail to start
3. Regression potential: we only exit 0 at the end of the script - nothing will change
        in cases where apparmor is installed.
==============================================================================

Environment:

ubuntu 15.04 with upstart and without apparmor

I tried to upgrade my ubuntu image to 15.10 and upgrading breaks on rsyslog:

start: Job failed to start

i checked dmesg and found this:

[ 525.832963] init: rsyslog pre-start process (3078)
[ 525.833007] init: rsyslog state changed from pre-starting to pre-start
[ 525.834464] init: rsyslog pre-start process (3078) terminated with status 1
[ 525.834639] init: rsyslog goal changed from start to stop

so i looked in pre-start:
pre-start script
    /lib/init/apparmor-profile-load usr.sbin.rsyslogd
end script

and then in /lib/init/apparmor-profile-load:
#!/bin/sh

[ -x /lib/apparmor/profile-load ] && exec /lib/apparmor/profile-load "$@"

in my case where is no "/lib/apparmor/profile-load" file, so this scripts return 1, which breaks pre-start and breaks rsyslog starting

I guess that if /lib/init/apparmor-profile-load script checks if file exists, it should return 0 in case then file doesn't exist

Revision history for this message
Pavel Volkovitskiy (olfway) wrote :

This fixes issues for me:

/lib/init/apparmor-profile-load:
#!/bin/sh

[ -x /lib/apparmor/profile-load ] || exit 0

exec /lib/apparmor/profile-load "$@"

description: updated
Revision history for this message
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Importance -> Low since "ubuntu 15.04 with upstart and without apparmor" is an unusual and generally unsupported configuration, except on the phone (but on the phone AppArmor is enabled).

But thanks for the patch and we should fix it.

Changed in init-system-helpers (Ubuntu):
importance: Undecided → Low
Changed in rsyslog (Ubuntu):
importance: Undecided → Low
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Note that in xenial this script has actually been moved to upstart.

no longer affects: upstart (Ubuntu Wily)
Changed in init-system-helpers (Ubuntu):
status: New → Invalid
Changed in init-system-helpers (Ubuntu Wily):
status: New → Confirmed
Changed in upstart (Ubuntu):
status: New → Confirmed
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package upstart - 1.13.2-0ubuntu18

---------------
upstart (1.13.2-0ubuntu18) xenial; urgency=medium

  * apparmor-profile-load: don't fail if apparmor is not installed.
    (LP: #1521931)

 -- Serge Hallyn <email address hidden> Thu, 03 Dec 2015 20:52:54 -0600

Changed in upstart (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Pavel, or anyone else affected,

Accepted init-system-helpers into wily-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/init-system-helpers/1.23ubuntu4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in init-system-helpers (Ubuntu Wily):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : [init-system-helpers/wily] verification still needed

The fix for this bug has been awaiting testing feedback in the -proposed repository for wily for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now, the package will be removed from the -proposed repository.

tags: added: removal-candidate
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package init-system-helpers - 1.23ubuntu4

---------------
init-system-helpers (1.23ubuntu4) wily-proposed; urgency=medium

  * apparmor-profile-load: don't fail if apparmor is not installed.
    (LP: #1521931)

 -- Serge Hallyn <email address hidden> Thu, 03 Dec 2015 21:06:27 -0600

Changed in init-system-helpers (Ubuntu Wily):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Update Released

The verification of the Stable Release Update for init-system-helpers has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.