-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example template service for jupyter single server intances
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |