chore(misc/README.md): trim duplicated content
UnkwUsr committed
Aug 5, 2023 at 18:22 UTC
2a20180819aa30abf064eb2ef4b2ece1d7472f9f
1 file changed
-124
misc/README.md
-124
@@ -120,130 +120,6 @@ The reason for running `ipfs` under a shell is to avoid needing to hard-code the
120
121
Notes:
122
123
-- To check that the job is running, run `launchctl list | grep ipfs`.
124
-- IPFS should now start whenever you log in (and exit when you log out).
125
-- [LaunchControl](http://www.soma-zone.com/LaunchControl/) is a GUI tool which simplifies management of LaunchAgents.## init system integration
126
-
127
-go-ipfs can be started by your operating system's native init system.
128
-
129
-- [systemd](#systemd)
130
-- [LSB init script](#initd)
131
-- [Upstart/startup job](#upstart)
132
-- [launchd](#launchd)
133
-
134
-### systemd
135
-
136
-For `systemd`, the best approach is to run the daemon in a user session. Here is a sample service file:
137
-
138
-```systemd
139
-[Unit]
140
-Description=IPFS daemon
141
-
142
-[Service]
143
-# Environment="IPFS_PATH=/data/ipfs" # optional path to ipfs init directory if not default ($HOME/.ipfs)
144
-ExecStart=/usr/bin/ipfs daemon
145
-Restart=on-failure
146
-
147
-[Install]
148
-WantedBy=default.target
149
-```
150
-
151
-To run this in your user session, save it as `~/.config/systemd/user/ipfs.service` (creating directories as necessary). Once you run `ipfs init` to create your IPFS settings, you can control the daemon using the following commands:
152
-
153
-* `systemctl --user start ipfs` - start the daemon
154
-* `systemctl --user stop ipfs` - stop the daemon
155
-* `systemctl --user status ipfs` - get status of the daemon
156
-* `systemctl --user enable ipfs` - enable starting the daemon at boot
157
-* `systemctl --user disable ipfs` - disable starting the daemon at boot
158
-
159
-*Note:* If you want this `--user` service to run at system boot, you must [`enable-linger`](http://www.freedesktop.org/software/systemd/man/loginctl.html) on the account that runs the service:
160
-
161
-```
162
-# loginctl enable-linger [user]
163
-```
164
-Read more about `--user` services here: [wiki.archlinux.org:Systemd ](https://wiki.archlinux.org/index.php/Systemd/User#Automatic_start-up_of_systemd_user_instances)
165
-
166
-### initd
167
-
168
-- Here is a full-featured sample service file: https://github.com/dylanPowers/ipfs-linux-service/blob/master/init.d/ipfs
169
-- Use `service` or your distribution's equivalent to control the service.
170
-
171
-## upstart
172
-
173
-- And below is a very basic sample upstart job. **Note the username jbenet**.
174
-
175
-```
176
-cat /etc/init/ipfs.conf
177
-```
178
-```
179
-description "ipfs: interplanetary filesystem"
180
-
181
-start on (local-filesystems and net-device-up IFACE!=lo)
182
-stop on runlevel [!2345]
183
-
184
-limit nofile 524288 1048576
185
-limit nproc 524288 1048576
186
-setuid jbenet
187
-chdir /home/jbenet
188
-respawn
189
-exec ipfs daemon
190
-```
191
-
192
-Another version is available here:
193
-
194
-```sh
195
-ipfs cat /ipfs/QmbYCwVeA23vz6mzAiVQhJNa2JSiRH4ebef1v2e5EkDEZS/ipfs.conf >/etc/init/ipfs.conf
196
-```
197
-
198
-For both, edit to replace occurrences of `jbenet` with whatever user you want it to run as:
199
-
200
-```sh
201
-sed -i s/jbenet/<chosen-username>/ /etc/init/ipfs.conf
202
-```
203
-
204
-Once you run `ipfs init` to create your IPFS settings, you can control the daemon using the `init.d` commands:
205
-
206
-```sh
207
-sudo service ipfs start
208
-sudo service ipfs stop
209
-sudo service ipfs restart
210
-...
211
-```
212
-
213
-## launchd
214
-
215
-Similar to `systemd`, on macOS you can run `go-ipfs` via a user LaunchAgent.
216
-
217
-- Create `~/Library/LaunchAgents/io.ipfs.go-ipfs.plist`:
218
-
219
-```xml
220
-<?xml version="1.0" encoding="UTF-8"?>
221
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
222
-<plist version="1.0">
223
-<dict>
224
- <key>KeepAlive</key>
225
- <true/>
226
- <key>Label</key>
227
- <string>io.ipfs.go-ipfs</string>
228
- <key>ProcessType</key>
229
- <string>Background</string>
230
- <key>ProgramArguments</key>
231
- <array>
232
- <string>/bin/sh</string>
233
- <string>-c</string>
234
- <string>~/go/bin/ipfs daemon</string>
235
- </array>
236
- <key>RunAtLoad</key>
237
- <true/>
238
-</dict>
239
-</plist>
240
-```
241
-The reason for running `ipfs` under a shell is to avoid needing to hard-code the user's home directory in the job.
242
-
243
-- To start the job, run `launchctl load ~/Library/LaunchAgents/io.ipfs.go-ipfs.plist`
244
-
245
-Notes:
246
-
123
- To check that the job is running, run `launchctl list | grep ipfs`.
124
- IPFS should now start whenever you log in (and exit when you log out).
125
- [LaunchControl](http://www.soma-zone.com/LaunchControl/) is a GUI tool which simplifies management of LaunchAgents.