| 1 | # This file will be overwritten on package upgrades, avoid customizations here. |
| 2 | # |
| 3 | # To make persistent changes, create file in |
| 4 | # "/etc/systemd/system/ipfs.service.d/overwrite.conf" with |
| 5 | # `systemctl edit ipfs.service`. This file will be parsed after this |
| 6 | # file has been parsed. |
| 7 | # |
| 8 | # To overwrite a variable, like ExecStart you have to specify it once |
| 9 | # blank and a second time with a new value, like: |
| 10 | # ExecStart= |
| 11 | # ExecStart=/usr/local/bin/ipfs daemon --flag1 --flag2 |
| 12 | # |
| 13 | # For more info about custom unit files see systemd.unit(5). |
| 14 | |
| 15 | [Unit] |
| 16 | Description=InterPlanetary File System (IPFS) daemon |
| 17 | Documentation=https://docs.ipfs.tech/ |
| 18 | After=network.target |
| 19 | |
| 20 | [Service] |
| 21 | |
| 22 | # enable for 1-1024 port listening |
| 23 | #AmbientCapabilities=CAP_NET_BIND_SERVICE |
| 24 | # enable to specify a custom path see docs/environment-variables.md for further documentations |
| 25 | #Environment=IPFS_PATH=/custom/ipfs/path |
| 26 | # enable to specify a higher limit for open files/connections |
| 27 | #LimitNOFILE=1000000 |
| 28 | |
| 29 | #don't use swap |
| 30 | MemorySwapMax=0 |
| 31 | |
| 32 | # Don't timeout on startup. Opening the IPFS repo can take a long time in some cases (e.g., when |
| 33 | # badger is recovering) and migrations can delay startup. |
| 34 | # |
| 35 | # Ideally, we'd be a bit smarter about this but there's no good way to do that without hooking |
| 36 | # systemd dependencies deeper into go-ipfs. |
| 37 | TimeoutStartSec=infinity |
| 38 | |
| 39 | Type=notify |
| 40 | User=ipfs |
| 41 | Group=ipfs |
| 42 | StateDirectory=ipfs |
| 43 | Environment=IPFS_PATH="${HOME}" |
| 44 | ExecStart=/usr/local/bin/ipfs daemon --init --migrate |
| 45 | Restart=on-failure |
| 46 | KillSignal=SIGINT |
| 47 | |
| 48 | [Install] |
| 49 | WantedBy=default.target |