LINUX.ORG.RU

Peertube

 


0

1

Добрый день, устанавливаю peertube на Rocky Linux по инструкции https://sevo44.ru/peertube-ustanovka-na-centos/, после, пытаюсь запустить командой systemctl enable –now peertube, появляется ошибка:

мар 22 20:46:17 localhost.localdomain peertube[70454]:     at Module._compile (internal/modules/cjs/loader.js:1085:14)
мар 22 20:46:17 localhost.localdomain systemd[1]: peertube.service: Main process exited, code=exited, status=1/FAILURE
мар 22 20:46:17 localhost.localdomain systemd[1]: peertube.service: Failed with result 'exit-code'.
мар 22 20:46:17 localhost.localdomain systemd[1]: peertube.service: Service RestartSec=100ms expired, scheduling restart.
мар 22 20:46:17 localhost.localdomain systemd[1]: peertube.service: Scheduled restart job, restart counter is at 5.
мар 22 20:46:17 localhost.localdomain systemd[1]: Stopped PeerTube daemon.
мар 22 20:46:17 localhost.localdomain systemd[1]: peertube.service: Start request repeated too quickly.
мар 22 20:46:17 localhost.localdomain systemd[1]: peertube.service: Failed with result 'exit-code'.
мар 22 20:46:17 localhost.localdomain systemd[1]: Failed to start PeerTube daemon.

В чём проблема, что ему не нравится?



Последнее исправление: xaizek (всего исправлений: 1)

Ответ на: комментарий от Dimez

Started PeerTube daemon. peertube.service: Main process exited, code=exited, status=200/CHDIR peertube.service: Failed with result ‘exit-code’. peertube.service: Service RestartSec=100ms expired, scheduling restart. peertube.service: Scheduled restart job, restart counter is at 2. Stopped PeerTube daemon. Started PeerTube daemon. peertube.service: Main process exited, code=exited, status=200/CHDIR peertube.service: Failed with result ‘exit-code’. peertube.service: Service RestartSec=100ms expired, scheduling restart. peertube.service: Scheduled restart job, restart counter is at 3. Stopped PeerTube daemon. Started PeerTube daemon. peertube.service: Main process exited, code=exited, status=200/CHDIR peertube.service: Failed with result ‘exit-code’. peertube.service: Service RestartSec=100ms expired, scheduling restart. peertube.service: Scheduled restart job, restart counter is at 4. Stopped PeerTube daemon. Started PeerTube daemon. peertube.service: Main process exited, code=exited, status=200/CHDIR peertube.service: Failed with result ‘exit-code’. peertube.service: Service RestartSec=100ms expired, scheduling restart. peertube.service: Scheduled restart job, restart counter is at 5. Stopped PeerTube daemon. peertube.service: Start request repeated too quickly. peertube.service: Failed with result ‘exit-code’. Failed to start PeerTube daemon.

Файл логов nginx пустой

bogkronas
() автор топика
Последнее исправление: bogkronas (всего исправлений: 1)
Ответ на: комментарий от Legioner

Started PeerTube daemon. peertube.service: Main process exited, code=exited, status=200/CHDIR peertube.service: Failed with result ‘exit-code’. peertube.service: Service RestartSec=100ms expired, scheduling restart. peertube.service: Scheduled restart job, restart counter is at 1. Stopped PeerTube daemon. Started PeerTube daemon. peertube.service: Changing to the requested working directory failed: Permission denied peertube.service: Failed at step CHDIR spawning /usr/bin/node: Permission denied peertube.service: Main process exited, code=exited, status=200/CHDIR peertube.service: Failed with result ‘exit-code’. peertube.service: Service RestartSec=100ms expired, scheduling restart. peertube.service: Scheduled restart job, restart counter is at 2. Stopped PeerTube daemon. Started PeerTube daemon. peertube.service: Main process exited, code=exited, status=200/CHDIR peertube.service: Failed with result ‘exit-code’. peertube.service: Service RestartSec=100ms expired, scheduling restart. peertube.service: Scheduled restart job, restart counter is at 3. Stopped PeerTube daemon. Started PeerTube daemon. peertube.service: Main process exited, code=exited, status=200/CHDIR peertube.service: Failed with result ‘exit-code’.

bogkronas
() автор топика
Ответ на: комментарий от Legioner
cat /etc/systemd/system/peertube.service
=== Вывод команды ===
[Unit]
Description=PeerTube daemon
After=network.target postgresql.service redis-server.service

[Service]
Type=simple
Environment=NODE_ENV=production
Environment=NODE_CONFIG_DIR=/var/www/peertube/config
User=peertube
Group=peertube
ExecStart=/usr/bin/npm start
WorkingDirectory=/var/www/peertube/peertube-latest
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=peertube
Restart=always

; Some security directives.
; Mount /usr, /boot, and /etc as read-only for processes invoked by this service.
ProtectSystem=full
; Sets up a new /dev mount for the process and only adds API pseudo devices
; like /dev/null, /dev/zero or /dev/random but not physical devices. Disabled
; by default because it may not work on devices like the Raspberry Pi.
PrivateDevices=false
; Ensures that the service process and all its children can never gain new
; privileges through execve().
NoNewPrivileges=true
; This makes /home, /root, and /run/user inaccessible and empty for processes invoked
; by this unit. Make sure that you do not depend on data inside these folders.
ProtectHome=true
; Drops the sys admin capability from the daemon.
CapabilityBoundingSet=~CAP_SYS_ADMIN

[Install]
WantedBy=multi-user.target
bogkronas
() автор топика
Последнее исправление: bogkronas (всего исправлений: 1)
Ответ на: комментарий от Legioner
[root@localhost peertube]# ls -la /var/www/peertube
итого 20
drwx------. 6 peertube peertube 177 мар 24 21:55 .
drwxr-xr-x. 3 root     root      22 мар 24 20:46 ..
-rw-r--r--. 1 peertube peertube  18 июл 27  2021 .bash_logout
-rw-r--r--. 1 peertube peertube 141 июл 27  2021 .bash_profile
-rw-r--r--. 1 peertube peertube 376 июл 27  2021 .bashrc
drwxr-xr-x. 3 peertube peertube  18 мар 24 21:55 .cache
drwxr-x---. 2 peertube peertube  29 мар 24 21:58 config
lrwxrwxrwx. 1 peertube peertube  24 мар 24 21:55 peertube-latest -> versions/peertube-v4.1.1
drwxr-xr-x. 2 peertube peertube   6 мар 24 21:29 storage
drwxr-xr-x. 3 peertube peertube  29 мар 24 21:55 versions
-rw-r--r--. 1 peertube peertube 165 мар 24 21:48 .wget-hsts
-rw-r--r--. 1 peertube peertube 116 мар 24 21:55 .yarnrc
________________________________________________________
[root@localhost peertube]# ls -la /var/www/peertube/config
итого 24
drwxr-x---. 2 peertube peertube    29 мар 24 21:58 .
drwx------. 6 peertube peertube   177 мар 24 21:55 ..
-rw-r--r--. 1 peertube peertube 22372 мар 24 21:59 production.yaml
________________________________________________________

[root@localhost peertube]# ls -la /var/www/peertube/peertube-latest
lrwxrwxrwx. 1 peertube peertube 24 мар 24 21:55 /var/www/peertube/peertube-latest -> versions/peertube-v4.1.1


bogkronas
() автор топика
Ответ на: комментарий от Legioner
[root@localhost peertube]# systemctl status peertube.service
● peertube.service - PeerTube daemon
   Loaded: loaded (/etc/systemd/system/peertube.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2022-03-24 22:10:15 +07; 9min ago
  Process: 72360 ExecStart=/usr/bin/node dist/server (code=exited, status=200/CHDIR)
 Main PID: 72360 (code=exited, status=200/CHDIR)

мар 24 22:10:15 localhost.localdomain systemd[1]: peertube.service: Main process exited, code=exited, status=200/CHDIR
мар 24 22:10:15 localhost.localdomain systemd[1]: peertube.service: Failed with result 'exit-code'.
мар 24 22:10:15 localhost.localdomain systemd[1]: peertube.service: Service RestartSec=100ms expired, scheduling restart.
мар 24 22:10:15 localhost.localdomain systemd[1]: peertube.service: Scheduled restart job, restart counter is at 5.
мар 24 22:10:15 localhost.localdomain systemd[1]: Stopped PeerTube daemon.
мар 24 22:10:15 localhost.localdomain systemd[1]: peertube.service: Start request repeated too quickly.
мар 24 22:10:15 localhost.localdomain systemd[1]: peertube.service: Failed with result 'exit-code'.
мар 24 22:10:15 localhost.localdomain systemd[1]: Failed to start PeerTube daemon.


bogkronas
() автор топика
Ответ на: комментарий от tolstoevsky
Mar 24 22:54:50 localhost setroubleshoot[73363]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest.#0                                                                                          12#012*****  Plugin catchall (100. confidence) suggests   **************************#012#012If you believe that systemd should be allowed read acce                                                                                          ss on the peertube-latest lnk_file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this acc                                                                                          ess.#012Do#012allow this access for now by executing:#012# ausearch -c '(node)' --raw | audit2allow -M my-node#012# semodule -X 300 -i my-node.pp#0                                                                                          12
Mar 24 22:54:58 localhost setroubleshoot[73363]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest. F                                                                                          or complete SELinux messages run: sealert -l 7f335316-27f0-4850-b797-4a3f74c693c7
Mar 24 22:54:58 localhost setroubleshoot[73363]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest.#0                                                                                          12#012*****  Plugin catchall (100. confidence) suggests   **************************#012#012If you believe that systemd should be allowed read acce                                                                                          ss on the peertube-latest lnk_file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this acc                                                                                          ess.#012Do#012allow this access for now by executing:#012# ausearch -c '(node)' --raw | audit2allow -M my-node#012# semodule -X 300 -i my-node.pp#0                                                                                          12
Mar 24 22:55:23 localhost setroubleshoot[73405]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest. F                                                                                          or complete SELinux messages run: sealert -l 7f335316-27f0-4850-b797-4a3f74c693c7
Mar 24 22:55:23 localhost setroubleshoot[73405]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest.#0                                                                                          12#012*****  Plugin catchall (100. confidence) suggests   **************************#012#012If you believe that systemd should be allowed read acce                                                                                          ss on the peertube-latest lnk_file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this acc                                                                                          ess.#012Do#012allow this access for now by executing:#012# ausearch -c '(node)' --raw | audit2allow -M my-node#012# semodule -X 300 -i my-node.pp#0                                                                                          12

bogkronas
() автор топика
Ответ на: комментарий от bogkronas
Mar 24 22:59:01 localhost systemd[73470]: peertube.service: Changing to the requested working directory failed: Permission denied
Mar 24 22:59:01 localhost systemd[73470]: peertube.service: Failed at step CHDIR spawning /usr/bin/npm: Permission denied
Mar 24 22:59:01 localhost systemd[1]: peertube.service: Main process exited, code=exited, status=200/CHDIR
Mar 24 22:59:01 localhost systemd[1]: peertube.service: Failed with result 'exit-code'.
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Service RestartSec=100ms expired, scheduling restart.
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Scheduled restart job, restart counter is at 1.
Mar 24 22:59:02 localhost systemd[73472]: peertube.service: Changing to the requested working directory failed: Permission denied
Mar 24 22:59:02 localhost systemd[73472]: peertube.service: Failed at step CHDIR spawning /usr/bin/npm: Permission denied
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Main process exited, code=exited, status=200/CHDIR
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Failed with result 'exit-code'.
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Service RestartSec=100ms expired, scheduling restart.
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Scheduled restart job, restart counter is at 2.
Mar 24 22:59:02 localhost systemd[73476]: peertube.service: Changing to the requested working directory failed: Permission denied
Mar 24 22:59:02 localhost systemd[73476]: peertube.service: Failed at step CHDIR spawning /usr/bin/npm: Permission denied
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Main process exited, code=exited, status=200/CHDIR
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Failed with result 'exit-code'.
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Service RestartSec=100ms expired, scheduling restart.
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Scheduled restart job, restart counter is at 3.
Mar 24 22:59:02 localhost systemd[73480]: peertube.service: Changing to the requested working directory failed: Permission denied
Mar 24 22:59:02 localhost systemd[73480]: peertube.service: Failed at step CHDIR spawning /usr/bin/npm: Permission denied
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Main process exited, code=exited, status=200/CHDIR
Mar 24 22:59:02 localhost systemd[1]: peertube.service: Failed with result 'exit-code'.
Mar 24 22:59:03 localhost systemd[1]: peertube.service: Service RestartSec=100ms expired, scheduling restart.
Mar 24 22:59:03 localhost systemd[1]: peertube.service: Scheduled restart job, restart counter is at 4.
Mar 24 22:59:03 localhost systemd[73482]: peertube.service: Changing to the requested working directory failed: Permission denied
Mar 24 22:59:03 localhost systemd[73482]: peertube.service: Failed at step CHDIR spawning /usr/bin/npm: Permission denied
Mar 24 22:59:03 localhost systemd[1]: peertube.service: Main process exited, code=exited, status=200/CHDIR
Mar 24 22:59:03 localhost systemd[1]: peertube.service: Failed with result 'exit-code'.
Mar 24 22:59:03 localhost systemd[1]: peertube.service: Service RestartSec=100ms expired, scheduling restart.
Mar 24 22:59:03 localhost systemd[1]: peertube.service: Scheduled restart job, restart counter is at 5.
Mar 24 22:59:03 localhost systemd[1]: peertube.service: Start request repeated too quickly.
Mar 24 22:59:03 localhost systemd[1]: peertube.service: Failed with result 'exit-code'.
Mar 24 22:59:04 localhost setroubleshoot[73474]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest. F                                                                                          or complete SELinux messages run: sealert -l 7f335316-27f0-4850-b797-4a3f74c693c7
bogkronas
() автор топика
Ответ на: комментарий от bogkronas

Сильно много текста, раздели на 3 сообщения

Mar 24 22:59:59 localhost setroubleshoot[73580]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest.#0                                                                                          12#012*****  Plugin catchall (100. confidence) suggests   **************************#012#012If you believe that systemd should be allowed read acce                                                                                          ss on the peertube-latest lnk_file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this acc                                                                                          ess.#012Do#012allow this access for now by executing:#012# ausearch -c '(node)' --raw | audit2allow -M my-node#012# semodule -X 300 -i my-node.pp#0                                                                                          12
Mar 24 22:59:59 localhost setroubleshoot[73580]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest. F                                                                                          or complete SELinux messages run: sealert -l 7f335316-27f0-4850-b797-4a3f74c693c7
Mar 24 22:59:59 localhost setroubleshoot[73580]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest.#0                                                                                          12#012*****  Plugin catchall (100. confidence) suggests   **************************#012#012If you believe that systemd should be allowed read acce                                                                                          ss on the peertube-latest lnk_file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this acc                                                                                          ess.#012Do#012allow this access for now by executing:#012# ausearch -c '(node)' --raw | audit2allow -M my-node#012# semodule -X 300 -i my-node.pp#0                                                                                          12
Mar 24 22:59:59 localhost setroubleshoot[73580]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest. F                                                                                          or complete SELinux messages run: sealert -l 7f335316-27f0-4850-b797-4a3f74c693c7
Mar 24 22:59:59 localhost setroubleshoot[73580]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest.#0                                                                                          12#012*****  Plugin catchall (100. confidence) suggests   **************************#012#012If you believe that systemd should be allowed read acce                                                                                          ss on the peertube-latest lnk_file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this acc                                                                                          ess.#012Do#012allow this access for now by executing:#012# ausearch -c '(node)' --raw | audit2allow -M my-node#012# semodule -X 300 -i my-node.pp#0                                                                                          12
Mar 24 23:00:01 localhost setroubleshoot[73580]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest. F                                                                                          or complete SELinux messages run: sealert -l 7f335316-27f0-4850-b797-4a3f74c693c7
Mar 24 23:00:01 localhost setroubleshoot[73580]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest.#0                                                                                          12#012*****  Plugin catchall (100. confidence) suggests   **************************#012#012If you believe that systemd should be allowed read acce                                                                                          ss on the peertube-latest lnk_file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this acc                                                                                          ess.#012Do#012allow this access for now by executing:#012# ausearch -c '(node)' --raw | audit2allow -M my-node#012# semodule -X 300 -i my-node.pp#0                                                                                          12
Mar 24 23:00:01 localhost setroubleshoot[73580]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest. F                                                                                          or complete SELinux messages run: sealert -l 7f335316-27f0-4850-b797-4a3f74c693c7
Mar 24 23:00:01 localhost setroubleshoot[73580]: SELinux is preventing /usr/lib/systemd/systemd from read access on the lnk_file peertube-latest.#0                                                                                          12#012*****  Plugin catchall (100. confidence) suggests   **************************#012#012If you believe that systemd should be allowed read acce                                                                                          ss on the peertube-latest lnk_file by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this acc                                                                                          ess.#012Do#012allow this access for now by executing:#012# ausearch -c '(node)' --raw | audit2allow -M my-node#012# semodule -X 300 -i my-node.pp#0                                                                                          12
bogkronas
() автор топика
Ответ на: комментарий от bogkronas

Проверь права доступа к файлам пиртьюба и владельца оных, и, ежели с ними всё ок, надо разбираться с selinux (либо вовсе отключить оный…)

tolstoevsky
()
Ответ на: комментарий от tolstoevsky

Mar 24 23:00:01 localhost setroubleshoot[73580]: SELinux is preventing
/usr/lib/systemd/systemd from read access on the lnk_file peertube-latest

А, ну да. Настрой или выруби селинух.

tolstoevsky
()
Ответ на: комментарий от bogkronas

Надо отредактировать /etc/selinux/config и установить там SELINUX=disabled. После этого надо перезагрузиться. Это несколько ослабит безопасность. Для более вдумчивой настройки нужно разбираться с selinux, можешь сам попробовать.

Перед этим на всякий случай попробуй просто перезагрузиться и проверить, не заработает ли.

Legioner ★★★★★
()
Последнее исправление: Legioner (всего исправлений: 1)
Ответ на: комментарий от tolstoevsky

по совету выше, Legioner , я проверил, вроде все файлы от пиртуба, отключил selinux, демон стартанул, я думаю проблема доступа к /usr/bin, есть ли смысл добавить юзера пиртуб в группу root?

bogkronas
() автор топика
Ответ на: комментарий от Legioner

После этого надо перезагрузиться.

setenforce 0 и можно не ребутать

tolstoevsky
()
Ответ на: комментарий от bogkronas

есть ли смысл добавить юзера пиртуб в группу root?

нет.

И проблема с правами, скорее всего, именно к файликам.

У меня как-то так:

drwxrwxr-x  2 peertube peertube 4096 Feb 17 10:31 config
lrwxrwxrwx  1 peertube peertube   24 Feb 17 09:44 peertube-latest -> versions/peertube-v4.0.0
drwxrwxr-x 15 peertube peertube 4096 Mar 11 01:12 storage
drwxr-xr-x  3 peertube peertube 4096 Feb 17 09:43 versions

tolstoevsky
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.