Skip to content

Instantly share code, notes, and snippets.

@sq3
Created February 15, 2017 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sq3/f5367d4d198ae330d7c15bdfd855c8f8 to your computer and use it in GitHub Desktop.
Save sq3/f5367d4d198ae330d7c15bdfd855c8f8 to your computer and use it in GitHub Desktop.
systemd-nspawn-plex example service file
[Unit]
Description=Container Plex
Documentation=man:systemd-nspawn(1)
PartOf=machines.target
Before=machines.target
After=network.target zfs-mount.service
[Service]
ExecStart=/usr/bin/systemd-nspawn \
--quiet \
--keep-unit \
--boot \
--link-journal=try-guest \
--bind-ro=/srv/data/media \
--machine=plex
KillMode=mixed
Type=notify
RestartForceExitStatus=133
SuccessExitStatus=133
Slice=machine.slice
Delegate=yes
TasksMax=16384
DevicePolicy=closed
DeviceAllow=/dev/net/tun rwm
DeviceAllow=char-pts rw
DeviceAllow=/dev/loop-control rw
DeviceAllow=block-loop rw
DeviceAllow=block-blkext rw
[Install]
WantedBy=machines.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment