Create a file /etc/systemd/system/matrix-node.service (replace “<DEVICE ID>” and “<DEVICE SECRET>” with the values you got when registering your device):
[Unit]
Description=Matrix NodeJS Service
After=network.target
Whe I start the service without MATRIX_MODE=service as user pi, I get the follwoing:
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'matrixio-os.service'.
Multiple identities can be used for authentication:
1. ,,, (pi)
2. root
Choose identity to authenticate as (1-2): 1
Password:
==== AUTHENTICATION COMPLETE ===
Now I just started the service with MATRIX_MODE=service enabled as user pi.
The service started without problems and even installed and or updated the installed matrix-os apps.
So far, so good.
If I now start one of the apps from my phone, I can find the follwoing error in syslog:
firebase config valid, but not validated, check flow
Apr 9 14:31:01 pixie matrix-node[5703]: ==== Application HelloWorld started! ====
Apr 9 14:31:02 pixie matrix-node[5703]: (HelloWorld)err module.js:457
Apr 9 14:31:02 pixie matrix-node[5703]: throw err;
Apr 9 14:31:02 pixie matrix-node[5703]: ^
Apr 9 14:31:02 pixie matrix-node[5703]: Error: Cannot find module './../matrix.js'
Apr 9 14:31:02 pixie matrix-node[5703]: at Function.Module._resolveFilename (module.js:455:15)
Apr 9 14:31:02 pixie matrix-node[5703]: at Function.Module._load (module.js:403:25)
Apr 9 14:31:02 pixie matrix-node[5703]: at Module.require (module.js:483:17)
Apr 9 14:31:02 pixie matrix-node[5703]: at require (internal/module.js:20:19)
Apr 9 14:31:02 pixie matrix-node[5703]: at Object.<anonymous> (/var/matrix-os/store/apps/HelloWorld.matrix/index.js:3:10)
Apr 9 14:31:02 pixie matrix-node[5703]: at Module._compile (module.js:556:32)
Apr 9 14:31:02 pixie matrix-node[5703]: at Object.Module._extensions..js (module.js:565:10)
Apr 9 14:31:02 pixie matrix-node[5703]: at Module.load (module.js:473:32)
Apr 9 14:31:02 pixie matrix-node[5703]: at tryModuleLoad (module.js:432:12)
Apr 9 14:31:02 pixie matrix-node[5703]: at Function.Module._load (module.js:424:3)
Apr 9 14:31:02 pixie matrix-node[5703]: MATRIX OS quits applications when they write to `stderr`. This is commonly triggered by the debug node module (run DEBUG=false to get by in dev mode) or with console.error(). If you find this behavior unacceptable, contact us, this "feature" is open to discussion.
Apr 9 14:31:02 pixie matrix-node[5703]: Stopping HelloWorld
Apr 9 14:31:02 pixie matrix-node[5703]: App IPC Disconnect HelloWorld
Apr 9 14:31:02 pixie matrix-node[5703]: Event Listeners Removed HelloWorld
Apr 9 14:31:02 pixie matrix-node[5703]: VES Instances yet not halted on app stop