Skip to content

Commit

Permalink
Update README.md with guidelines for using systemctl
Browse files Browse the repository at this point in the history
  • Loading branch information
Luligu committed Sep 26, 2024
1 parent a715f5e commit d8f1876
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions README-SERVICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ sudo journalctl -u matterbridge.service -f --output cat

### Delete the logs older then 3 days (all of them not only the ones of Matterbridge!)

Check the space used
```
sudo journalctl --disk-usage
```

remove all log older then 3 days
```
sudo journalctl --rotate
sudo journalctl --vacuum-time=3d
```

Expand All @@ -115,7 +122,11 @@ sudo nano /etc/systemd/journald.conf
```
add
```
SystemMaxUse=3d
MaxRetentionSec=3days # Keep logs for a maximum of 3 days.
MaxFileSec=1day # Rotate logs daily within the 3-day retention period.
ForwardToSyslog=no # Disable forwarding to syslog to prevent duplicate logging.
SystemMaxUse=100M # Limit persistent logs in /var/log/journal to 100 MB.
RuntimeMaxUse=100M # Limit runtime logs in /run/log/journal to 100 MB.
```
save it and run
```
Expand All @@ -129,24 +140,42 @@ Run the following command to verify if you can install Matterbridge globally wit
```
sudo npm install -g matterbridge
```

If you are not prompted for a password, no further action is required.

If that is not the case, open the sudoers file for editing using visudo

```
sudo visudo
```

verify the presence of of a line

```
@includedir /etc/sudoers.d
```

exit and create a configuration file for sudoers

```
sudo nano /etc/sudoers.d/matterbridge
```

add this line replacing USER with your user name (e.g. radxa ALL=(ALL) NOPASSWD: ALL)

```
<USER> ALL=(ALL) NOPASSWD: ALL
```

or if you prefers to only give access to npm without password try (e.g. radxa ALL=(ALL) NOPASSWD: /usr/bin/npm)
or if you prefers to only give access to npm without password try with (e.g. radxa ALL=(ALL) NOPASSWD: /usr/bin/npm)

```
<USER> ALL=(ALL) NOPASSWD: /usr/bin/npm
```

save the file and restart the system.
save the file and reload the settings with:

```
sudo visudo -c
```

0 comments on commit d8f1876

Please sign in to comment.