-
Notifications
You must be signed in to change notification settings - Fork 1
NDM #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm really into this idea. It would make NodeOS more minimal and would encourage package authors to publish services that would work across different OS's (ndm currently supports Mac, Ubuntu, and CentOS). I currently have a PR in ndm to allow for global npm packages to be used directly as services. I think that would make this a more viable solution. Maybe then NodeOS could just use npm proper and supplement it with ndm:
|
Yes @seanewest, that's just my idea, install services with NPM and manage them with NDM :-) |
ndm recently got an upgrade. Here's how things might look if we swapped npkg for npm+ndm: Installing PackagesGlobal packages can be installed with the familiar Service Management
This will start and daemonize a service directly from a global or local package. Local packages live in the ndm comes with a bunch of other subcommands that allow you to manage these services:
Programmatic APIControl services programmatically: ndm = require('ndm')('PACKAGE');
ndm.install();
ndm.remove();
ndm.start();
ndm.stop();
ndm.restart();
//... |
@seanewest I feel like the biggest difference between ndm and npkg is ndm's requirement for a I use the service.json for npm Enterprise, which consists of several services which work in conjunction -- a service.json makes sense for this use-case. Perhaps, for the simpler single-service-use-case, we could have ndm fall back to looking for fields in the package.json? I think switching out npkg for ndm could potentially be a great way for us to pool our resources @groundwater. |
+1 |
I've review the NDM code and its mechanism is really simple, just only creates scripts to be exec by system service daemon. NodeOS doesn't have any of them, only the API of init. I find it better to have an API that a bunch of System V init files :-P so maybe NDM could wrap the scripts creation mechanism in an object, and calling its methods internally create the scripts or call the NodeOS init API. |
I've refactored ndm so that it will look for fields in a sevice.json file before looking for a package.json: Here's a library that's been updated to run with ndm: https://github.com/bcoe/thumbd/blob/master/package.json Essentially, you can now have the
|
Shouldn't it be just the opposite, first look for service.json and if it's not found, looks for the service field? |
@piranna you're correct, I just had it reversed in the comment. It goes |
You are welcome :-) |
https://github.com/npm/ndm
Seems it could integrate really well with NodeOS services... or maybe also reemplace it (at least at the user administration level) :-)
The text was updated successfully, but these errors were encountered: