etherpad-lite als etherpad

Mardor

Well-Known Member
Hallo,

ich habe heute etherpad-lite (node, npm, git + git clone) installiert. Danach einen neuen User angelegt:

Code:
pw adduser etherpad -d /nonexistent -s /usr/sbin/nologin -c "Etherpad user"

Nun würde ich etherpad gerne im ersten Schritt einmal starten und im zweiten Schritt etherpad-lite generell beim Systemstart mitstarten. Leider gelingt mir der Start überhaupt nicht.

Code:
su -m etherpad -c 'bin/run.sh'
Copy the settings template to settings.json...
Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.
Error: EACCES: permission denied, scandir '/usr/local/www/etherpad-lite/src'
    at Error (native)

Ensure jQuery is downloaded and up to date...
Clearing minified cache...
Ensure custom css/js files are created...
Started Etherpad...
module.js:339
    throw err;
    ^

Error: Cannot find module '/usr/local/www/etherpad-lite/node_modules/ep_etherpad-lite/node/server.js'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:134:18)
    at node.js:961:3

Ich habe auch weitere Tests durchgeführt allerdings ohne Erfolg.
Hätte jemand von euch einen Tipp ?

Gruß Mardor
 
Hallo,

eventuell ist dies noch wichtig:

Starte ich etherpad-lite als root so funktioniert alles

Code:
>> bin/run.sh --root
Ensure that all dependencies are up to date...  If this is the first time you have run Etherpad please be patient.
npm WARN package.json ep_etherpad-lite@1.5.7 No license field.
Ensure jQuery is downloaded and up to date...
Clearing minified cache...
Ensure custom css/js files are created...
Started Etherpad...
[2015-10-30 22:43:30.285] [WARN] console - DirtyDB is used. This is fine for testing but not recommended for production.
[2015-10-30 22:43:32.588] [INFO] console - Installed plugins:
[2015-10-30 22:43:32.598] [INFO] console - Report bugs at https://github.com/ether/etherpad-lite/issues
[2015-10-30 22:43:32.600] [INFO] console - Your Etherpad version is 1.5.7 (ba1f9c2)
[2015-10-30 22:43:32.891] [INFO] console - You can access your Etherpad instance at http://0.0.0.0:9001/
[2015-10-30 22:43:32.892] [WARN] console - Admin username and password not set in settings.json.  To access admin please uncomment and edit 'users' in settings.json

Gruß Mardor
 
Hat der Benutzer etherpad denn überhaupt die nötigen Rechte für das Verzeichnis? Ist er sein Besitzer?
 
Hallo CrimsonKing,

ja ich habe mit chown -R etherpad:etherpad alle Rechte umgestellt.

Code:
drwxr-x---  8 root      wheel      512B Oct 30 20:33 .git
-rw-r-----  1 root      wheel      273B Oct 30 20:33 .gitignore
-rw-r-----  1 root      wheel      740B Oct 30 20:33 .travis.yml
-rw-r-----  1 root      etherpad    64B Oct 30 22:41 APIKEY.txt
-rw-r-----  1 etherpad  etherpad    19K Oct 30 20:33 CHANGELOG.md
-rw-r-----  1 etherpad  etherpad   5.2K Oct 30 20:33 CONTRIBUTING.md
-rw-r-----  1 etherpad  etherpad    11K Oct 30 20:33 LICENSE
-rw-r-----  1 etherpad  etherpad   632B Oct 30 20:33 Makefile
-rw-r-----  1 etherpad  etherpad   6.9K Oct 30 20:33 README.md
-rw-r-----  1 root      etherpad    64B Oct 30 22:41 SESSIONKEY.txt
drwxr-x---  4 etherpad  etherpad   1.0K Oct 30 20:33 bin
drwxr-x---  5 etherpad  etherpad   512B Oct 30 20:33 doc
drwxr-x---  2 etherpad  etherpad   512B Oct 30 22:31 node_modules
-rw-r-----  1 etherpad  etherpad   6.8K Oct 30 22:31 settings.json
-rw-r-----  1 etherpad  etherpad   6.8K Oct 30 20:33 settings.json.template
drwxr-x---  7 etherpad  etherpad   512B Oct 30 22:41 src
-rw-r-----  1 etherpad  etherpad    49B Oct 30 20:33 start.bat
drwxr-x---  4 etherpad  etherpad   512B Oct 30 20:33 tests
drwxr-x---  2 etherpad  etherpad   512B Oct 30 22:41 var

Grus Mardor
 
Hallo,

du hast Recht, ich versteh nicht wie ich dies übersehen konnte. Vielen Dank für deinen Hinweis.
Ich habe die Rechte nochmals gesetzt und jetzt funktioniert der einmalige Aufruf.

Wie würde ich denn dies Einbinden um etherpad durchgehend unter dem Etherpad User laufen zu lassen ?

Gruß Mardor
 
Ich hab da mal ein rc Skript für erstellt:
Code:
#! /bin/sh
#
# (c) 2015 Lars Engels <lme@FreeBSD.org>

# PROVIDE: etherpad_lite
# REQUIRE: DAEMON
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable etherpad_lite:
#
# etherpad_lite_enable="YES"

. /etc/rc.subr

name="etherpad_lite"
rcvar="etherpad_lite_enable"
start_cmd="start_etherpad_lite"

load_rc_config $name

: ${etherpad_lite_user:=etherpad-lite}
: ${etherpad_lite_logfile:=/var/log/etherpad-lite.log}
: ${etherpad_lite_enable:=NO}
: ${etherpad_lite_pidfile:=/var/run/etherpad-lite.pid}
: ${etherpad_lite_directory:=/usr/local/www/etherpad-lite}

command="${etherpad_lite_directory}/bin/run.sh"

start_etherpad_lite() {
        cd ${etherpad_lite_directory}
        daemon -r -u ${etherpad_lite_user}
          -P "${etherpad_lite_supervisor_pidfile}" \
          ${command} > "${etherpad_lite_logfile}" 2>&1
}

run_rc_command "$1"
 
Hallo Ime,

vielen Dank für dein Beispiel, ich habe das Skript auf meine Umgebung angepasst:

Code:
#!/bin/sh
#

# PROVIDE: etherpad
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable etherpad:
#
# etherpad_enable="YES"
#

. /etc/rc.subr

name="etherpad"
rcvar="${name}_enable"

start_cmd="${name}_start"

load_rc_config $name

: ${etherpad_user:=etherpad}
: ${etherpad_logfile:=/var/log/etherpad.log}
: ${etherpad_enable:=YES}
: ${etherpad_pidfile:=/var/run/etherpad/etherpad.pid}
: ${etherpad_directory:=/usr/local/www/etherpad}

command="${etherpad_directory}/bin/run.sh"

etherpad_start() {
        cd ${etherpad_directory}
        daemon -r -u ${etherpad_user}
          -P "${etherpad_supervisor_pidfile}" \
          ${command} > "${etherpad_logfile}" 2>&1
}

run_rc_command "$1"

Mein einziges Problem aktuell scheint das Pidfile zu sein, denn egal ob ich "etherpad_supervisor_pidfile" oder "etherpad_pidfile" benutze erhalte ich folgende Meldung:

Code:
/usr/local/etc/rc.d/etherpad start
usage: daemon [-cfr] [-p child_pidfile] [-P supervisor_pidfile] [-u user]
              command arguments ...

Im Log sehe ich dann:
Code:
tail -f /var/log/etherpad.log

eval: -P: not found
 
Hmm, das Skript brauchst du eigentlich nicht anzupassen. Lediglich die jeweiligen Variablen in der rc.conf setzen:

Code:
etherpad_lite_enable="YES"
etherpad_lite_user="etherpad"
etherpad_lite_logfile="/var/log/etherpad.log"
etherpad_lite_pidfile="/var/run/etherpad/etherpad.pid"
etherpad_lite_director="/usr/local/www/etherpad"

Dann sollte das schon klappen.

Weswegen benennst du das eigentlich alles in Etherpad um? Etherpad verhält sich zu Etherpad-lite ja ähnlich wie Firefox zu Chrome.
 
Was ist nicht verstehe ist woher denn die Variable "etherpad_supervisor_pidfile" in deinem Skript kommt.
 
Ah, da hatte ich erst was ausprobiert. Sorry. Nimm das "supervisor_" mal raus, dann klappts hoffentlich
 
Hallo Ime,

vielen Dank für die schnelle Antwort. Das Problem war ein anderes:

Code:
daemon -r -u ${etherpad_lite_user}
benötigt ein Backslash am Ende.

Vielen Dank Ime und CrimsonKing für eure Hilfe.

Gruß Mardor
 
Ah stimmt, jetzt sehe ich es auch. Sorry, ich hatte das Skript mal hochgeladen und danach noch geändert. Hatte jetzt nur die alte Version gefunden...
 
Überhaupt keine Sache, ohne dein Beispiel hätte ich viel mehr Probleme gehabt.
Nochmals vielen Dank.

Gruß Mardor
 
Zurück
Oben