jupyterhub / jupyterhub/systemdspawner
Fix example jupyterhub.service file
- Dominant language
- Python
- Stars
- 100
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
The example jupyterhub.service file is out of date and has a mistake anyway (readwrite set on /var/lib/jupyterhub but workingdir /var/local/lib)
On the other hand it would be great to get the best practices for a correct systemd service (or maybe there is another one in a different repo?). I've been writing mine sort of from scraps of advice around the internet without really knowing what I'm doing.
It currently looks like this:
```
[Unit]
Description=Jupyterhub
After=syslog.target network.target
[Service]
ExecStart=/opt/jupyterhub/bin/jupyterhub --no-ssl --config /opt/jupyterhub/etc/jupyterhub/jupyterhub_config.py
WorkingDirectory=/var/lib/jupyterhub/
ProtectSystem=strict
ReadWriteDirectories=/var/lib/jupyterhub/ /var/log/ /proc/self/ /run/
Environment="PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/jupyterhub/bin"
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_AUDIT_WRITE CAP_SETGID CAP_SETUID
PrivateDevices=yes
PrivateTmp=yes
ProtectKernelTunables=true
ProtectControlGroups=true
ProtectKernelModules=true
[Install]
WantedBy=multi-user.target
```
Including all the Protect* lines which i literally copy pasted from somewhere that suggested it was a good idea 🤣
Contributor guide
Assessment
This issue has not been assessed yet.