# Systemd Service for BitCore Daemon

IMPORTANT: This guide only works if you have followed the [Masternode Quick Guide](https://bitcore-btx.gitbook.io/bitcore-btx/bitcore-masternode-guide).\
Personal configurations are not considered in this guide.

**Stop your BitCore Daemon**

`bitcore-cli stop`

**Install Nano for creating/editing files (or use vi)**

`apt install nano`

**Create Systemd Service File**

`nano /etc/systemd/system/bitcored.service`

**and insert this text:**

`[Unit]`\
`Description=BitCore Masternode Service`\
`After=network.target`

`[Service]`\
`User=root`\
`Group=root`

`Type=forking`

`ExecStart=/usr/local/bin/bitcored -daemon -shrinkdebugfile`\
`ExecStop=/usr/local/bin/bitcore-cli stop`

`Restart=always`\
`PrivateTmp=true`\
`TimeoutStopSec=60s`\
`TimeoutStartSec=10s`\
`StartLimitInterval=120s`\
`StartLimitBurst=5`

`[Install]`\
`WantedBy=multi-user.target`

**Close the Editor and save the File with STRG + X**\
**Enable and start the Service (service starts automatically after reboot or Daemon crash)**

`sudo systemctl daemon-reload`\
`sudo systemctl enable bitcored`\
`sudo systemctl start bitcored`

**Check the Service**

`systemctl status bitcored | grep -i "Active" -B 1`

**and you should see (example):**\
\
`Loaded: loaded (/etc/systemd/system/bitcored.service; enabled; vendor preset: enabled)`\
`Active: active (running) since Sat 2020-05-02 14:27:09 UTC; 5h 6min ago`

**Credits:** Thanks <https://t.me/Rammbock1> for his contribution!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bitcore-btx.gitbook.io/bitcore-btx/privatekey-1/bitcore-masternodes-1/systemd-service-for-bitcore-daemon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
