=== robins is now known as robinsmidsrod | ||
bencc | how can I check in a script if an upstart job is running? | 18:50 |
---|---|---|
JanC | bencc: you can parse the output of "initctl status", or use dbus? | 19:32 |
bencc | JanC: I think this will work: if [ status myjob | grep -q 'start/running' ]; then | 19:33 |
JanC | technically it's still running when the status is 'stop/running' too ;) | 19:35 |
JanC | but not for long (if everything goes well) | 19:36 |
bencc | JanC: it will be useful to have a simple command that gives you 0/1 | 20:50 |
JanC | bencc: the "X/Y" part is "target/status", so the part after the "/" is the current status | 20:53 |
JanC | but yeah, maybe a more script-friendly initctl command might be useful ☺ | 20:54 |
nickradford | How do you write a script that will allow any user to start the service without using sudo? | 21:51 |
JanC | nickradford: sudo was specifically designed to allow that, why don't you want to use it? | 22:03 |
nickradford | I'm trying to have a service which runs a node.js web application, and `start myservice` will be called remotely over ssh, but users which don't know the account they're accessing's password. | 22:05 |
JanC | you can configure sudo to allow specific users to run specific commands as root without a password | 22:06 |
JanC | see sudo's manpage & other documentation | 22:07 |
nickradford | alright, thank you JanC :) | 22:07 |
JanC | nickradford: there might be more support for such things in future versions of upstart, I don't know, but i'm pretty sure sudo can already do what you want ;) | 22:08 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!