1.0.18 • Published 10 years ago
@mh-cbon/upstart-simple-api v1.0.18
upstart-simple-api
Simple and limited api to interface with upstart.
install
npm i @mh-cbon/upstart-simple-api --saveusage
Beware,
- user jobs are not well tested because they cannot be initialized easily with a vagrant ubuntu box.
describemethod is quiet limited in regard of upstart script language, it is intended.
var UpstartSimpleApi = require('@mh-cbon/upstart-simple-api');
var usapi = new UpstartSimpleApi(/* version */);
// initctl list
usapi.list(opts={}, function (err, items) {
console.log(items);
})
// initctl show-config serviceId
sds.describe('serviceId', opts={}, function (err, info) {
console.log(info);
})
// initctl start serviceId
sds.start('serviceId', opts={}, function (err) {
console.log(err);
})
// initctl stop serviceId
sds.stop('serviceId', opts={}, function (err) {
console.log(err);
})
// initctl reload serviceId
sds.reload('serviceId', function (err) {
console.log(err);
})
// initctl reload-configuration serviceId
sds.reloadConfiguration('serviceId', function (err) {
console.log(err);
})Install a Service
// per user
var service = {
user: true,
id: 'fake',
stanzas: [
{
name: 'author',
value: 'whatever'
},
{
name: 'exec',
value: '/bin/sh ...'
}
]
}
usapi.install(service, done)
// system wide
var service = {
user: !true,
id: 'fake',
stanzas: [
{
name: 'author',
value: 'whatever'
},
{
name: 'exec',
value: '/bin/sh ...'
}
]
}
usapi.install(service, done)
// later...
usapi.uninstall(service, done)read more
- http://askubuntu.com/questions/637305/how-do-i-control-an-upstart-session-job-over-ssh
- http://upstart.ubuntu.com/cookbook/#joining-a-session
- http://upstart.ubuntu.com/cookbook/#session-init
- http://upstart.ubuntu.com/wiki/Stanzas
- http://dev.deluge-torrent.org/wiki/UserGuide/Service/Upstart
- http://minecraft.gamepedia.com/Tutorials/Ubuntu_startup_script
- https://www.nginx.com/resources/wiki/start/topics/examples/ubuntuupstart/#
- https://www.exratione.com/2013/02/nodejs-and-forever-as-a-service-simple-upstart-and-init-scripts-for-ubuntu/
1.0.18
10 years ago
1.0.17
10 years ago
1.0.16
10 years ago
1.0.15
10 years ago
1.0.14
10 years ago
1.0.13
10 years ago
1.0.12
10 years ago
1.0.11
10 years ago
1.0.10
10 years ago
1.0.9
10 years ago
1.0.8
10 years ago
1.0.7
10 years ago
1.0.6
10 years ago
1.0.5
10 years ago
1.0.4
10 years ago
1.0.3
10 years ago
1.0.2
10 years ago
1.0.1
10 years ago
1.0.0
10 years ago