0

I am dual booting ubuntu 20.04 desktop on my mid 2012 macbook pro. I'd like to run it as headless server with the lid closed. To try to do this I set systemctl default to multi-user, disabled gdm, and set grub to boot into single user mode. Everything is working fine (~2% CPU) when I have an external monitor plugged in but as soon as I unplug the external monitor cpu usage spikes (~40%), and systemd_logind starts running reportedly using ~80% cpu. When I plug the external monitor back in systemd_logind stops using a bunch of cpu and the system goes back to around 2% cpu.

Any suggestions would be greatly appreciated.

PS: I tried to install ubuntu server originally, but it wouldn't let me do the partitioning the way I needed to dual boot, so i had to use desktop to install.

badi95
  • 1
  • 2
  • "and set grub to boot into single user mode" - I don't understand the reasoning behind this if you intend to use it as a server, but could you explain how exactly you did it? – danzel Oct 02 '20 at 15:24
  • I might be mistaken when i said I set grub into single user mode. What I did is followed the instructions here. http://ubuntuhandbook.org/index.php/2020/05/boot-ubuntu-20-04-command-console/ – badi95 Oct 02 '20 at 15:28
  • I'm not sure what the kernel parameters do, but I'm quite sure you don't need them for what you want to achieve. Try undoing the changes to /etc/default/grub. All you need to do is setting systemd's default target to multi-user. – danzel Oct 02 '20 at 16:17
  • I actually tried with just multi-user, before trying the grub changes. Same behavior unfortunately. – badi95 Oct 02 '20 at 17:07
  • Does journalctl show any relevant logs for the time range when the display is not connected? Run journalctl -f, disconnect the display, wait a couple of seconds and reconnect it. BTW, what happens when the lid is open? – danzel Oct 03 '20 at 07:07
  • Running journalctl -f and unplugging got me:
    systemd-logind[772]: Suspending...
    systemd-logind[772]: Unit suspend.target is masked, refusing operation.
    systemd-logind[772]: Failed to execute suspend operation: Permission denied

    So I googled a bit and found this answer https://askubuntu.com/a/1180519/1132566
    Which seemed to fix the issue. Thanks for your help!

    – badi95 Oct 03 '20 at 21:06
  • Yep, specifically this response form that https://askubuntu.com/a/1180519/1132566 – badi95 Oct 16 '20 at 18:54

1 Answers1

0

Follow suggestions from @denzel to run journalctl -f while unplugging got me:

systemd-logind[772]: Suspending...
systemd-logind[772]: Unit suspend.target is masked, refusing operation.
systemd-logind[772]: Failed to execute suspend operation: Permission denied

So I googled a bit and found this answer askubuntu.com/a/1180519/1132566 Which seemed to fix the issue.

badi95
  • 1
  • 2