Skip to content

Commit

Permalink
init: adjust meyectl path if needed
Browse files Browse the repository at this point in the history
On Arch Linux, pip seems to not install Python modules/executables to /usr/local/bin but /usr/bin instead. In such cases, search the meyectl path in PATH and adjust the systemd service. Print an error if it could not be found at all.

Fixes: #3005

Signed-off-by: MichaIng <[email protected]>
  • Loading branch information
MichaIng committed Jun 17, 2024
1 parent 85162d5 commit 2a7da4f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions motioneye/extra/linux_init
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,17 @@ chown -R motion:motion /etc/motioneye

# Install service
cp extra/motioneye.systemd /etc/systemd/system/motioneye.service
# - Update meyectl path if expected /usr/local/bin/meyectl does not exist, found on Arch Linux: https://github.com/motioneye-project/motioneye/issues/3005
if [[ ! -f '/usr/local/bin/meyectl' ]]
then
meyectl_path=$(command -v meyectl)
if [[ $meyectl_path ]]
then
echo "Using $meyectl_path for systemd service"
sed -i "s|^ExecStart=/usr/local/bin/meyectl|ExecStart=$meyectl_path|" /etc/systemd/system/motioneye.service
else
echo 'ERROR: meyectl executable has not been found. systemd service will fail to start. Please check your motionEye installation.'
fi
fi
systemctl daemon-reload
systemctl enable --now motioneye

0 comments on commit 2a7da4f

Please sign in to comment.