From dfb52fb3e2c268296c2aa258a8f2e5401479f323 Mon Sep 17 00:00:00 2001 From: "@RubenKelevra" Date: Thu, 30 Apr 2020 17:59:09 +0200 Subject: [PATCH] systemd.service: enable restart on crash and run as system user 'ipfs' add some optional paramters with short help texts add sysuser.conf --- misc/systemd/ipfs-sysusers.conf | 3 +++ misc/systemd/ipfs.service | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 misc/systemd/ipfs-sysusers.conf diff --git a/misc/systemd/ipfs-sysusers.conf b/misc/systemd/ipfs-sysusers.conf new file mode 100644 index 000000000..9d5d85756 --- /dev/null +++ b/misc/systemd/ipfs-sysusers.conf @@ -0,0 +1,3 @@ +u ipfs - "IPFS daemon" /var/lib/ipfs +g ipfs - +m ipfs ipfs diff --git a/misc/systemd/ipfs.service b/misc/systemd/ipfs.service index 0ee585ac6..73109dccd 100644 --- a/misc/systemd/ipfs.service +++ b/misc/systemd/ipfs.service @@ -1,9 +1,22 @@ [Unit] -Description=IPFS Daemon +Description=InterPlanetary File System (IPFS) daemon +After=network.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 + Type=notify +User=ipfs +Group=ipfs +WorkingDirectory=/var/lib/ipfs ExecStart=/usr/bin/ipfs daemon --init --migrate +Restart=on-failure KillSignal=SIGINT [Install]