Unitech / pm2

Node.js Production Process Manager with a built-in Load Balancer.
https://pm2.keymetrics.io/docs/usage/quick-start/
Other
41.46k stars 2.62k forks source link

boot time startup on Ubuntu 24.04 with Wayland, fails #5820

Open sdetweil opened 5 months ago

sdetweil commented 5 months ago

What's going wrong?

when our app MagicMirror (uses Electron browser) starts at boot time, the electron runtime is confused, looking for X11, but can't find display, etc..

but if we start from command line, it works.

How could we reproduce this issue?

install Ubuntu 24.04 desktop install the MM app using my script

bash -c  "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/raspberry.sh)"

say yes to use pm2

(you can run the fixuppm2 script if you forget, or want to add it later )

bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixuppm2.sh)"

sudo reboot, app should start (works ok on raspi OS 64 bit, on pi4 or 5 with wayland), but fails with error below (tested on AMD and ARM (macos)) forcing wayland doesn't help setting wayland_display doesn't help.. see https://discourse.ubuntu.com/t/environment-variables-for-wayland-hackers/12750 the app never recovers altho wayland came up ok.

Supporting information

app reports

[2507:0513/142451.624701:ERROR:ozone_platform_x11.cc(244)] Missing X server or $DISPLAY
[2507:0513/142451.625045:ERROR:env.cc(257)] The platform failed to initialize.  Exiting.
Authorization required, but no authorization protocol specified

open terminal window pm2 stop all then pm2 start 0 and app comes up ok.

Run the following commands

$ pm2 report

[somefile.txt](https://github.com/Unitech/pm2/files/15299199/somefile.txt)

the pm2 error log pm2error.log

sdetweil commented 5 months ago

reference diff between wayland and x11 autostart https://forums.raspberrypi.com/viewtopic.php?t=314455 enclosed link to guides https://github.com/thagrol/Guides