1

i'm trying to have systemd execute a python3 script on boot and it fails saying some journal files were not opened due to permissions and I couldn't find any other solutions. The script works fine if I manually start it with systemctl start LoginAlert but after enabling it to start on boot (with systemctl enable LoginAlert) it gives me the error message below. I used a custom .service script for the execution of the script.

[Unit]
Description=Login alert system.

[Service]
Type=simple
ExecStart=/usr/bin/python3 /usr/bin/LoginAlert.py

[Install]
WantedBy=multi-user.target


● LoginAlert.service - Login alert system.
     Loaded: loaded (/etc/systemd/system/LoginAlert.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sat 2020-06-20 22:25:30 EDT; 2min 57s ago
    Process: 622 ExecStart=/usr/bin/python3 /usr/bin/LoginAlert.py (code=exited, status=1/FAILURE)
   Main PID: 622 (code=exited, status=1/FAILURE)

Warning: some journal files were not opened due to insufficient permissions

1 Answer 1

2

I had the same issue. The point is that the Warning: some journal files were not opened due to insufficient permissions is not the real problem. That just says that you are not able to see the log for that service.

If you run sudo systemctl status your-service.service, that message dissapears and you are able to see the log for that service.

Talking about running a python script on boot, I had the issue that it didn't execute the python script due to "permissions". That's what I thought.

In fact, as the script runs with root user (as it's executed at boot), ROOT DIDN'T HAVE THE LIBRARIES for python3 that my script needed. So instead of installing them with pip3 install selenium (for example), I needed to run * sudo pip3 install selenium* so root user had these libraries.

Hope that helped, regards!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.