48 lines
865 B
Markdown
48 lines
865 B
Markdown
|
# garage
|
||
|
|
||
|
## Dependencies
|
||
|
```
|
||
|
sudo raspi-config nonint do_spi 0
|
||
|
sudo apt install python3-pip python3-dev python3-spidev
|
||
|
sudo pip3 install unicornhathd
|
||
|
```
|
||
|
|
||
|
## Configuration
|
||
|
```
|
||
|
cp garage.sample.cfg garage.cfg
|
||
|
```
|
||
|
|
||
|
## Installation
|
||
|
```
|
||
|
sudo ./install
|
||
|
```
|
||
|
|
||
|
## Output
|
||
|
By default output will be in `/var/log/syslog`.
|
||
|
A separate log file can be used by creating `/etc/rsyslog.d/30-garage.conf` containing:
|
||
|
```
|
||
|
if $programname == 'garage' then /var/log/garage.log
|
||
|
& stop
|
||
|
```
|
||
|
and then restart the rsyslog service:
|
||
|
```
|
||
|
sudo systemctl restart rsyslog
|
||
|
```
|
||
|
This log file can be rotated by creating `/etc/logrotate.d/garage` containing:
|
||
|
```
|
||
|
/var/log/garage.log
|
||
|
{
|
||
|
rotate 14
|
||
|
daily
|
||
|
create
|
||
|
missingok
|
||
|
notifempty
|
||
|
compress
|
||
|
delaycompress
|
||
|
postrotate
|
||
|
/usr/lib/rsyslog/rsyslog-rotate
|
||
|
endscript
|
||
|
}
|
||
|
|
||
|
```
|