Failed to start LSB: AppArmor initialization, is this normal ?

Asked by ALJI Mohamed on 2016-07-06

I have apparmor service failing to initialize. can you explain to me the problem please ?

alji@notebook: sudo service apparmor status

● apparmor.service - LSB: AppArmor initialization
   Loaded: loaded (/etc/init.d/apparmor; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2016-07-06 23:02:54 WET; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1164 ExecStart=/etc/init.d/apparmor start (code=exited, status=2)

Jul 06 23:02:54 hp-15-notebook-pc systemd[1]: Starting LSB: AppArmor initialization...
Jul 06 23:02:54 hp-15-notebook-pc apparmor[1164]: /etc/init.d/apparmor: 35: .: Can't open /lib/apparmor/functions
Jul 06 23:02:54 hp-15-notebook-pc systemd[1]: apparmor.service: Control process exited, code=exited status=2
Jul 06 23:02:54 hp-15-notebook-pc systemd[1]: Failed to start LSB: AppArmor initialization.
Jul 06 23:02:54 hp-15-notebook-pc systemd[1]: apparmor.service: Unit entered failed state.
Jul 06 23:02:54 hp-15-notebook-pc systemd[1]: apparmor.service: Failed with result 'exit-code'.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apparmor Edit question
Assignee:
No assignee Edit question
Solved by:
ALJI Mohamed
Solved:
2016-07-07
Last query:
2016-07-07
Last reply:
2016-07-07
Manfred Hampl (m-hampl) said : #1

Try reinstalling apparmor.

What is the output of the commands (to be executed in a terminal window)

uname -a
lsb_release -crid
dpkg -l | grep apparmor
sudo apt-get install --reinstall apparmor

$ uname -a
uname -a
Linux hp-15-notebook-pc 4.4.0-28-generic #47-Ubuntu SMP Fri Jun 24 10:09:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

$sudo apt-get install --reinstall apparmor
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/445 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 238161 files and directories currently installed.)
Preparing to unpack .../apparmor_2.10.95-0ubuntu2_amd64.deb ...
Unpacking apparmor (2.10.95-0ubuntu2) over (2.10.95-0ubuntu2) ...
Processing triggers for systemd (229-4ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db (2.7.5-1) ...
Setting up apparmor (2.10.95-0ubuntu2) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
insserv: warning: script 'runmbbservice' missing LSB tags and overrides
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
AppArmor parser error for /etc/apparmor.d/usr.bin.webbrowser-app in /etc/apparmor.d/usr.bin.webbrowser-app at line 26: Could not open '/usr/share/apparmor/hardware/graphics.d'
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
AppArmor parser error for /etc/apparmor.d/usr.bin.webbrowser-app in /etc/apparmor.d/usr.bin.webbrowser-app at line 26: Could not open '/usr/share/apparmor/hardware/graphics.d'
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd

please, I have tried the command apt-get reinstall before so ...

$ sudo service apparmor status
● apparmor.service - LSB: AppArmor initialization
   Loaded: loaded (/etc/init.d/apparmor; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2016-07-07 08:06:45 WET; 7min ago
     Docs: man:systemd-sysv-generator(8)

Jul 07 08:06:42 hp-15-notebook-pc apparmor[877]: AppArmor parser error for /etc/apparmor.d/usr.bin.webbrowser-app in /etc/apparmor.d/usr.bin.webbrowse
Jul 07 08:06:42 hp-15-notebook-pc apparmor[877]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Jul 07 08:06:45 hp-15-notebook-pc apparmor[877]: Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
Jul 07 08:06:45 hp-15-notebook-pc apparmor[877]: AppArmor parser error for /etc/apparmor.d/usr.bin.webbrowser-app in /etc/apparmor.d/usr.bin.webbrowse
Jul 07 08:06:45 hp-15-notebook-pc apparmor[877]: Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
Jul 07 08:06:45 hp-15-notebook-pc apparmor[877]: ...fail!
Jul 07 08:06:45 hp-15-notebook-pc systemd[1]: apparmor.service: Control process exited, code=exited status=123
Jul 07 08:06:45 hp-15-notebook-pc systemd[1]: Failed to start LSB: AppArmor initialization.
Jul 07 08:06:45 hp-15-notebook-pc systemd[1]: apparmor.service: Unit entered failed state.
Jul 07 08:06:45 hp-15-notebook-pc systemd[1]: apparmor.service: Failed with result 'exit-code'.

sudo dpkg --audit --> nothing
sudo dpkg --verify --> nothing

$ locate runmbbservice
/etc/init.d/runmbbservice
/usr/local/MobileBrServ/runmbbservice

$ sudo service runmbbservice status
● runmbbservice.service
   Loaded: loaded (/etc/init.d/runmbbservice; bad; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:systemd-sysv-generator(8)

Manfred Hampl (m-hampl) said : #4

I see an error:

AppArmor parser error for /etc/apparmor.d/usr.bin.webbrowser-app
try reinstalling webbrowser-app

worked like a charm, thank you

Adam (y3hud4ch4y3m) said : #6

My Ubuntu server is an offline, air gapped machine. Is there a way to correct this issue with out using apt or the internet in general?