-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation Change Request : Linux Native Agent - systemctl and log rotation #1259
Comments
Appears the .deb release already contains the systemd service. Lets revise the above and I'll submit a PR :) |
This is more for non .deb installs (eg, manual compile) |
Need to add in something about disabling serial login on RaspbeeryPi's :/ create a file called disable_serialconsole.sh
Set the script as executable and execute the file
|
Alternatively, for Raspberry Pi's only... (rPi2-4 and rPi5 compatible)
Can take it a step further and configure the rest of the vars..
Once above is done, need to reboot.
|
Closing as PR has been merged. |
Describe what section of the docs is outdated or otherwise in need of change
Linux Native Hardware
Suggested Changes
Add After "Persistence" or part of "Persistence".
https://meshtastic.org/docs/hardware/devices/linux-native-hardware/#persistence
Run Meshtastic as a service/daemon for manual compile/builds (non .deb package releases)
To Setup the device to start and stop meshtasticd as as service using systemctl you can setup the service unit using the instructions below.
Create the service unit file:
Create a new file in the /etc/systemd/system/ directory with a name like meshtasticd.service.
sudo nano /etc/systemd/system/meshtasticd.service
Add the following content to the file:
Reload systemd to recognize the new service:
sudo systemctl daemon-reload
Enable the service to start on boot:
sudo systemctl enable meshtasticd
Starting and Stopping the Service
Start the service:
sudo systemctl start meshtasticd
Check the status of the service:
sudo systemctl status meshtasticd
Stop the service:
sudo systemctl stop meshtasticd
This will give you a detailed view of the service status and any potential errors.
By following these steps, you set up a systemd service for meshtasticd that will start automatically at boot and restart if it crashes. You can manage it using the standard systemctl commands (start, stop, restart, status, etc.).
Setup Log Rotation
To setup log rotation within the Linux Native Device and do a daily restart of the Meshtastic Daemon you can implement the below.
Create a logrotate configuration file for the meshtasticd log. Create a file named /etc/logrotate.d/meshtasticd:
sudo nano /etc/logrotate.d/meshtasticd
Add the following content to the file:
Test log rotation:
Test the logrotate configuration to ensure it works as expected:
sudo logrotate -d /etc/logrotate.d/meshtasticd
If everything looks good, force a rotation to see it in action:
sudo logrotate -f /etc/logrotate.d/meshtasticd
By following these steps, you will have meshtasticd output directed to a log file with automatic log rotation configured, ensuring that your logs are managed and disk space is conserved.
The text was updated successfully, but these errors were encountered: