question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

systemd or systemv-init

See original GitHub issue

hi 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:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aburgercommented, Aug 5, 2016

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

0reactions
aburgercommented, Aug 24, 2016

On 09.08.2016 10:11, Kevin van Zonneveld wrote:

Thanks for sharing that systemd snippet @aburger! 👍 I do have to stress that running as root is a big concern so I hope you can figure out that permission issues! Are you perhaps opening a port < 1024?


You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/tus/tus-node-server/issues/41#issuecomment-238483896

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Systemd Units and Unit Files | DigitalOcean
In systemd , a unit refers to any resource that the system knows how to operate on and manage. This is the primary...
Read more >
systemd.unit - Freedesktop.org
A unit file is a plain text ini-style file that encodes information about a service, a socket, a device, a mount point, an...
Read more >
What is the difference between systemd's "user" and "system ...
systemd runs a service manager for the system and a service manager for logged in users. System units can only be started/stopped by...
Read more >
Chapter 17. Working with systemd unit files
A unit file contains configuration directives that describe the unit and define its behavior. Several systemctl commands work with unit files in the ......
Read more >
systemd unit file basics - Fedora Magazine
systemd is compartmentalized so that components of your system can be more easily managed. systemd uses unit files to configure and manage ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found