Skip to content

NodeBB - Automatisch starten

NodeBB
1 1 674
  • Im Beitrag https://frank-mankel.org/topic/3/node-js-auf-dem-raspberry3-b-installieren habe ich berichtet, wie man node.js installiert. Darin liegt die ausführbare Datei node in /opt/node/bin. Das behalten wir jetzt erst mal so im Hinterkopf.

    Unter Debian arbeitet man mit systemd, ein System und Service Manager. Dieser Dienst sorgt dafür, das Dienste automatisch, z.B. beim Neustart des Servers gestartet werden. Dazu findet man im Ordner /etc/systemd/system eine ganze Reihe von Diensten. z.B.: sshd.service

    Gut, hier geht es aber um NodeBB. Von NodeBB gibt es eine Anleitung zum Thema, die findet man hier. Aber, wir verfeinern das Ganze hier noch ein wenig 😉

    nodebb.service

    [Unit]
    Description=NodeBB
    Documentation=https://docs.nodebb.org
    After=system.slice multi-user.target mongod.service
    
    [Service]
    Type=forking
    User=user
    
    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=nodebb
    
    WorkingDirectory=/home/user/nodebb
    PIDFile=/home/user/nodebb/pidfile
    ExecStart=/usr/bin/env node loader.js
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    

    Den User ersetzt ihr mit dem Namen Euren User's der NodeBB startet. Die NodeBB Installation liegt unter folgendem Pfad

    /home/user/nodebb/
    

    Den Dienst aktivieren

    sudo systemctl enable nodebb.service
    

    und starten

    sudo systemctl start nodebb.service
    

    Nun sollte der Dienst normalerweise beim Booten NodeBB starten, macht er aber bei mir um's verrecken nicht. Also Logfiles durchsuchen.

    Das sieht dort so aus

    May  3 21:15:07 one systemd[1]: Starting NodeBB...
    May  3 21:15:07 one nodebb[1366]: /usr/bin/env: ‘node’: No such file or directory
    May  3 21:15:07 one systemd[1]: nodebb.service: Control process exited, code=exited status=127
    May  3 21:15:07 one systemd[1]: Failed to start NodeBB.
    May  3 21:15:07 one systemd[1]: nodebb.service: Unit entered failed state.
    May  3 21:15:07 one systemd[1]: nodebb.service: Failed with result 'exit-code'.
    May  3 21:15:07 one systemd[1]: nodebb.service: Service hold-off time over, scheduling restart.
    May  3 21:15:07 one systemd[1]: Stopped NodeBB.
    

    Und nun kommen wir wieder auf den Anfang des Beitrages zu sprechen. Node ist die Anwendung node.js, die die Applikation NodeBB startet.

    Aus nodebb.service

    /usr/bin/env node loader.js
    

    node.js lädt die Datei loader.js, die im NodeBB Ordner liegt. So weit alles gut, aber bei unserer Installation, siehe den verlinkten Beitrag am Anfang, liegt die ausführbare Datei node in /opt/node/bin

    Ok, nun kann ich mir das Problem erklären, der User Root hat keinen Zugriff auf die Datei node. Und jetzt das Rätsel für mich, mein User für NodeBB hat Zugriff, mein User Root nicht. Stundenlang alles probiert. .profile editiert usw. Nichts brachte Erfolg. Ok, dann halt dirty 😞

    Ich habe dann die Datei nach /bin kopiert.

    cp /opt/node/bin/node /bin
    

    Danach hatte der User Root Zugriff auf die Datei und der nodebb.service funktioniert einwandfrei.

    Wer den Fehler kennt und eine Lösung für mich hat, immer her damit.

  • HSTS - Sicherheitsmechanismus für HTTPS-Verbindungen

    Linux hsts linux https
    1
    0 Stimmen
    1 Beiträge
    99 Aufrufe
    Niemand hat geantwortet
  • Happy Birthday Debian

    Allgemeine Diskussionen debian linux
    1
    1
    0 Stimmen
    1 Beiträge
    109 Aufrufe
    Niemand hat geantwortet
  • NAS 2023 - Software Teil 1

    Angeheftet Verschoben Linux nas linux
    1
    4
    0 Stimmen
    1 Beiträge
    268 Aufrufe
    Niemand hat geantwortet
  • Debian Bookworm 12 - Btrfs Installation

    Linux debian bookworm linux
    3
    1
    0 Stimmen
    3 Beiträge
    2k Aufrufe
    FrankMF
    Das mit den Namen der btrfs Subvolumes ist bekannt bei Timeshift. Im Readme steht dazu folgendes. BTRFS volumes BTRFS volumes must have an Ubuntu-type layout with @ and @home subvolumes. Other layouts are not supported. Systems having the @ subvolume and having /home on a non-BTRFS partition are also supported. Text file busy / btrfs returned an error: 256 / Failed to create snapshot can occur if you have a Linux swapfile mounted within the @ or @home subvolumes which prevents snapshot from succeeding. Relocate the swapfile out of @ or *@home, for example into it's own subvolume like @swap.
  • Update v2.2.2

    NodeBB nodebb redis
    1
    0 Stimmen
    1 Beiträge
    110 Aufrufe
    Niemand hat geantwortet
  • Mainline 5.13.x

    Images linux rockpro64
    1
    0 Stimmen
    1 Beiträge
    228 Aufrufe
    Niemand hat geantwortet
  • Linux Mint Cinnamon 20.2 "Uma" released

    Linux linuxmint linux
    3
    2
    0 Stimmen
    3 Beiträge
    330 Aufrufe
    FrankMF
    Was noch gestört hatte, war der Scrollbalken im FF. Der war zu schmal, konnte man schlecht erwischen. [image: 1626417117745-8e403120-11e2-413f-a479-0ebc3002e6d4-grafik.png] Quelle: https://forums.linuxmint.com/viewtopic.php?f=47&t=330849&sid=1c7c71850931d5c34d8a0dd41ff57679
  • Liste von Linuxbefehlen

    Angeheftet Linux linux
    4
    1
    0 Stimmen
    4 Beiträge
    908 Aufrufe
    FrankMF
    Anzeige des Speicherplatzes als Ersatz für df -h ~ duf  ✔ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 8 local devices │ ├─────────────────┬────────┬────────┬────────┬───────────────────────────────┬───────┬─────────────────────────────────┤ │ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │ ├─────────────────┼────────┼────────┼────────┼───────────────────────────────┼───────┼─────────────────────────────────┤ │ / │ 435.4G │ 154.6G │ 274.6G │ [#######.............] 35.5% │ btrfs │ /dev/luks-5336cabc-29f1-4af2-8a │ │ │ │ │ │ │ │ 31/dd411a9a1599 │ │ /boot/efi │ 299.4M │ 728.0K │ 298.7M │ [....................] 0.2% │ vfat │ /dev/nvme0n1p1 │ │ /home │ 435.4G │ 154.6G │ 274.6G │ [#######.............] 35.5% │ btrfs │ /dev/luks-5336cabc-29f1-4af2-8a │ │ │ │ │ │ │ │ 31/dd411a9a1599 │ │ /mnt/1TB │ 916.7G │ 821.8G │ 48.3G │ [#################...] 89.7% │ ext4 │ /dev/sda1 │ │ /mnt/Backup │ 457.4G │ 125.3G │ 308.8G │ [#####...............] 27.4% │ ext4 │ /dev/sdc1 │ │ /mnt/Backup_PVE │ 3.6T │ 718.3G │ 2.7T │ [###.................] 19.6% │ ext4 │ /dev/sdb1 │ │ /var/cache │ 435.4G │ 154.6G │ 274.6G │ [#######.............] 35.5% │ btrfs │ /dev/luks-5336cabc-29f1-4af2-8a │ │ │ │ │ │ │ │ 31/dd411a9a1599 │ │ /var/log │ 435.4G │ 154.6G │ 274.6G │ [#######.............] 35.5% │ btrfs │ /dev/luks-5336cabc-29f1-4af2-8a │ │ │ │ │ │ │ │ 31/dd411a9a1599 │ ╰─────────────────┴────────┴────────┴────────┴───────────────────────────────┴───────┴─────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 1 network device │ ├────────────┬────────┬────────┬────────┬───────────────────────────────┬──────┬───────────────────┤ │ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │ ├────────────┼────────┼────────┼────────┼───────────────────────────────┼──────┼───────────────────┤ │ /mnt/NAS │ 786.4G │ 327.0G │ 419.3G │ [########............] 41.6% │ nfs4 │ 192.168.3.19:/NAS │ ╰────────────┴────────┴────────┴────────┴───────────────────────────────┴──────┴───────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 9 special devices │ ├─────────────────────────────────┬────────┬────────┬───────┬───────────────────────────────┬──────────┬────────────┤ │ MOUNTED ON │ SIZE │ USED │ AVAIL │ USE% │ TYPE │ FILESYSTEM │ ├─────────────────────────────────┼────────┼────────┼───────┼───────────────────────────────┼──────────┼────────────┤ │ /dev │ 30.2G │ 0B │ 30.2G │ │ devtmpfs │ dev │ │ /dev/shm │ 30.3G │ 21.9M │ 30.3G │ [....................] 0.1% │ tmpfs │ tmpfs │ │ /run │ 30.3G │ 2.0M │ 30.3G │ [....................] 0.0% │ tmpfs │ run │ │ /run/credentials/systemd-crypts │ 1.0M │ 0B │ 1.0M │ │ tmpfs │ tmpfs │ │ etup@luks\x2d3a8e1aea\x2d0d01\x │ │ │ │ │ │ │ │ 2d4e45\x2d940f\x2d63af54c3d7f0. │ │ │ │ │ │ │ │ service │ │ │ │ │ │ │ │ /run/credentials/systemd-crypts │ 1.0M │ 0B │ 1.0M │ │ tmpfs │ tmpfs │ │ etup@luks\x2d5336cabc\x2d29f1\x │ │ │ │ │ │ │ │ 2d4af2\x2d8a31\x2ddd411a9a1599. │ │ │ │ │ │ │ │ service │ │ │ │ │ │ │ │ /run/credentials/systemd-journa │ 1.0M │ 0B │ 1.0M │ │ tmpfs │ tmpfs │ │ ld.service │ │ │ │ │ │ │ │ /run/user/1000 │ 6.1G │ 4.4M │ 6.1G │ [....................] 0.1% │ tmpfs │ tmpfs │ │ /sys/firmware/efi/efivars │ 128.0K │ 62.8K │ 60.2K │ [#########...........] 49.1% │ efivarfs │ efivarfs │ │ /tmp │ 30.3G │ 954.6M │ 29.3G │ [....................] 3.1% │ tmpfs │ tmpfs │ ╰─────────────────────────────────┴────────┴────────┴───────┴───────────────────────────────┴──────────┴────────────╯