mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
Update service to run as root for hardware timing access
This commit is contained in:
@@ -3,19 +3,11 @@
|
|||||||
# Exit on error
|
# Exit on error
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Get the current user
|
echo "Installing LED Matrix Display Service..."
|
||||||
CURRENT_USER=$(whoami)
|
|
||||||
|
|
||||||
echo "Installing LED Matrix Display Service for user: $CURRENT_USER..."
|
|
||||||
|
|
||||||
# Copy the service file to the systemd directory
|
# Copy the service file to the systemd directory
|
||||||
sudo cp ledmatrix.service /etc/systemd/system/
|
sudo cp ledmatrix.service /etc/systemd/system/
|
||||||
|
|
||||||
# Create a systemd override to set the user
|
|
||||||
sudo mkdir -p /etc/systemd/system/ledmatrix.service.d/
|
|
||||||
echo "[Service]" | sudo tee /etc/systemd/system/ledmatrix.service.d/override.conf
|
|
||||||
echo "User=$CURRENT_USER" | sudo tee -a /etc/systemd/system/ledmatrix.service.d/override.conf
|
|
||||||
|
|
||||||
# Reload systemd to recognize the new service
|
# Reload systemd to recognize the new service
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=%i
|
User=root
|
||||||
WorkingDirectory=/home/%i/LEDMatrix
|
WorkingDirectory=/home/ledpi/LEDMatrix
|
||||||
ExecStart=/usr/bin/sudo /usr/bin/python3 /home/%i/LEDMatrix/display_controller.py
|
ExecStart=/usr/bin/python3 /home/ledpi/LEDMatrix/display_controller.py
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
StandardOutput=syslog
|
StandardOutput=syslog
|
||||||
|
|||||||
Reference in New Issue
Block a user