Skip to content

Commit

Permalink
remove hardwired path. replace during installation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Nov 15, 2023
1 parent f14c66a commit a2a28fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion installation/includes/00_constants.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RPI_BOOT_CONFIG_FILE="/boot/config.txt"
SHARED_PATH="${INSTALLATION_PATH}/shared"
SETTINGS_PATH="${SHARED_PATH}/settings"
SYSTEMD_USR_PATH="/usr/lib/systemd/user/"
SYSTEMD_USR_PATH="/usr/lib/systemd/user"

# The default upstream user, release branch, and develop branch
# These are used to prepare the repo for developers
Expand Down
7 changes: 5 additions & 2 deletions installation/routines/setup_jukebox_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,11 @@ _jukebox_core_install_settings() {

_jukebox_core_register_as_service() {
echo " Register Jukebox Core user service"
sudo cp -f "${INSTALLATION_PATH}/resources/default-services/jukebox-daemon.service" "${SYSTEMD_USR_PATH}"
sudo chmod 644 "${SYSTEMD_USR_PATH}/jukebox-daemon.service"

local jukebox_service="${SYSTEMD_USR_PATH}/jukebox-daemon.service"
sudo cp -f "${INSTALLATION_PATH}/resources/default-services/jukebox-daemon.service" "${jukebox_service}"
sudo sed -i "s|%%INSTALLATION_PATH%%|${INSTALLATION_PATH}|g" "${jukebox_service}"
sudo chmod 644 "${jukebox_service}"

systemctl --user daemon-reload
systemctl --user enable jukebox-daemon.service
Expand Down
4 changes: 2 additions & 2 deletions resources/default-services/jukebox-daemon.service
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ After=network.target sound.target mpd.service pulseaudio.service
Requires=mpd.service pulseaudio.service

[Service]
WorkingDirectory=/home/pi/RPi-Jukebox-RFID/src/jukebox
ExecStart=/bin/bash -c 'source /home/pi/RPi-Jukebox-RFID/.venv/bin/activate && python run_jukebox.py'
WorkingDirectory=%%INSTALLATION_PATH%%/src/jukebox
ExecStart=/bin/bash -c 'source %%INSTALLATION_PATH%%/.venv/bin/activate && python run_jukebox.py'
StandardOutput=inherit
StandardError=inherit
Restart=always
Expand Down

0 comments on commit a2a28fe

Please sign in to comment.