TomWhitwell / SlowMovie

MIT License
342 stars 67 forks source link

Slowmovie Service Failing #124

Closed DrBendy closed 9 months ago

DrBendy commented 2 years ago

I previously had no issues setting up my frame and got through an entire film without a single issue or hang. I had to change my wifi and just decided to do a clean reinstall for the frame. But now whenever I try to run the Slowmovie service and check the status, I get this message:

set mark: ...skipping... ● slowmovie.service - Slow Movie Player Service Loaded: loaded (/etc/systemd/system/slowmovie.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sun 2022-04-03 17:52:26 BST; 43s ago Process: 1346 ExecStart=/usr/bin/python3 /home/pi/SlowMovie/slowmovie.py (code=exited, status=217/USER) Main PID: 1346 (code=exited, status=217/USER) CPU: 11ms

Apr 03 17:52:26 frame systemd[1]: Started Slow Movie Player Service. Apr 03 17:52:26 frame systemd[1346]: slowmovie.service: Failed to determine user credentials: No such process Apr 03 17:52:26 frame systemd[1346]: slowmovie.service: Failed at step USER spawning /usr/bin/python3: No such process Apr 03 17:52:26 frame systemd[1]: slowmovie.service: Main process exited, code=exited, status=217/USER Apr 03 17:52:26 frame systemd[1]: slowmovie.service: Failed with result 'exit-code'. ~

I didn't have this issue before and followed the manual installation steps. This project is the entire extent of my programming knowledge so I would appreciate any help I can get.

qubist commented 2 years ago

From googling, it looks like a problem with systemd's interaction with users on the system. Are you doing something different than before with users, using sudo, or anything like that?

DrBendy commented 2 years ago

The only systemd thing I think I'm doing is changing to the SlowMovie directory and inputting:

sudo cp slowmovie.service /etc/systemd/system

sudo systemctl daemon-reload

robweber commented 2 years ago

Can you run the program manually? Just to confirm Python and all the deps are functioning normally?

JonCellini commented 10 months ago

Hi,

I know this is an old thread but I was just looking at this code to make a change. If you've manually copied the slowmovie.service.template file you will need to modify it as there are some templates used by the installer to set the user and path that would otherwise not be populated correctly. I suspect this is the case based on the error above as systemd is unable to determine what user ID on the system to run as.

You would want edit this line: User=${USER} and replace ${USER} with a vaild user ID such as pi for example.

You also would need to replace any instances of ${HOME} with the actual path to that users home directory. Or more plainly you want the paths to be correct for where you have installed SlowMovie.

Hope this helps.

robweber commented 9 months ago

Going to close this as I think the above is probably the right answer here. The manual instructions do state that the template file should be run with envsubst <slowmovie.service.template > slowmovie.service to resolve the variables prior to copying the file to the systemd folder.