Qwoyn Studios
Search
K
Comment on page

Resources

Common System Files and File Size Limit Configuration

Qwoynd Service File

It is best to run qwoynd as a system service. Please follow the instructions below to get a basic service running on your machine.
Create a file name qwoynd.service
cd ~
nano qwoynd.service
Next copy the contents of the following code block into your newly created file and make changes where appropriate.
[Unit]
Description=Qwoyn Network Node
After=network-online.target
[Service]
User=root
ExecStart=/root/go/bin/qwoynd start
Restart=always
RestartSec=10
LimitNOFILE=4096
[Install]
WantedBy=multi-user.target
Now that you have your system file created we will need to move and enable it.
mv qwoynd.service /etc/systemd/system/qwoynd.service
systemctl enable qwoynd
sudo systemctl daemon-reload
That's it! In order to run your service please type the following command.
sudo service qwoynd start
You can check your logs by running the following command.
journalctl -u qwoynd -f

Increase Number of Open Files

You may need to increase the number of allowed opened files in order for qwoynd to not crash. To do so please follow the steps below.
sudo su -c "echo 'fs.file-max = 65536' >> /etc/sysctl.conf"
sysctl -p
sudo su -c "echo '* hard nofile 94000' >> /etc/security/limits.conf"
sudo su -c "echo '* soft nofile 94000' >> /etc/security/limits.conf"
sudo su -c "echo 'root hard nofile 94000' >> /etc/security/limits.conf"
sudo su -c "echo 'root soft nofile 94000' >> /etc/security/limits.conf"
sudo su -c "echo 'session required pam_limits.so' >> /etc/pam.d/common-session"