# How to automatically start the canton node after the linux system restarts？

**URL:** <https://forum.canton.network/t/how-to-automatically-start-the-canton-node-after-the-linux-system-restarts/5557>\
**Category:** App Development\
**Tags:** canton\
**Created:** [October 31, 2022, 9:43am UTC](https://forum.canton.network/t/how-to-automatically-start-the-canton-node-after-the-linux-system-restarts/5557 "2022-10-31T09:43:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevin\_fan](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/kevin_fan/32/5130_2.png) [@kevin\_fan](https://forum.canton.network/u/kevin_fan)\
**Post date:** [October 31, 2022, 9:43am UTC](https://forum.canton.network/t/how-to-automatically-start-the-canton-node-after-the-linux-system-restarts/5557/1 "2022-10-31T09:43:38Z")

</div>

I want to use a non-root user to automatically start canton’s service node after booting, but an error occurs. Thanks for your help.

1. Write the sequencer.service file as follows:

```haskell
[Unit]
Description=sequencer
After=network.target remote-fs.target nss-lookup.target
Requires=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
Restart=always
RestartSec=5
ExecStart=canton daemon -c /opt/conf/postgres-sequencer-mediator.conf,/opt/conf/sequencer1.conf
User=ws_app
Environment=SYSTEMD_LOG_LEVEL=debug
[Install]
WantedBy=multi-user.target

```

1. Put it in the systemd/system directory

2. systemctl enable sequencer.service

3. After restarting the system, journalctl -u sequencer.service -f  
The log is as follows:

---

<div class="post-metadata">

**Author:** ![Remy](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/remy/32/595_2.png) [@Remy](https://forum.canton.network/u/Remy)\
**Post date:** [October 31, 2022, 8:23pm UTC](https://forum.canton.network/t/how-to-automatically-start-the-canton-node-after-the-linux-system-restarts/5557/2 "2022-10-31T20:23:03Z")

</div>

Hi,

I think you participant does not start because it cannot create log files.

By default Canton, writes its logs in two files, namely `log/canton.log` for standard logs and `log/canton_errors.log` to capture events for logging.last\_errors commands

Since your non-root user probably has no rights over these paths, you should override them with paths your user can write to.

- the path for standard logging can be specify using the command line `--log-file-name` or the environment variable `LOG_FILE_NAME`
- the path for logging logging.last\_errors commands cannot specify by the environment variable `LOG_LAST_ERRORS_FILE_NAME` or can be disabled with the flag `--log-last-errors false`.

Cheers

---

<div class="post-metadata">

**Author:** ![kevin\_fan](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/kevin_fan/32/5130_2.png) [@kevin\_fan](https://forum.canton.network/u/kevin_fan)\
**Post date:** [November 8, 2022, 1:04am UTC](https://forum.canton.network/t/how-to-automatically-start-the-canton-node-after-the-linux-system-restarts/5557/3 "2022-11-08T01:04:11Z")

</div>

Following your solution, the problem is solved, thank you very much！
