<blockquote>
  <p>It runs when i run this command:</p>

<pre><code>bitcoind -daemon -pid=/home/chris/.bitcoin/bitcoind.pid -
conf=/home/chris/.bitcoin/bitcoin.conf -datadir=/home/chris/.bitcoin/ 
-disablewallet
</code></pre>
</blockquote>

<p>When you run that command, where are you in your server? At the base level of your home folder? Your service file <code>ExecStart=</code> must point to the same location, and currently it's looking for <code>bitcoind</code> in <code>/home/chris/.bitcoin/</code>. Are you sure <code>bitcoind</code> is inside the directory <code>.bitcoin</code> in your home folder?</p>

<p>As a side note, that is a odd location for the binary. Consider placing <code>bitcoind</code> and <code>bitcoin-cli</code> in <code>/usr/local/bin/</code>. That way you can run it from anywhere in your server without specifying a path. But for the service file, you'd then should specify the full path, such as </p>

<pre><code>ExecStart=/usr/local/bin/bitcoind -daemon -pid=/home/chris/.bitcoin/bitcoind.pid \
-conf=/home/chris/.bitcoin/bitcoin.conf -datadir=/home/chris/.bitcoin/ -disablewallet
</code></pre>

<p>You should also consider changing the location of the PID file and you can also omit <code>-datadir=/home/chris/.bitcoin/</code>, as <code>bitcoind</code> will by default look for the data dir in that location, since the service is being started by the user 'chris'. These are suggestions taken from the official Bitcoin template you linked in your post.</p>

<p>Don't forget to <code>sudo systemctl daemon-reload</code> after you make changes to systemd service files, before <code>sudo systemctl restart &lt;service-name.service&gt;</code> for example.</p>

CC BY-SA 4.0
2019-06-13T07:23:33.473Z
`sudo systemdctl daemon reload` should be `sudo systemdctl daemon-reload` note the dash.
whitebeard
CC BY-SA 4.0
2018-04-18T18:48:00.933Z
2019-07-03T17:26:59.873Z
2019-07-03T17:26:59.873Z
user2066480
<p>I happen to run across this, and I don't know if you ever got this working.  Try using the correct executable in the <code>bitcoind.service</code> file for the <code>ExecStart</code> line (11 of your gist).  My bitcoind is installed in <code>/usr/bin/bitcoind</code>.</p>

<p>I also commented on your gist above with an example.</p>

CC BY-SA 3.0
2018-02-27T03:10:05.090Z
2018-02-27T03:10:05.090Z
AlienResidents
<p>I've created a bitcoin.service file as found here:</p>

<p><a href="https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service</a></p>

<p>However i've modified it as i build bitcoin-core from source to the following:</p>

<p><a href="https://gist.github.com/anonymous/7e1bca97739147d698327d7f3a119992" rel="nofollow noreferrer">https://gist.github.com/anonymous/7e1bca97739147d698327d7f3a119992</a></p>

<p>It is installed to:</p>

<p>/lib/systemd/system</p>

<p>As apparently in this version of Ubuntu it must be there</p>

<p>It runs when i run this command:</p>

<pre><code>bitcoind -daemon -pid=/home/chris/.bitcoin/bitcoind.pid -
conf=/home/chris/.bitcoin/bitcoin.conf -datadir=/home/chris/.bitcoin/ 
-disablewallet
</code></pre>

<p>However trying to run:</p>

<pre><code>systemctl start bitcoind
</code></pre>

<p>Gives this error</p>

<pre><code>bitcoind.service - Bitcoin's distributed currency daemon
   Loaded: loaded (/lib/systemd/system/bitcoind.service; enabled; 
vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2017-10-15 17:27:38 
BST; 2s ago
  Process: 4180 ExecStart=/home/chris/.bitcoin/bitcoind -daemon -
pid=/home/chris/.bitcoin/bitcoind.pid -
conf=/home/chris/.bitcoin/bitcoin.conf -datadir=/home/chris/.bitcoin/ 
-disablewallet (code=exited, status=203

Oct 15 17:27:38 chris-GE60-2PL systemd[1]: bitcoind.service: Unit 
entered failed state.
Oct 15 17:27:38 chris-GE60-2PL systemd[1]: bitcoind.service: Failed 
with result 'exit-code'.
Oct 15 17:27:38 chris-GE60-2PL systemd[1]: bitcoind.service: Service 
hold-off time over, scheduling restart.
Oct 15 17:27:38 chris-GE60-2PL systemd[1]: Stopped Bitcoin's 
distributed currency daemon.
Oct 15 17:27:38 chris-GE60-2PL systemd[1]: bitcoind.service: Start 
request repeated too quickly.
Oct 15 17:27:38 chris-GE60-2PL systemd[1]: Failed to start Bitcoin's 
distributed currency daemon.
Oct 15 17:27:38 chris-GE60-2PL systemd[1]: bitcoind.service: Unit 
entered failed state.
Oct 15 17:27:38 chris-GE60-2PL systemd[1]: bitcoind.service: Failed 
with result 'exit-code'.
</code></pre>

<p>Does anyone know what i'm doing wrong here ?</p>

CC BY-SA 3.0
2018-02-27T08:21:11.763Z
Usually, `-conf={file}` not `{path}/{file}`
Willtech
<bitcoind>
Setting up the bitcoind to run at startup Ubuntu 17.04
Chris Dixon
# Setting up the bitcoind to run at startup Ubuntu 17.04

(Asked by: username_0 on 2017-10-15)

I've created a bitcoin.service file as found here:

<https://github.com/bitcoin/bitcoin/blob/master/contrib/init/bitcoind.service>

However i've modified it as i build bitcoin-core from source to the following:

<https://gist.github.com/anonymous/7e1bca97739147d698327d7f3a119992>

It is installed to:

/lib/systemd/system

As apparently in this version of Ubuntu it must be there

It runs when i run this command:

```
bitcoind -daemon -pid=/home/username_0/.bitcoin/bitcoind.pid -
conf=/home/username_0/.bitcoin/bitcoin.conf -datadir=/home/username_0/.bitcoin/ 
-disablewallet

```

However trying to run:

```
systemctl start bitcoind

```

Gives this error

```
bitcoind.service - Bitcoin's distributed currency daemon
   Loaded: loaded (/lib/systemd/system/bitcoind.service; enabled; 
vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2017-10-15 17:27:38 
BST; 2s ago
  Process: 4180 ExecStart=/home/username_0/.bitcoin/bitcoind -daemon -
pid=/home/username_0/.bitcoin/bitcoind.pid -
conf=/home/username_0/.bitcoin/bitcoin.conf -datadir=/home/username_0/.bitcoin/ 
-disablewallet (code=exited, status=203

Oct 15 17:27:38 username_0-GE60-2PL systemd[1]: bitcoind.service: Unit 
entered failed state.
Oct 15 17:27:38 username_0-GE60-2PL systemd[1]: bitcoind.service: Failed 
with result 'exit-code'.
Oct 15 17:27:38 username_0-GE60-2PL systemd[1]: bitcoind.service: Service 
hold-off time over, scheduling restart.
Oct 15 17:27:38 username_0-GE60-2PL systemd[1]: Stopped Bitcoin's 
distributed currency daemon.
Oct 15 17:27:38 username_0-GE60-2PL systemd[1]: bitcoind.service: Start 
request repeated too quickly.
Oct 15 17:27:38 username_0-GE60-2PL systemd[1]: Failed to start Bitcoin's 
distributed currency daemon.
Oct 15 17:27:38 username_0-GE60-2PL systemd[1]: bitcoind.service: Unit 
entered failed state.
Oct 15 17:27:38 username_0-GE60-2PL systemd[1]: bitcoind.service: Failed 
with result 'exit-code'.

```

Does anyone know what i'm doing wrong here ?

**Tags:** bitcoind

> **Comments:**
> **username_1**: Usually, `-conf={file}` not `{path}/{file}`  

---

## 2 answers

### Answer by username_2 on 2018-04-18. Score: 1

> It runs when i run this command:
>
> ```
> bitcoind -daemon -pid=/home/username_0/.bitcoin/bitcoind.pid -
> conf=/home/username_0/.bitcoin/bitcoin.conf -datadir=/home/username_0/.bitcoin/ 
> -disablewallet
>
> ```

When you run that command, where are you in your server? At the base level of your home folder? Your service file `ExecStart=` must point to the same location, and currently it's looking for `bitcoind` in `/home/username_0/.bitcoin/`. Are you sure `bitcoind` is inside the directory `.bitcoin` in your home folder?

As a side note, that is a odd location for the binary. Consider placing `bitcoind` and `bitcoin-cli` in `/usr/local/bin/`. That way you can run it from anywhere in your server without specifying a path. But for the service file, you'd then should specify the full path, such as

```
ExecStart=/usr/local/bin/bitcoind -daemon -pid=/home/username_0/.bitcoin/bitcoind.pid \
-conf=/home/username_0/.bitcoin/bitcoin.conf -datadir=/home/username_0/.bitcoin/ -disablewallet

```

You should also consider changing the location of the PID file and you can also omit `-datadir=/home/username_0/.bitcoin/`, as `bitcoind` will by default look for the data dir in that location, since the service is being started by the user 'username_0'. These are suggestions taken from the official Bitcoin template you linked in your post.

Don't forget to `sudo systemctl daemon-reload` after you make changes to systemd service files, before `sudo systemctl restart <service-name.service>` for example.

> **Comments:**
> **username_3**: `sudo systemdctl daemon reload` should be `sudo systemdctl daemon-reload` note the dash.  

---

### Answer by username_4 on 2018-02-27. Score: 0

I happen to run across this, and I don't know if you ever got this working. Try using the correct executable in the `bitcoind.service` file for the `ExecStart` line (11 of your gist). My bitcoind is installed in `/usr/bin/bitcoind`.

I also commented on your gist above with an example.


---

