Skip to content

Commit

Permalink
Add example template service for jupyter single server intances
Browse files Browse the repository at this point in the history
  • Loading branch information
behrmann committed May 8, 2019
1 parent 8f44c06 commit bfd60c0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions jupyter-singleuser@.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[Unit]
Description=Jupyterhub Single-User Server for user %i
Wants=jupyterhub.service

[Service]
Type=simple
User=%i
EnvironmentFile=/srv/jupyterhub/envs/%i.env
ExecStart=<path to single server executable> $USERINSTANCEARGS
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=strict
ProtectHome=read-only
ProtectKernelTunables=yes
ProtectControlGroups=yes
# if your WorkingDirectory is on NFS and you use systemd <= 239 setting
# WorkingDirectory will not work, and you will have to use
# ExecStart=/bin/bash -c "cd <your workdir> && <path to single server executable> $USERINSTANCEARGS"
# and comment out WorkingDirectory
WorkingDirectory=~
ReadWritePaths=/home/%i
NoNewPrivileges=yes
CPUAccounting=yes
CPUQuota=400%
MemoryAccounting=yes
MemoryHigh=8G
MemoryMax=9G

0 comments on commit bfd60c0

Please sign in to comment.