Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

terinjokes/nodejs-systemd-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

This is a simple node HTTP service that demonstrates an issue listening to file descriptors from systemd.

  1. Copy nodejs.socket and nodejs.service into /etc/systemd/system/. Modify “collapsify.service” to point “ExecStart” to “server.js” in this directory.
  2. Start the “nodejs” service
sudo systemctl start nodejs
  1. Attempt to connect to the service.
curl http://localhost:8020/
  1. If operating correctly, you should see the “Hello World!” demo text. If not operating correctly, curl will remain running.

While in the inoperable state, you can attach to the running server.js process with sudo strace -p $PID and rerun the curl. You’ll notice that the accept4 syscall happened with a valid return, but the read syscall never happens.

  1. Once you’re done debugging this, stop the service and remove the unit files from /etc/systemd/system/.
sudo systemctl stop nodejs.{service,socket}
sudo rm /etc/systemd/system/nodejs.{service,socket}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published