/srv/irclogs.ubuntu.com/2008/04/09/#upstart.txt

ktkhi all13:09
ktkshort q: what would be the correct way to start a service as another user with upstart? I tried this:13:10
ktkexec su - vbox -c "svscan /home/vbox/services"13:11
ktkbut that creates three processes: 13:11
ktk--13:11
ktkvbox      4099  0.0  0.1   2672  1068 ?        Ss   13:56   0:00 su - vbox -c svscan /home/vbox/services13:11
ktkvbox      4179  0.0  0.0   1752   508 ?        S    13:56   0:00 -su -c svscan /home/vbox/services13:11
ktkvbox      4185  0.0  0.0   1708   380 ?        S    13:56   0:00 svscan /home/vbox/services13:11
ktk--13:11
ktkcouldn't find hints in the docs so far13:12
ion_How about if you scrap the - and use -c 'exec svscan ...'? (Just guessing here)13:12
ktkwell if I run it by hand I need the - for switching to the correct environment of the user13:13
Keybuknot sure why su adds another child there14:20
ktkwell the last pid makes sense14:23
ktkthe other two not IMHO14:23
Keybukexec su -c "exec svscan /home/vbox/services" - vbox14:24
Keybukis the usual way14:24
ktkletme try that14:25
ktkok now I could get rid of one process :)14:40
ktklooks like this now:14:40
ktk--14:41
ktkvbox      4031  0.0  0.1   2668  1064 ?        Ss   15:26   0:00 su -c exec svscan /home/vbox/services - vbox14:41
ktkvbox      4105  0.0  0.0   1708   380 ?        S    15:26   0:00 svscan /home/vbox/services14:41
ktk--14:41
ktkbut 4031 still should not stay like this 14:41
Keybukare you sure that the 4105 isn't a fork by svscan14:49
ktkgood question, letme try that by hand again14:52
ktkdoesn't seem to fork like this14:58
ktkso I am pretty sure that's not svscan14:58
ktkhmm su seems to do that15:00
ktkbut I don't see why15:00
Keybukwho knows15:00
Keybuktried without the "-" ?15:01
ktkwill try moment15:01
Keybukit might be because upstart processes are session leaders15:01
Keybukso su makes a new session15:01
Keybukyou need to fork to do that15:01
Keybukodd that it keeps the old one around though15:01
Keybuknormally the parent would exit15:01
ktknope that seems to cause more problems without the - 15:02
ktkthen I get even more15:02
ktkcouldn't find any other example of a process that should run under a different user15:03
ktkanyone got an example how apache would be started like this?15:03
ktkfor example15:04
Keybukusually they do it themselves15:09
ktkhmm ok15:11
brendan_Keybuk: is running event.d scripts as different users on the roadmap?17:06
Keybukeventually17:09
Keybukthere's a small parcel of issues and decisions there though17:09
Keybuke.g. what does "run as a different user" actually mean17:09
Keybukit can mean setuid(), it can mean setuid() and initgroups(), it can mean a full PAM session, it can mean ConsoleKit registration and it can mean a session environment including such things as D-Bus, etc.17:09
Keybukalso there's the permission aspect17:10
Keybuke.g. if I jobs are run as my user, should my user have permission to stop and start them?17:10
Keybuktherefore if I emit an event, are only my jobs started by it?17:10
brendan_complex, indeed17:46
brendan_keybuk: as an aside, we're running upstart inside xen virtual domains and it works great for that purpose. especially so since the virtual domains are treated like a service - having init be able to handle respawning of things is a huge help17:51
brendan_we're loving upstart :)17:51
Keybukcool17:58
=== keesj_ is now known as keesj
sadmac2Keybuk: how's dbus support comming?21:08
Keybuksadmac2: haven't done much on it recently21:57
sadmac2Keybuk: ah.21:59
KeybukENOTIME21:59
sadmac2Keybuk: as soon as that and profiling/flags appears in some form in upstart I'm going to want to build trunk in rawhide so we can gear up for F10.22:00
sadmac2(F9 is in final release freeze now)22:00
Keybuk*nods*22:00
Keybukonce my Meteorology exam is out of the way, I'll probably have more spare time again ;)22:15
Keybukthough then I should really concentrate on Navigation22:15
Keybukstill aiming for a May release of 0.5 though22:15
sadmac2May is good22:30
sadmac2still waiting to hear about whether they're sending us to the con.22:30
sadmac2Keybuk: https://bugzilla.redhat.com/show_bug.cgi?id=43969922:36
sadmac2^^I'm a bit stumped by this one.22:36
jdongKeybuk: cool, you study meteorology?22:40

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