Skip to content

Instantly share code, notes, and snippets.

@hellwolf
Created October 18, 2022 21:58
Show Gist options
  • Save hellwolf/703801b119e8cc93c79ad1394e158af9 to your computer and use it in GitHub Desktop.
Save hellwolf/703801b119e8cc93c79ad1394e158af9 to your computer and use it in GitHub Desktop.
/usr/lib/systemd/system/ipfs.service
# This file will be overwritten on package upgrades, avoid customizations here.
#
# To make persistant changes, create file in
# "/etc/systemd/system/ipfs.service.d/overwrite.conf" with
# `systemctl edit ipfs.service`. This file will be parsed after this
# file has been parsed.
#
# To overwrite a variable, like ExecStart you have to specify it once
# blank and a second time with a new value, like:
# ExecStart=
# ExecStart=/usr/bin/ipfs daemon --flag1 --flag2
#
# For more info about custom unit files see systemd.unit(5).
[Unit]
Description=InterPlanetary File System (IPFS) daemon
Documentation=https://docs.ipfs.io/
After=network.target
[Install]
WantedBy=multi-user.target
[Service]
# enable for 1-1024 port listening
#AmbientCapabilities=CAP_NET_BIND_SERVICE
# enable to specify a custom path see docs/environment-variables.md for further documentations
#Environment=IPFS_PATH=/custom/ipfs/path
# enable to specify a higher limit for open files/connections
#LimitNOFILE=1000000
#don't use swap
MemorySwapMax=0
# Don't timeout on startup. Opening the IPFS repo can take a long time in some cases (e.g., when
# badger is recovering) and migrations can delay startup.
#
# Ideally, we'd be a bit smarter about this but there's no good way to do that without hooking
# systemd dependencies deeper into go-ipfs.
TimeoutStartSec=infinity
Type=notify
User=ipfs
Group=ipfs
StateDirectory=ipfs
Environment=IPFS_PATH="/data/var/ipfs"
ExecStart=/usr/local/bin/ipfs daemon --init --migrate
Restart=always
KillSignal=SIGINT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment