Автор Тема: Помогите Победить Python-а (установка Motion Eye)  (Прочитано 775 раз)

Оффлайн San

  • Участник
  • *
  • Сообщений: 732
Доброго времени суток!

Испытываю MotionEye. Столкнулся с проблемой. После установки не могу запустить, ни программу, ни службу:
..
Successfully built motioneye tornado
Installing collected packages: tornado, motioneye
  Attempting uninstall: tornado
    Found existing installation: tornado 6.3.2
    Uninstalling tornado-6.3.2:
      Successfully uninstalled tornado-6.3.2
Successfully installed motioneye-0.42.1 tornado-5.1.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
# mkdir -p /etc/motioneye
# cp /usr/local/share/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf
# mkdir -p /var/lib/motioneye
# cp /usr/local/share/motioneye/extra/motioneye.init-debian /etc/init.d/motioneye
# chmod +x /etc/init.d/motioneye
# update-rc.d -f motioneye defaults
-bash: update-rc.d: команда не найдена

# /etc/init.d/motioneye start
/etc/init.d/motioneye: строка 23: /lib/lsb/init-functions: Нет такого файла или каталога
# meyectl startserver -c /etc/motioneye/motioneye.conf
Traceback (most recent call last):
  File "/usr/local/bin/meyectl", line 5, in <module>
    from motioneye.meyectl import main
  File "/usr/local/lib/python3/site-packages/motioneye/meyectl.py", line 28, in <module>
    import settings
ModuleNotFoundError: No module named 'settings'
[root@host-15 init.d]# service motioneye status
/etc/init.d/motioneye: строка 23: /lib/lsb/init-functions: Нет такого файла или каталога
#

Файл /etc/init.d/motioneye в строке 23 ссылается на /lib/lsb/init-functions...

# cat /etc/init.d/motioneye
#!/bin/sh -e
#
# /etc/init.d/motioneye: Start the motionEye server
#
### BEGIN INIT INFO
# Provides:      motioneye
# Required-Start: $local_fs $syslog $remote_fs
# Required-Stop: $remote_fs
# Default-Start:  2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the motionEye server
# Description: Start the motionEye server
### END INIT INFO

NAME="motioneye"
PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
DAEMON="/usr/local/bin/meyectl"
PIDFILE="/var/run/$NAME.pid"
DESC="motionEye server"
USER="root"
OPTIONS="startserver -c /etc/motioneye/motioneye.conf -l -b"

. /lib/lsb/init-functions

test -x $DAEMON || exit 0

RET=0

case "$1" in
    start)
        log_daemon_msg "Starting $DESC"
        if start-stop-daemon --start --oknodo --exec $DAEMON --chuid $USER -- $OPTIONS; then
            log_end_msg 0
        else
            log_end_msg 1
            RET=1
        fi
        ;;

    stop)
        log_daemon_msg "Stopping $DESC"
        if start-stop-daemon --stop --oknodo --pidfile $PIDFILE --retry 5; then
            log_end_msg 0
        else
            log_end_msg 1
            RET=1
        fi
        ;;

    restart|force-reload)
        log_action_begin_msg "Restarting $DESC"
        if $0 stop && $0 start; then
            log_action_end_msg 0
        else
            log_action_cont_msg "(failed)"
            RET=1
        fi
        ;;

    status)
        status_of_proc $DAEMON $NAME
        ;;

    *)
        echo "Usage: /etc/init.d/$NAME {start|stop|restart|status}"
        RET=1
        ;;
esac

exit $RET

#


...Но кто такой Этот /lib/lsb/init-functions понять не могу??? Подскажите, Пожалуйста!

# find / -name "*init-functions*" -print
# find / -name "init-functions" -print
# chkconfig --list motioneye
сервис motioneye поддерживает chkconfig, но не используется ни на одном уровне выполнения (запустите 'chkconfig --add motioneye')
# chkconfig --add motioneye
# chkconfig --list motioneye
motioneye       0:выкл  1:выкл  2:вкл   3:вкл   4:вкл   5:вкл   6:выкл
# chkconfig motioneye on
# service motioneye start
/etc/init.d/motioneye: строка 23: /lib/lsb/init-functions: Нет такого файла или каталога
# service motioneye status
/etc/init.d/motioneye: строка 23: /lib/lsb/init-functions: Нет такого файла или каталога
#
« Последнее редактирование: 03.01.2025 18:04:15 от sb »

Оффлайн San

  • Участник
  • *
  • Сообщений: 732
Re: Помогите Победить Python-а
« Ответ #1 : 03.01.2025 13:52:38 »
Совсем забыл!!!

# cat /etc/os-release
NAME="starter kit"
VERSION="10"
ID=altlinux
VERSION_ID=10
PRETTY_NAME="ALT Starterkit 10 (Hypericum)"
ANSI_COLOR="1;33"
CPE_NAME="cpe:/o:alt:starterkit:10"
BUILD_ID="starter kit p10 (Hypericum)"
ALT_BRANCH_ID="p10"
HOME_URL="http://en.altlinux.org/starterkits"
BUG_REPORT_URL="https://bugs.altlinux.org/"
LOGO=altlinux
# uname -a
Linux host-15 5.10.231-std-def-alt1 #1 SMP Sat Dec 28 09:38:51 UTC 2024 x86_64 GNU/Linux
# python3 --version
Python 3.9.20
# python2 --version
Python 2.7.18

Оффлайн rits

  • Участник
  • *
  • Сообщений: 1 182
  • ITS
Re: Помогите Победить Python-а
« Ответ #2 : 03.01.2025 15:01:05 »
# apt-get -d install lsb-init
# rpm -qpl /var/cache/apt/archives/lsb-init_5.0-alt1%3ap10+282288.500.1.1@1628503239_noarch.rpm
Цитировать
/etc/altlinux-lsb
/etc/altlinux-lsb/color_message
/etc/altlinux-lsb/lsb_log_message
/lib/lsb
/lib/lsb/copyright
/lib/lsb/init-functions
/usr/share/doc/lsb-init-5.0
/usr/share/doc/lsb-init-5.0/copyright
/usr/share/doc/lsb-init-5.0/test-initscript.sh

Оффлайн rits

  • Участник
  • *
  • Сообщений: 1 182
  • ITS
Re: Помогите Победить Python-а
« Ответ #3 : 03.01.2025 15:16:11 »
 # apt-cache search -- settings | grep -E -i --color -- "(settings)"
python-module-ethtool - Ethernet settings python bindings
python3-module-ethtool - Ethernet settings python bindings
i586-python-module-ethtool - Ethernet settings python bindings
i586-python3-module-ethtool - Ethernet settings python bindings
python3-module-mackup - Keep your application settings in sync
python3-module-plaster - Application configuration settings abstraction layer
python3-module-usersettings - Portable Local Settings Storage
python3-module-yamlsettings - Yaml Settings Configuration Module

я не силен в питоне, но как мне кажется, модуль settings, либо должен быть в одном из пакетов репозитория, либо находится в самом пакете motioneye, который нужно правильно установить по "правильным" местам и с нужными правами.

Оффлайн San

  • Участник
  • *
  • Сообщений: 732
Re: Помогите Победить Python-а
« Ответ #4 : 03.01.2025 15:18:36 »
Файл /lib/lsb/init-functions Нашли, но костыли еще есть! (Продолжаются) Ими я завтра займусь, ужу голова пухнет...
# service motioneye restart
Restarting motionEye server...Stopping motionEye server:No process in pidfile `/var/run/motioneye.pid' found running; none killed.
.                                                                       [ DONE ]
Starting motionEye server:Traceback (most recent call last):
  File "/usr/local/bin/meyectl", line 5, in <module>
    from motioneye.meyectl import main
  File "/usr/local/lib/python3/site-packages/motioneye/meyectl.py", line 28, in <module>
    import settings
ModuleNotFoundError: No module named 'settings'
.                                                                       [FAILED]
(failed)...
#

Оффлайн San

  • Участник
  • *
  • Сообщений: 732
Re: Помогите Победить Python-а
« Ответ #5 : 03.01.2025 15:20:01 »
который нужно правильно установить по "правильным" местам и с нужными правами.
Спасибо! Завтра буду права и места просматривать!
# apt-cache search -- settings | grep -E -i --color -- "(settings)"
Код: [Выделить]
Ни одного нет? Сейчас с Убунтой сравню... На ней я MotionEye запустил...
# rpm -qa | grep python3-module-ethtool
# rpm -qa | grep python3-module-mackup
# rpm -qa | grep python3-module-plaster
# rpm -qa | grep python3-module-usersettings
# rpm -qa | grep python3-module-yamlsettings
« Последнее редактирование: 03.01.2025 15:33:12 от San »

Оффлайн San

  • Участник
  • *
  • Сообщений: 732
В общем, начитавшись умных забугорных форумов, про то что MotionEye не работает на Третьем Питоне (Отсюда, кстати и был рожден Топик!!! Второй Питон установить Дюже сложно, а программа третий не понимает...) Провел день в установке Второго Питона и MotionEye...
...
Successfully built motioneye tornado
Installing collected packages: tornado, pycurl, pillow, MarkupSafe, jinja2, motioneye
Successfully installed MarkupSafe-3.0.2 jinja2-3.1.5 motioneye-0.42.1 pillow-11.1.0 pycurl-7.45.4 tornado-5.1.1
...

Однако проблема осталась прежней!

# echo $PYTHONPATH
/usr/bin/python2
# service motioneye start
Starting motionEye server:Traceback (most recent call last):
  File "/usr/local/bin/meyectl", line 5, in <module>
    from motioneye.meyectl import main
  File "/usr/local/lib/python3/site-packages/motioneye/meyectl.py", line 28, in <module>
    import settings
ModuleNotFoundError: No module named 'settings'
.                                                                       [FAILED]

# find / -name "meyectl.py" -print
/usr/local/lib/python3/site-packages/motioneye/meyectl.py
# mcedit /usr/local/bin/meyectl
# find / -name "motioneye.meyectl" -print
#

Что за motioneye.meyectl в пятой строке Файла "/usr/local/bin/meyectl"

И Откуда ему взять Файл "/usr/local/lib/python3/site-packages/motioneye/meyectl.py" От второго Питона? Может он что не дотягивает? Какую то зависимость?