/srv/irclogs.ubuntu.com/2012/11/19/#upstart.txt

stgraberjodh: hmm, one point I just noticed in the spec that I'm not too sure about is the D-Bus section on having the user upstart listen on /com/ubuntu/upstart-session/$user16:59
stgraberjodh: I see why we need that so initctl can work until we get a working dbus session16:59
stgraberjodh: but the fact that it's not unique per session is a bit problematic17:00
stgraberjodh: would it work if we use /com/ubuntu/upstart-session/$PID (where $PID is the pid of the user upstart) and export a UPSTART_SESSION environment variable to all children containing the path?17:02
stgraberjodh: it's really only going to be useful for the dbus job as it's likely going to be the only one that'll need to talk directly to upstart as any job after that will be able to use the session bus17:04
stgraberjodh, xnox: alright, I think I'm done with https://wiki.ubuntu.com/FoundationsTeam/Specs/RaringUpstartUserSessions17:33
stgraberfeel free to do any additional edits. I'm out to get some food, I'm starving ;)17:34
xnoxstgraber: thanks. I will look through your edits =)17:37
LeoShis there a special way to do a sudo entry to allow a normal user to restart a service?19:55
LeoShwhen I do something like: "/usr/sbin/service uwsgi *" that doesn't work... I get: /usr/sbin/service: 123: exec: status: not found19:57
LeoShfor the command "sudo service uwsgi status"19:58
JanCLeoSh: what do you mean by "normal user"?20:16
JanC(also, this sounds like a sudo question, not an upstart question?)20:16
JanChttp://manpages.ubuntu.com/sudoers explains sudo configuration20:17
LeoSh@JanC: not root20:29
LeoShI suspect it's more of an upstart question, or at least one upstart users have run into20:29
LeoShthe other strange detail is when I do 'service uwsgi' I get 'uwsgi: unrecognized service'20:30
LeoSheven though there's a uwsgi.conf in /etc/init/ and it looks like it's all properly formatted (and 'service uwsgi restart' works without any problems)20:30
JanCnot every non-root user has the same rights when using sudo20:30
JanCLeoSh: what if you use initctl ?20:31
LeoSh'initctl status uwsgi' works fine20:32
LeoShI'm not sure how to do an equivalent of 'service uwsgi' with initctl since it takes the command first20:34
JanCfrom the manpage of 'service', that is not a legal use of the service command?20:35
JanCit mentions "service SCRIPT COMMAND [OPTIONS]"20:36
JanCwhich means the command is mandatory?20:37
JanCunless you are using a different "service" command than I do20:37
LeoShhmm20:38
LeoShthat's a good point20:38
LeoShI'm on Ubuntu 12.0420:38
JanCI'm on Ubuntu 12.10 right now, but I'm pretty sure 'service' worked the same there20:38
LeoShok, so 'unrecognized service' is probabl unrelated to my actual issue20:39
JanChttp://manpages.ubuntu.com/manpages/precise/en/man8/service.8.html20:39
LeoShis there a way to control who is allowed to restart a service through upstart?20:40
JanChttp://manpages.ubuntu.com/manpages/precise/en/man5/sudoers.5.html   ☺20:40
LeoShyeah, that leads me to the original question :-/20:40
LeoShthe sudoers config I used works for an init.d script20:41
LeoShbut doesn't seem to work for my upstart .conf20:41
JanC(there are examples at the end of the manpage)20:41
JanCthe sudoers file only cares about users, groups & command lines AFAIK20:43
LeoShhmm20:44
LeoShdo I need to open up the other commands in sudoers? (ie. /sbin/start, /sbin/stop, etc.?)20:44
JanConly if you want to use them like that?20:45
LeoShI don't, but looking at the error20:45
LeoShit refers to /usr/sbin/service:12320:45
JanChm, maybe think about how you define it and how you use it?20:45
LeoShwhich attempts to exec the action: exec ${ACTION} ${SERVICE} ${OPTIONS}20:46
LeoShand that's what fails20:46
JanCwell, you run service with sudo, right?20:46
LeoShyes20:47
LeoShI get the following if I just try to do "status" as my non-priv user: Command 'status' is available in '/sbin/status'20:48
JanCif you execute it without an "action", that would probably fail20:48
LeoShand that it can't be located20:48
LeoShwhich is strange, since it should be running as root rather than the nonpriv user20:48
LeoShbut it explains why the init.d version works fine20:48
LeoShit doesn't try to invoke another binary that the nonpriv user doesn't have access to20:49
LeoShis there some really good reason to not add sbin to your path?20:50
LeoShas a nonpriveleged user?20:50
JanCwell, if $ACTION is empty, that would certainly confuse $SERVICE being called as the main application?20:50
JanCif hey have no proper checking in place  :p20:51
JanCif they*20:51
LeoShhere's the core problem20:52
LeoSh'service' is in/usr/bin and 'start' and it's kin are over in /sbin20:52
JanCif you run 'service' as root (using sudo or otherwise) that shouldn't be a problem20:57
LeoShI do, but it still is21:00
LeoShI think the PATH of the user remains even when you sudo21:01
JanCthat depends on sudo options, but possibly, yes21:01
LeoShok, yeah, the sudoers file has 'Defaults env_reset' which is recommended...21:20
JanCLeoSh: I don't have the time to investigate right now, but AFAIK sudo allows you to override that21:33
LeoShJanC: yeah, I appreciate the help, I'm digging into it21:33
LeoShapparently the setting comes from some unholy mix of login.defs and pam config21:33

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!