Code=exited, status=203/EXEC

Hi guys, I have a problem because, before, we started genieACS with a bash file.
Now we would like to start services configuring systemd.The three services (CWMP, NBI and FS) start, I only have problem with the UI that doesn’t start.

● genieacs-ui.service - GenieACS UI
   Loaded: loaded (/etc/systemd/system/genieacs-ui.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-09-24 09:57:38 CEST; 5s ago
  Process: 1100 ExecStart=/usr/bin/genieacs-ui (code=exited, status=203/EXEC)
 Main PID: 1100 (code=exited, status=203/EXEC)

Sep 24 09:57:38 autoprov systemd[1]: Started GenieACS UI.
Sep 24 09:57:38 autoprov systemd[1100]: genieacs-ui.service: Failed at step EXEC spawning /usr/bin/genieacs-ui: No such file or directory
Sep 24 09:57:38 autoprov systemd[1]: genieacs-ui.service: Main process exited, code=exited, status=203/EXEC
Sep 24 09:57:38 autoprov systemd[1]: genieacs-ui.service: Unit entered failed state.
Sep 24 09:57:38 autoprov systemd[1]: genieacs-ui.service: Failed with result 'exit-code'.

Someone could kindly help me? Where is genieacs-ui?

You installed it using npm? Normally /usr/bin/genieacs-ui is a symlink to /usr/lib/node_modules/genieacs/bin/genieacs-ui. Maybe your install failed somewhere?

I updated all and now in usr/bin/genieacs-ui there is ! But now all services except FS give me the code status=1/FAILURE

root@autoprov:/usr/bin# sudo systemctl enable genieacs-cwmp
Created symlink /etc/systemd/system/default.target.wants/genieacs-cwmp.service → /etc/systemd/system/genieacs-cwmp.service.
root@autoprov:/usr/bin# sudo systemctl start genieacs-cwmp
root@autoprov:/usr/bin# sudo systemctl status genieacs-cwmp
● genieacs-cwmp.service - GenieACS CWMP
   Loaded: loaded (/etc/systemd/system/genieacs-cwmp.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-09-25 11:30:43 CEST; 5s ago
  Process: 4345 ExecStart=/usr/bin/genieacs-cwmp (code=exited, status=1/FAILURE)
 Main PID: 4345 (code=exited, status=1/FAILURE)

Sep 25 11:30:43 autoprov genieacs-cwmp[4345]:     at Object.Module._extensions..js (module.js:664:10)
Sep 25 11:30:43 autoprov genieacs-cwmp[4345]:     at Module.load (module.js:566:32)
Sep 25 11:30:43 autoprov genieacs-cwmp[4345]:     at tryModuleLoad (module.js:506:12)
Sep 25 11:30:43 autoprov genieacs-cwmp[4345]:     at Function.Module._load (module.js:498:3)
Sep 25 11:30:43 autoprov genieacs-cwmp[4345]:     at Function.Module.runMain (module.js:694:10)
Sep 25 11:30:43 autoprov genieacs-cwmp[4345]:     at startup (bootstrap_node.js:204:16)
Sep 25 11:30:43 autoprov genieacs-cwmp[4345]:     at bootstrap_node.js:625:3
Sep 25 11:30:43 autoprov systemd[1]: genieacs-cwmp.service: Main process exited, code=exited, status=1/FAILURE
Sep 25 11:30:43 autoprov systemd[1]: genieacs-cwmp.service: Unit entered failed state.
Sep 25 11:30:43 autoprov systemd[1]: genieacs-cwmp.service: Failed with result 'exit-code'.
root@autoprov:/usr/bin# sudo systemctl enable genieacs-nbi
Created symlink /etc/systemd/system/default.target.wants/genieacs-nbi.service → /etc/systemd/system/genieacs-nbi.service.
root@autoprov:/usr/bin# sudo systemctl start genieacs-nbi
root@autoprov:/usr/bin# sudo systemctl status genieacs-nbi
● genieacs-nbi.service - GenieACS NBI
   Loaded: loaded (/etc/systemd/system/genieacs-nbi.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-09-25 11:31:02 CEST; 5s ago
  Process: 4372 ExecStart=/usr/bin/genieacs-nbi (code=exited, status=1/FAILURE)
 Main PID: 4372 (code=exited, status=1/FAILURE)

Sep 25 11:31:02 autoprov genieacs-nbi[4372]:     at Object.runInThisContext (vm.js:139:10)
Sep 25 11:31:02 autoprov genieacs-nbi[4372]:     at Module._compile (module.js:617:28)
Sep 25 11:31:02 autoprov genieacs-nbi[4372]:     at Object.Module._extensions..js (module.js:664:10)
Sep 25 11:31:02 autoprov genieacs-nbi[4372]:     at Module.load (module.js:566:32)
Sep 25 11:31:02 autoprov genieacs-nbi[4372]:     at tryModuleLoad (module.js:506:12)
Sep 25 11:31:02 autoprov genieacs-nbi[4372]:     at Function.Module._load (module.js:498:3)
Sep 25 11:31:02 autoprov genieacs-nbi[4372]:     at Function.Module.runMain (module.js:694:10)
Sep 25 11:31:02 autoprov systemd[1]: genieacs-nbi.service: Main process exited, code=exited, status=1/FAILURE
Sep 25 11:31:02 autoprov systemd[1]: genieacs-nbi.service: Unit entered failed state.
Sep 25 11:31:02 autoprov systemd[1]: genieacs-nbi.service: Failed with result 'exit-code'.
root@autoprov:/usr/bin# sudo systemctl enable genieacs-fs
Created symlink /etc/systemd/system/default.target.wants/genieacs-fs.service → /etc/systemd/system/genieacs-fs.service.
root@autoprov:/usr/bin# sudo systemctl start genieacs-fs
root@autoprov:/usr/bin# sudo systemctl status genieacs-fs
● genieacs-fs.service - GenieACS FS
   Loaded: loaded (/etc/systemd/system/genieacs-fs.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2020-09-25 11:31:18 CEST; 5s ago
 Main PID: 4398 (node)
    Tasks: 22 (limit: 4915)
   CGroup: /system.slice/genieacs-fs.service
           ├─4398 node /usr/bin/genieacs-fs
           ├─4408 /usr/bin/node /usr/bin/genieacs-fs
           └─4409 /usr/bin/node /usr/bin/genieacs-fs

Sep 25 11:31:18 autoprov systemd[1]: Started GenieACS FS.
Sep 25 11:31:18 autoprov genieacs-fs[4398]: 2020-09-25T09:31:18.524Z [INFO] genieacs-fs starting; pid=4398 version="1.2.1+20200909044125"
Sep 25 11:31:18 autoprov genieacs-fs[4398]: 2020-09-25T09:31:18.989Z [INFO] Worker listening; pid=4409 address="0.0.0.0" port=7567
Sep 25 11:31:18 autoprov genieacs-fs[4398]: 2020-09-25T09:31:18.992Z [INFO] Worker listening; pid=4408 address="0.0.0.0" port=7567
root@autoprov:/usr/bin# sudo systemctl enable genieacs-ui
Created symlink /etc/systemd/system/default.target.wants/genieacs-ui.service → /etc/systemd/system/genieacs-ui.service.
root@autoprov:/usr/bin# sudo systemctl start genieacs-ui
root@autoprov:/usr/bin# sudo systemctl status genieacs-ui
● genieacs-ui.service - GenieACS UI
   Loaded: loaded (/etc/systemd/system/genieacs-ui.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-09-25 11:31:32 CEST; 4s ago
  Process: 4447 ExecStart=/usr/bin/genieacs-ui (code=exited, status=1/FAILURE)
 Main PID: 4447 (code=exited, status=1/FAILURE)

Sep 25 11:31:32 autoprov genieacs-ui[4447]:     at Module.load (module.js:566:32)
Sep 25 11:31:32 autoprov genieacs-ui[4447]:     at tryModuleLoad (module.js:506:12)
Sep 25 11:31:32 autoprov genieacs-ui[4447]:     at Function.Module._load (module.js:498:3)
Sep 25 11:31:32 autoprov genieacs-ui[4447]:     at Module.require (module.js:597:17)
Sep 25 11:31:32 autoprov genieacs-ui[4447]:     at require (internal/module.js:11:18)
Sep 25 11:31:32 autoprov genieacs-ui[4447]:     at Object.<anonymous> (/usr/lib/node_modules/genieacs/bin/genieacs-ui:2:417)
Sep 25 11:31:32 autoprov genieacs-ui[4447]:     at Module._compile (module.js:653:30)
Sep 25 11:31:32 autoprov systemd[1]: genieacs-ui.service: Main process exited, code=exited, status=1/FAILURE
Sep 25 11:31:32 autoprov systemd[1]: genieacs-ui.service: Unit entered failed state.
Sep 25 11:31:32 autoprov systemd[1]: genieacs-ui.service: Failed with result 'exit-code'.

Please help me because now nothing work not even with the bash file!!

root@autoprov:/home/isiline/genieacs-gui# ./start.sh
/usr/lib/node_modules/genieacs/bin/genieacs-nbi:2
"use strict";const e=require("path"),t=require("fs"),n=require("os"),s=require("ipaddr.js"),r=require("cluster"),i=require("http"),a=require("https"),o=require("url"),l=require("mongodb"),c=require("querystring"),u=require("vm"),d=require("parsimmon"),f=require("crypto"),p=require("later"),m=require("dgram"),h=require("child_process"),g=require("yaml");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const w=_(r),y=_(d);let E,O,S,T,v,A,b=e.resolve(__dirname,"..");for(;!t.existsSync(b+"/package.json");){const t=e.resolve(b,"..");if(t===b){b=process.cwd();break}b=t}const I={EXT_DIR:{type:"path",default:e.resolve(b,"config/ext")},MONGODB_CONNECTION_URL:{type:"string",default:"mongodb://127.0.0.1/genieacs"},CWMP_WORKER_PROCESSES:{type:"int",default:0},CWMP_PORT:{type:"int",default:7547},CWMP_INTERFACE:{type:"string",default:"0.0.0.0"},CWMP_SSL_CERT:{type:"string",default:""},CWMP_SSL_KEY:{type:"string",default:""},CWMP_LOG_FILE:{type:"path

SyntaxError: Unexpected reserved word
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
/usr/lib/node_modules/genieacs/bin/genieacs-cwmp:2
"use strict";const e=require("path"),t=require("fs"),s=require("os"),n=require("ipaddr.js"),a=require("cluster"),r=require("http"),i=require("https"),o=require("zlib"),c=require("crypto"),l=require("vm"),u=require("seedrandom"),f=require("child_process"),d=require("later"),p=require("mongodb"),m=require("parsimmon"),h=require("util"),g=require("iconv-lite"),w=require("yaml");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}const b=v(a),y=v(u),S=v(m);let _,D,O,R,x,T,A=e.resolve(__dirname,"..");for(;!t.existsSync(A+"/package.json");){const t=e.resolve(A,"..");if(t===A){A=process.cwd();break}A=t}const E={EXT_DIR:{type:"path",default:e.resolve(A,"config/ext")},MONGODB_CONNECTION_URL:{type:"string",default:"mongodb://127.0.0.1/genieacs"},CWMP_WORKER_PROCESSES:{type:"int",default:0},CWMP_PORT:{type:"int",default:7547},CWMP_INTERFACE:{type:"string",default:"0.0.0.0"},CWMP_SSL_CERT:{type:"string",default:""},CWMP_SSL_KEY:{type:"string",defaul

SyntaxError: Unexpected reserved word
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:617:28)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3
2020-09-25T09:55:00.542Z [INFO] genieacs-fs starting; pid=4738 version="1.2.1+20200909044125"
2020-09-25T09:55:01.221Z [INFO] Worker listening; pid=4786 address="0.0.0.0" port=7567
2020-09-25T09:55:01.229Z [INFO] Worker listening; pid=4791 address="0.0.0.0" port=7567
=> Booting Puma
=> Rails 5.2.1 application starting in development 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.6.1-p33), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop

Hi @snuz, maybe i’m wrong but it seems you run it from sources, npm install and npm run build. If it’s right, symlinks in /usr/bin doesn’t exist.
you may experienced missing modules issues if you manually move bin files

with genieacs 1.2.1 built from github sources, you have to adapt systemd files ExecStart section to point to your current ./dist/bin/genieacs-xx files. I also experienced some permissions issues when i tried to run these services without root user (in systemd file),

you can also install from npm sudo npm install -g --unsafe-perm genieacs@1.2.1, no need to mod systemd files ExecStart section.

we use the version 1.1 …

We start our GUI with the command rails s . Could I create a systemctl service for it?

1.1… ok

create a bash file with your commands and add it to systemctl

The other three services (CWMP, NBI and FS) start normally, so I only need to create a bash file with the command rails s and then? What I need to do? Thank you so much

I’ve tried all ways possible for doing it but it doesn’t work, it says:

genieacs-gui/start.sh: line 4: rails: command not found

genieacs-gui/start.sh (code=exited, status=127)

I also tried to specify absolute path to rails but it says “permission denied” despite the permission was 777.
I don’t know what else to do

@snuz, post your start.sh file and service file contents.

I’ve tried this

  #!/bin/bash
 /root/.rbenv/shims/rails

and this:

#!/bin/bash
rails s

And this is the genieacs-ui service:

[Unit]
Description=GenieACS UI
After=network.target

[Service]
User=genieacs
EnvironmentFile=/opt/genieacs/genieacs.env
ExecStart=/bin/bash /usr/bin/genieacs-ui.sh

[Install]
WantedBy=default.target

With this I get “permission denied” despite the permission 777

With this I get “rails command not found”

@snuz Ok, it’s clear. You have to cd in genieacs-gui folder (1.1.x) before running ruby command

so your bash file should look like this

if you are under root user:

#!/bin/bash
cd /path/to/your/downloaded/geniacs-gui/
rails server -b 0.0.0.0

set it executable

chmod +x /path/to/your/start.sh

you can run batch file only to test everything is ok before start as service.

./path/to/start.sh

About service, the content you posted is for genieacs@1.2.1. I’m not sure environment file is needed with 1.1.x version (to check).

Also running service with User=genieacs results sometimes to permission denied issues. So just start it with root user. You may check genieacs user’s rights, group, etc and change it back after.

[Unit]
Description=GenieACS UI
After=network.target

[Service]
User=root
ExecStart=/path/to/your/start.sh

[Install]
WantedBy=default.target

It doesn’t work…

root@autoprov:/usr/bin# ./genieacs-ui.sh 
./genieacs-ui.sh: line 2: cd: /home/autoprov/geniacs-gui/: No such file or directory

the path is correct because it works if I do this:

root@autoprov:/home/autoprov/genieacs-gui# rails s
=> Booting Puma
=> Rails 5.2.1 application starting in development 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.6.1-p33), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop

Am I wrong somewhere else?

dear, path in bash isn’t correct.

you cd to : /home/autoprov/geniacs-gui/
path is : /home/autoprov/genieacs-gui/

Sorry but I couldn’t understand what you mean…Could you kindly re-explain ?

The bash is:

#!/bin/bash
cd /home/autoprov/geniacs-gui/
rails s

Thank you so much for the support

#!/bin/bash
#genieacs-gui not geniacs-gui
cd /home/autoprov/genieacs-gui/
rails s