nmorsman / node-systemd-notify

Send systemd notifications from Node
MIT License
8 stars 1 forks source link

Should use UNIX socket #11

Open CyberShadow opened 1 year ago

CyberShadow commented 1 year ago

Hi, FYI, the systemd-notify utility is only really useful for programming languages which don't support UNIX sockets.

It is much simpler to write to the UNIX socket directly. Here you can find implementations in Perl, Python and Ruby:

https://gist.github.com/grawity/6e5980981dccf66f554bbebb8cd169fc

CyberShadow commented 1 year ago

BTW, the linked blog post is full of inaccuracies. Unfortunately the author doesn't have a comment system set up so it's not possible to point them out.

CyberShadow commented 1 year ago

OK, I just noticed that Node doesn't have UNIX datagram socket support :clown_face: Like the blog post accurately says (missed that part).

I guess there is no way to do this in Node.js without using a subprocess or dependencies which add UNIX datagram socket support or bind to the C library. Feel free to close this issue.