Systemd Setup
Running mtrack as a system service
Systemd Setup
Running mtrack as a systemd service allows it to start automatically on boot and restart if it crashes.
Generating the Service File
Generate a systemd service file:
|
|
Configuration File
The service expects your player configuration to be defined in /etc/default/mtrack:
|
|
Add:
# The configuration for the mtrack player.
MTRACK_CONFIG=/mnt/storage/mtrack.yaml
Service Requirements
The service expects:
mtrackto be available at/usr/local/bin/mtrack- Configuration file path in
/etc/default/mtrack
Starting the Service
Start the service:
|
|
Enable it to start on boot:
|
|
Service Management
Check Status
|
|
View Logs
|
|
Follow logs in real-time:
|
|
Restart Service
|
|
Stop Service
|
|
Disable Auto-Start
|
|
Troubleshooting
Service Fails to Start
Check the logs:
|
|
Common issues:
- Configuration file path incorrect
- mtrack binary not found at
/usr/local/bin/mtrack - Permission issues accessing audio/MIDI devices
- Configuration file syntax errors
Permission Issues
Ensure the service user has access to audio devices:
|
|
Device Access
If devices aren’t accessible, you may need udev rules or to run the service as a specific user. Edit the service file:
|
|
Add:
|
|
Then reload and restart:
|
|
Related Documentation
- Installation - Installing mtrack
- Configuration - Configuration reference
- Raspberry Pi Setup - Optimizing for Raspberry Pi