LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problem with failing to start services (https://www.linuxquestions.org/questions/linux-newbie-8/problem-with-failing-to-start-services-4175697034/)

peter7089 06-29-2021 01:40 AM

Problem with failing to start services
 
I have these three services that are failing to start:

Code:

$ systemctl --failed
  UNIT                  LOAD  ACTIVE SUB    DESCRIPTION                       
● snap-core-11187.mount loaded failed failed Mount unit for core, revision 11187
● apparmor.service      loaded failed failed Load AppArmor profiles           
● vboxweb.service      loaded failed failed VirtualBox Web Service

If i try to start apparmor i get this:

Code:

$ sudo systemctl start apparmor
Job for apparmor.service failed because the control process exited with error code.
See "systemctl status apparmor.service" and "journalctl -xe" for details.


If i view the status of apparmor service i get this:

Code:

$ sudo systemctl status apparmor
● apparmor.service - Load AppArmor profiles
  Loaded: loaded (/lib/systemd/system/apparmor.service; enabled; vendor preset: enabled)
  Active: failed (Result: exit-code) since Mon 2021-06-28 23:32:50 EEST; 3min 23s ago
    Docs: man:apparmor(7)
          https://gitlab.com/apparmor/apparmor/wikis/home/
  Process: 17376 ExecStart=/lib/apparmor/apparmor.systemd reload (code=exited, status=1/FAILURE)
 Main PID: 17376 (code=exited, status=1/FAILURE)

Jun 28 23:32:50 mx apparmor.systemd[17376]: Restarting AppArmor
Jun 28 23:32:50 mx apparmor.systemd[17376]: Reloading AppArmor profiles
Jun 28 23:32:50 mx apparmor.systemd[17376]: Skipping profile in /etc/apparmor.d/disable: usr.bin.thu
Jun 28 23:32:50 mx apparmor.systemd[17376]: AppArmor parser error for /etc/apparmor.d in /etc/apparm
Jun 28 23:32:50 mx apparmor.systemd[17376]: Skipping profile in /etc/apparmor.d/disable: usr.bin.thu
Jun 28 23:32:50 mx apparmor.systemd[17376]: AppArmor parser error for /etc/apparmor.d/usr.lib.snapd.
Jun 28 23:32:50 mx apparmor.systemd[17376]: Error: At least one profile failed to load
Jun 28 23:32:50 mx systemd[1]: apparmor.service: Main process exited, code=exited, status=1/FAILURE
Jun 28 23:32:50 mx systemd[1]: apparmor.service: Failed with result 'exit-code'.
Jun 28 23:32:50 mx systemd[1]: Failed to start Load AppArmor profiles.

For the snap-core-11187.mount service i don't know why is there. I had installed snapd, but i removed it. How to remove this service?

I don't know why vboxweb.service if failing to start and if it is important.

ondoho 06-29-2021 04:13 AM

Quote:

Originally Posted by peter7089 (Post 6262262)
For the snap-core-11187.mount service i don't know why is there. I had installed snapd, but i removed it. How to remove this service?

All of it?
Have you searched apt/dpkg for remnants?
I think
Code:

dpkg -l | grep -i snap
will tell you.

If purging all remnants doesn't help, find the file:
Code:

sudo find / -name snap-core-11187.mount 2>/dev/null
Figure out what owns it:
Code:

dpkg-query -S "*/snap-core-11187.mount"
Same for the other file:
Code:

dpkg-query -S /etc/apparmor.d/usr.lib.snapd
BTW your systemctl output is cut off at the right margin. We are missing info.

Quote:

Originally Posted by peter7089 (Post 6262262)
I don't know why vboxweb.service if failing to start and if it is important.

Probably not. You can always 'systemctl disable' or 'systemctl mask' it.

peter7089 06-29-2021 05:22 AM

I searched for snap remnants and i get this:
Code:

$ dpkg -l | grep -i snap
ii  libsnappy1v5:amd64                            1.1.7-1                                  amd64        fast compression/decompression library
ii  libsnappy1v5:i386                            1.1.7-1                                  i386        fast compression/decompression library
ii  mx-snapshot                                  21.6.01                                  amd64        MX Snapshot
rc  snapd                                        2.37.4-1+b1                              amd64        Daemon and tooling that enable snap packages
ii  xdg-desktop-portal                            1.2.0-1                                  amd64        desktop integration portal for Flatpak and Snap

I don't know why this remnant of snapd was not removed. I tried 'apt remove snapd' but it didn't work. Then i tried 'apt purge snapd' and it removed the snapd remnant. After that i was able to start apparmor service. It seems snapd somehow was preventing apparmor to start.

The vboxweb service is still not able to start. If i get the status i see this:
Code:

$ sudo systemctl status vboxweb
● vboxweb.service - VirtualBox Web Service
  Loaded: loaded (/lib/systemd/system/vboxweb.service; enabled; vendor preset: enabled)
  Active: failed (Result: protocol) since Tue 2021-06-29 13:17:44 EEST; 30s ago
  Process: 3729 ExecStart=/usr/lib/virtualbox/vboxweb-service.sh start (code=exited, status=0/SUCCESS)

Jun 29 13:17:44 mx systemd[1]: Starting VirtualBox Web Service...
Jun 29 13:17:44 mx systemd[1]: vboxweb.service: Can't open PID file /run/vboxweb.pid (yet?) after start: No such file or directory
Jun 29 13:17:44 mx systemd[1]: vboxweb.service: Failed with result 'protocol'.
Jun 29 13:17:44 mx systemd[1]: Failed to start VirtualBox Web Service.


ondoho 06-29-2021 05:27 AM

Likely the rc (residual config) is the culprit.

Try
Code:

sudo apt purge snapd libsnappy1v5:i386 libsnappy1v5:amd64
And learn the difference between "remove" and "purge": 'man apt'

peter7089 06-29-2021 06:00 AM

Do i really need to remove libsnappy1v5:i386 and libsnappy1v5:amd64. If i run 'apt autoremove' it doesn't show these two packages as not used.

ondoho 06-30-2021 01:21 AM

Quote:

Originally Posted by peter7089 (Post 6262334)
Do i really need to remove libsnappy1v5:i386 and libsnappy1v5:amd64. If i run 'apt autoremove' it doesn't show these two packages as not used.

Somehow I knew you would ask that. Use a bit of creativity for dog's sake!
You are free to split that command up, start with purging snapd's rc and see if it's enough.
You can also use th '-s' switch to get a simulation of what would be done, but it shouldn't even be necessary, apt should ask your permission before going through with removals.


All times are GMT -5. The time now is 08:14 PM.