* Christian Boltz <debian-b...@cboltz.de>, 2018-12-31, 12:22:
The init script is broken. The start action fails with:

  /etc/init.d/apparmor: 60: shift: can't shift that many

This looks like a regression from upstream commit 0d5ab43d592245d011b2614e6e20fc7cb851c53c which got backported into the Debian package.


The fix is most likely (untested, because I don't see this error on openSUSE):

I guess it's a bash vs dash thing:

  $ bash -c 'shift; echo $?'
  1

  $ dash -c 'shift; echo $?'
  dash: 1: shift: can't shift that many

I have /bin/sh pointing to dash (which is the Debian default).

-       if ! is_apparmor_present ; then
+       if ! is_apparmor_present apparmor ; then

Now I get:

  Starting AppArmor - failed, To enable AppArmor, ensure your kernel is 
configured with CONFIG_SECURITY_APPARMOR=y then add 'security=apparmor 
apparmor=1' to the kernel command line

It looks like is_apparmor_present() always fails?

the only code that still actually does something there is
   [ -d /sys/module/apparmor ]

With this one-line implementation of is_apparmor_present(), the script seems to work, but I get warnings about missing functions:

  /etc/init.d/apparmor: 209: /etc/init.d/apparmor: aa_log_action_start: not 
found
  /etc/init.d/apparmor: 221: /etc/init.d/apparmor: aa_log_action_end: not found

--
Jakub Wilk

Reply via email to