systemd or systemv-init
See original GitHub issuehi there,
i got the tus-server running by starting ist by hand, but i would like to start it up automatically.
as i am on centos 7 i still could use initv-scripts, but also systemd-manifests. both did not work as i thought.
i have a server.js in /usr/local/tus-node-server/hest so starting by hand is: npm run hest
in the startscript i tried without and with cd to /usr/local/tus-node-server, but get: sh: nodemon: command not found
the npm-debug.log shows this:
0 info it worked if it ends with ok
1 verbose cli [ ‘node’, ‘/bin/npm’, ‘run’, ‘hest’ ]
2 info using npm@3.10.3
3 info using node@v0.10.42
4 verbose node symlink /bin/node
5 verbose run-script [ ‘prehest’, ‘hest’, ‘posthest’ ]
6 info lifecycle tus-node-server@0.1.1~prehest: tus-node-server@0.1.1
7 silly lifecycle tus-node-server@0.1.1~prehest: no script for prehest, continuing
8 info lifecycle tus-node-server@0.1.1~hest: tus-node-server@0.1.1
9 verbose lifecycle tus-node-server@0.1.1~hest: unsafe-perm in lifecycle true
10 verbose lifecycle tus-node-server@0.1.1~hest: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/local/tus-node-server/node_modules/.bin:/bin:/sbin:/usr/sbin:/bin:/usr/bin,/usr/local/bin/
11 verbose lifecycle tus-node-server@0.1.1~hest: CWD: /usr/local/tus-node-server
12 silly lifecycle tus-node-server@0.1.1~hest: Args: [ ‘-c’, ‘nodemon hest/server.js’ ]
13 info lifecycle tus-node-server@0.1.1~hest: Failed to exec hest script
14 verbose stack Error: tus-node-server@0.1.1 hest: nodemon hest/server.js
14 verbose stack spawn ENOENT
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:33:16)
14 verbose stack at ChildProcess.emit (events.js:98:17)
14 verbose stack at maybeClose (child_process.js:766:16)
14 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:833:5)
15 verbose pkgid tus-node-server@0.1.1
16 verbose cwd /usr/local/tus-node-server
17 error Linux 3.10.0-327.18.2.el7.x86_64
18 error argv “node” “/bin/npm” “run” “hest”
19 error node v0.10.42
20 error npm v3.10.3
21 error file sh
22 error code ELIFECYCLE
23 error errno ENOENT
24 error syscall spawn
25 error tus-node-server@0.1.1 hest: nodemon hest/server.js
25 error spawn ENOENT
26 error Failed at the tus-node-server@0.1.1 hest script ‘nodemon hest/server.js’.
26 error Make sure you have the latest version of node.js and npm installed.
26 error If you do, this is most likely a problem with the tus-node-server package,
26 error not with npm itself.
26 error Tell the author that this fails on your system:
26 error nodemon hest/server.js
26 error You can get information on how to open an issue for this project with:
26 error npm bugs tus-node-server
26 error Or if that isn’t available, you can get their info via:
26 error npm owner ls tus-node-server
26 error There is likely additional logging output above.
27 verbose exit [ 1, true ]
where do i a mistake?
regards andreas
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
so now it work. have to figure out, why it does not work as non-root, could be some rights-issue, but in general that solves my issue. my manifest down
regards andreas
[Unit] Description=tus-node
[Service] Environment=NODE_PATH=/usr/local/lib/node_modules ExecStartPre=cd /usr/local/tus-node-server ExecStartPre=pwd ExecStart=/usr/local/bin/node /usr/local/tus-node-server/hest/server.js Restart=always User=root Group=nobody Environment=PATH=/usr/bin:/usr/local/bin Environment=NODE_ENV=production WorkingDirectory=/usr/local/tus-node-server/hest
[Install] WantedBy=multi-user.target
On 09.08.2016 10:11, Kevin van Zonneveld wrote:
hi there,
sorry for the delay. i chowned the files and changed the user in the manifest.
additionally, i added a preexec which mounts the targetpath.
regards
andreas
Andreas Burger Stampfenbachstr 32 ch-8006 Zuerich andreas@andreasburger.org