I followed Greg’s example to the letter changing only TestApp to LynxMaster. It is not working. Looking at the system log after rebooting the Pi, LynxMaster does not appear. When I start it using line 9 from Greg’s example I get this in the log
Feb 18 15:11:43 raspberrypi systemd: Started Lynx Web Server.
Feb 18 15:11:43 raspberrypi systemd: LynxMaster.service: Failed to determine user credentials: No such process
Feb 18 15:11:43 raspberrypi systemd: LynxMaster.service: Failed at step USER spawning /opt/ezmeter/LynxMaster/LynxMaster: No such process
Feb 18 15:11:43 raspberrypi systemd: LynxMaster.service: Main process exited, code=exited, status=217/USER
Feb 18 15:11:43 raspberrypi systemd: LynxMaster.service: Failed with result ‘exit-code’.
When I go to the folder with the app and enter “sudo ./LynxMaster &” I get a blank screen in the browser (instead of the “This site can’t be reached” I get otherwise) and the system log shows entries from the app.opening and the first line of the session.opening. The next line of the session.opening calls the app method to connect to the database, but that does happen. When I recompiled for port 8080, it opens properly when I manually start the app. A Pi web app I wrote in 2018 needed a setcap command to allow it to use port 80. Should that have been in Greg’s code?
How can I solve the user credentials issue? I had set a root password earlier so I can SSH into the Pi with WinSCP. Would that have caused the problem?
An interesting thing I noticed. When I started the 8080 version of the program, it started with PID 931. When I tried to kill it, it said there was no such process. Kill 932 killed it. That’s not the way it used to work.