SELinux causing an issue with systemd service

I'm trying to write a systemd service for Jupyter‚ but it always fails with jupyter.service: Failed at step EXEC spawning /usr/local/bin/jupyter-notebook: Permission denied. My unit file is:

[Unit]
Description=Starts the Jupyter server
After=network.target

[Service]
User=jupyter
WorkingDirectory=/home/jupyter/
ExecStart=/usr/local/bin/jupyter-notebook

[Install]
WantedBy=multi-user.target

I don't want to disable SELinux, but that's the only way I can get the service to run. What do I do?

EDIT: Relabeling the user context to system_u with chcon fixed it.

Posted Mar 8, 2018, 9:55 PM UTC · edited

21
HeidiH0•

semanage permissive -a jupyter

Unless something else is conflicting with it.

2