# Restarting a node in less time

**URL:** <https://forum.cardano.org/t/restarting-a-node-in-less-time/68606>\
**Category:** Operate a Stake Pool\
**Created:** [11 August 2021 22:30 UTC](https://forum.cardano.org/t/restarting-a-node-in-less-time/68606 "2021-08-11T22:30:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr\_Anderson](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mr_anderson/32/21624_2.png) [@Mr\_Anderson](https://forum.cardano.org/u/Mr_Anderson)\
**Post date:** [11 August 2021 22:30 UTC](https://forum.cardano.org/t/restarting-a-node-in-less-time/68606/1 "2021-08-11T22:30:24Z")

</div>

I’m sure this annoys many of us. How can I restart a node without waiting a few minutes?

It used to be I just press “q” and the node seemed to close gracefully. And restarting it took about 20 seconds. Now I dont know any way other than killing the node, and waiting about 5 minutes for it to start again.

---

<div class="post-metadata">

**Author:** ![DevJohn](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/devjohn/32/39856_2.png) [@DevJohn](https://forum.cardano.org/u/DevJohn)\
**Post date:** [11 August 2021 23:02 UTC](https://forum.cardano.org/t/restarting-a-node-in-less-time/68606/2 "2021-08-11T23:02:14Z")

</div>

Gracefully…that’s your problem. It means that your node will only restart after finishing any active connections. IF you want quick, you have to restart the node using the sudo reboot command.

---

<div class="post-metadata">

**Author:** ![Alexd1985](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/alexd1985/32/23759_2.png) [@Alexd1985](https://forum.cardano.org/u/Alexd1985)\
**Post date:** [12 August 2021 00:22 UTC](https://forum.cardano.org/t/restarting-a-node-in-less-time/68606/3 "2021-08-12T00:22:27Z")

</div>

if u are using sudo systemctl restart cardano-node command u will wait more minutes

Try  
sudo systemctl stop cardano-node  
sudo systemctl start cardano-node

---

<div class="post-metadata">

**Author:** ![Ruslan\_Sendecky](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/ruslan_sendecky/32/39545_2.png) [@Ruslan\_Sendecky](https://forum.cardano.org/u/Ruslan_Sendecky)\
**Post date:** [17 August 2021 05:07 UTC](https://forum.cardano.org/t/restarting-a-node-in-less-time/68606/4 "2021-08-17T05:07:16Z")

</div>

Check the signal. You need to send signal 2 instead of 15 to your node process. Basically “INT” instead of “TERM”. If you send 15, the database will not be closed cleanly and your node will re-scan the DB for errors.

Systemd sends “TERM” by default followed by “KILL” in 90 seconds.  
Docker and Podman send “TERM” as well.

In more details. Node code traps signals. Depending on which signal it receives, it acts accordingly. When it receives “INT”, it executes code that cleans everything up and closes the DB correctly. Upon closing the DB it marks it as “cleanly closed” (similar to the OS filesystem).

So send 2 - not 15. And most definitely NOT 9 lol

---

<div class="post-metadata">

**Author:** ![Mr\_Anderson](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mr_anderson/32/21624_2.png) [@Mr\_Anderson](https://forum.cardano.org/u/Mr_Anderson)\
**Post date:** [17 August 2021 06:06 UTC](https://forum.cardano.org/t/restarting-a-node-in-less-time/68606/5 "2021-08-17T06:06:42Z")

</div>

Please speak to me like I’m Biden. Be very slow and clear.

What must I type into the console to restart the node in less time.

I’ll try this though:  
sudo systemctl stop cardano-node  
sudo systemctl start cardano-node

Do you agree with this Ruslan?

---

<div class="post-metadata">

**Author:** ![Ruslan\_Sendecky](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/ruslan_sendecky/32/39545_2.png) [@Ruslan\_Sendecky](https://forum.cardano.org/u/Ruslan_Sendecky)\
**Post date:** [17 August 2021 07:36 UTC](https://forum.cardano.org/t/restarting-a-node-in-less-time/68606/6 "2021-08-17T07:36:16Z")

</div>

Ah, I didn’t realise Biden was slow lol. I thought Bush was the idiot. Not a US citizen, sorry. Anyway…

“systemctl stop cardano-node” just uses the defaults to stop a process. The default is to send TERM signal to the process. You can modify the defaults.

I cannot tell you what to type cos I don’t know how it is set up. Show me your  
systemd service unit file please.

But without knowing what you have there, the generic way to fix this would be this:

1. Stop the service
2. Open systemd file and add this line “KillSignal=SIGINT” to the [Service] section
3. Run “systemctl daemon-reload”
4. Start the service

---

<div class="post-metadata">

**Author:** ![Mr\_Anderson](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/mr_anderson/32/21624_2.png) [@Mr\_Anderson](https://forum.cardano.org/u/Mr_Anderson)\
**Post date:** [17 August 2021 21:59 UTC](https://forum.cardano.org/t/restarting-a-node-in-less-time/68606/7 "2021-08-17T21:59:46Z")

</div>

> [@Ruslan\_Sendecky](#):
>
> I didn’t realise Biden was slow lol

Biden is Bitcoin on a Commodore 64 with 24k modem connected between Earth and the Moon. But it’s not him making the decisions anyway.

I’m following the instructions at [Guide: How to Set Up a Cardano Stake Pool | CoinCashew](https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node) so it would be:

# The Cardano node service (part of systemd)

# file: /etc/systemd/system/cardano-node.service

[Unit]  
Description = Cardano node service  
Wants = network-online.target  
After = network-online.target

[Service]  
User = ${USER}  
Type = simple  
WorkingDirectory= ${NODE\_HOME}  
ExecStart = /bin/bash -c ‘${NODE\_HOME}/startBlockProducingNode.sh’  
KillSignal=SIGINT  
RestartKillSignal=SIGINT  
TimeoutStopSec=2  
LimitNOFILE=32768  
Restart=always  
RestartSec=5  
SyslogIdentifier=cardano-node

[Install]  
WantedBy = multi-user.target

---

<div class="post-metadata">

**Author:** ![Ruslan\_Sendecky](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/ruslan_sendecky/32/39545_2.png) [@Ruslan\_Sendecky](https://forum.cardano.org/u/Ruslan_Sendecky)\
**Post date:** [18 August 2021 04:05 UTC](https://forum.cardano.org/t/restarting-a-node-in-less-time/68606/8 "2021-08-18T04:05:00Z")

</div>

Hi,

Your systemd unit is correct. It is already doing what I suggested and sends the correct signal INT as you can see.  
I just looked at this coin cashew thing and it doesn’t actually start the node itself. It starts the script wrapper instead.  
Bash doesn’t forward signals to its children.  
startBlockProducingNode.sh (parent) → cardano-node (child)  
Basically, you are sending the signal to the script - not to the node process.  
One of the easier options here is to exec out of the script.

Let’s try this. Open startBlockProducingNode.sh with your favourite editor.  
Add the word “exec” right before you execute the node.  
So the line “/usr/local/bin/cardano-node run …” in your wrapper script needs to change to “exec /usr/local/bin/cardano-node run …”

Stop the service.  
Edit and save the file.  
Start the service.  
Wait for the node to boot completely.  
Restart the service again.
