systemd / node-sd-notify Goto Github PK
View Code? Open in Web Editor NEWwrapper around sd_notify for using systemd as a node process manager
Home Page: https://www.npmjs.com/package/sd-notify
License: MIT License
wrapper around sd_notify for using systemd as a node process manager
Home Page: https://www.npmjs.com/package/sd-notify
License: MIT License
Testing systemd in a container in a CI isn't exactly straightforward hence the current tests are extremely minimal. Though at a minimum maybe a local Docker based test would be sufficient. This might be useful: https://hub.docker.com/r/roryrjb/ubuntu-systemd.
The library should expose https://www.freedesktop.org/software/systemd/man/sd_watchdog_enabled.html# so that applications may determine whether notifications are required and how often they are required.
Hello,I would like to ask you question than if there is a service which I set the "Restart=always" .Can I get any notification when it crashed? Thanks very much!
Recently I tried to update the nodejs into 16 at my server (it still runs CentOS 7 and wasn't updated to RockyLinux yet) and once I tried to rebuild the sd-notify thing, it got failed with the next error:
npm ERR! code 1
npm ERR! path /home/vitaly/_Bots/FoxyBotJrDiscord/node_modules/sd-notify
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! make: Вход в каталог `/home/vitaly/_Bots/FoxyBotJrDiscord/node_modules/sd-notify/build'
npm ERR! CXX(target) Release/obj.target/notify/notify.o
npm ERR! make: Выход из каталога `/home/vitaly/_Bots/FoxyBotJrDiscord/node_modules/sd-notify/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.6.8 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/vitaly/_Bots/FoxyBotJrDiscord/node_modules/sd-notify/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/vitaly/.cache/node-gyp/16.14.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/home/vitaly/.cache/node-gyp/16.14.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/home/vitaly/.cache/node-gyp/16.14.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/vitaly/_Bots/FoxyBotJrDiscord/node_modules/sd-notify',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! g++: ошибка: unrecognized command line option «-std=gnu++14»
npm ERR! make: *** [Release/obj.target/notify/notify.o] Ошибка 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.4.158-1.el7.elrepo.x86_64
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/vitaly/_Bots/FoxyBotJrDiscord/node_modules/sd-notify
npm ERR! gyp ERR! node -v v16.14.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
GCC 4.8 doesn't support C++14 at all (the C++11 is the latest standard supported by this compiler)
Currently, this Git repository does not have any tags.
It would be nice if this repository had Git tags matching the npm releases.
Currently building a NodeJS application with this package is not possible, to shorten it:
-> the .node file does not get recognized to be bundled
see
TooTallNate/node-bindings#25
TooTallNate/node-bindings#38
rwaldron/johnny-five#1101 (comment)
as mentioned there to solve this issue there are several options, i ended up using
https://github.com/simonbuchan/bindings-loader
(works for me in addition with conventional "node-loader" which loads other .node-files but can not handle this require:
const sdNotify = require('bindings')('notify')
Since this platform isn't supported on Windows, it would be nice if the package.json
excluded Windows.
This way npm won't try and install the package on Windows environments (such as when doing development on Windows).
Or alternatively, an error should be thrown.
I have actually started this work. The only time I've used C++ in the last decade has been to write Node extensions. Since n-api exists and makes it possible to easily write extensions in C I much prefer to do this, as I actually write C all the time. I am raising this here now just so users know this is coming, but from an installation[0] and API point of view everything should be exactly the same.
bindings
and gyp
entirely.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.