/srv/irclogs.ubuntu.com/2011/01/18/#upstart.txt

hackeronquick upstart question - when using exec, how do I execute a process as a different user?01:26
ionA future release of Upstart will have native support for that, but for now, e.g. something like exec su -s /bin/sh -c 'exec "$0" "$@"' username -- /path/to/command [parameters…]01:31
hackeronion: I see, I take it if I do that, then using chdir is kind of pointless in the service config file, right?01:35
hackeronand I created a new file /etc/init/xanview_backend.conf - how do I make it available as a service?01:38
hackeronah, service --status-all didn't show it, but initctl list did :) - service won't start though, where does upstart log errors?01:47
hackeronI'm trying to do: 01:53
hackeronexec su -s /bin/bash -c 'cd /opt/xanview; exec "$0" "$@"' xanview -- python run_core.py >/tmp/logfile.txt 2>/tmp/logfile.txt01:53
hackeronwhen I run it just says initctl: Job failed to start01:54
hackeronsame in syslog01:54
hackeronno log file is created :/01:54
hackeronany ideas?01:54
hackeronanyone here?02:16
ionPlease pastebin the job definition. Also, using /bin/bash there is not the best idea, as it most likely loads much more slowly than whatever /bin/sh you have.02:18
hackeronI got it working, there was a command that failed to run on pre-start script -- now trying to make it start after postgresql02:19
hackeronif I manually do start xanview_backend - it starts02:19
hackeronif I restart postgresql it stops and starts02:19
hackeronbut it won't start on boot :/02:19
hackeronI'm using this line: start on started postgresql until stopping postgresql02:19
hackeronand switching to sh, thanks02:20
ioninit(5) doesn’t say ‘until’ is a special word. That line means it starts on the ‘started postgresql until stopping postgresql’ event which probably never comes.02:21
ionstart on started postgresql02:21
ionstop on stopping postgresql02:21
hackeronthanks trying02:23
hackeronion: no go :( - any ideas? < http://pastie.org/147221502:26
hackeronion: it all works fine and stops/starts with postgres if I do start xanview_frontend - but it won't start on boot :(02:27
ionpostgres starts properly?02:28
hackeronhmm, actually status postgresql says unknown but  service --status-all shows  [ + ]  postgresql02:30
ionservice concerns sysvinit scripts, not Upstart jobs. You don’t seem to have a postgres job in your system.02:31
hackeronservice shows my xanview_frontend running - so seems to have upstart jobs as well as sysvinit?02:32
hackeronbut I'm guessing there is no such event as postgresql started02:32
hackeronany recommendations for an equivalent?02:33
ionA quick workaround would be adding ‘initctl emit starting-postgresql’ in /etc/init.d/postgresql-… just before the service is started and ‘initctl emit started-postgresql’ just after, as well as ‘initctl emit stopping-postgresql’ and ‘initctl emit stopped-postgresql’ around where the service is being stopped. Then use ‘start on starting-postgresql’ and ‘stop on stopped-postgresql’ in your job.02:35
hackeronion: oooh, very nice, thanks for that02:35
ionSorry, i mean ‘start on started-postgresql’ and ‘stop on stopping-postgresql’ of course.02:35
ionYou might want to do 'set -e; cd /opt/xanview; exec …' so that failure to change directory stops it from going forward. Or 'cd /opt/xanview && exec …', whichever you find nicer.02:39
hackeronadded :)02:40
hackeronwow, that is really beautiful02:43
hackeronthanks for your help :)02:43
ionA future version of Upstart will transparently handle legacy sysvinit scripts, but that’s still some time away.02:44
hackeronvery nice, now I see just how much better it is compared to sysvinit :)02:44
djszapiion: why is upstart used in so many projects if it is in childhood ?09:19
djszapioops, not for ion only ovb.09:19
djszapi* obv09:19
djszapiHow can I see pre-start exec $CSD pre-start like lines in upstart config jobs ?12:22
djszapiI was reading on the official website exec, processing should not occur in pre/post stuff, just preparetion + cleaning12:22
=== warly_ is now known as warly
iondjszapi: Millions of Ubuntu users have been running it for years with success.15:26
JanCupstart has all the features it needs to emulate sysvinit, so it can replace that in projects without problems15:33
JanCthen implementing more and more services as upstart jobs makes it clearer what is really needed15:36
JanCdjszapi: what you try to do seems to be something new & unpredicted, and is exactly the reason why it's a good idea to use it before it's "finished"  ;)15:39
djszapiJanC: do idea what you mean18:47
djszapiupstart misses basic features18:47
JanC"basic features" that aren't in most other init systems anyway?18:48
djszapiyour mean ?18:49
JanCconsidering tens of millions of people have been using upstart for 3 or 4 years now, and you are the first to complain about this particular feature, it can't be "basic"?18:51
djszapito print out a pid is not a basic thing ?18:52
djszapicome on :)18:52
JanCwhich doesn't mean the complaint is invalid, just not "basic usage"18:52
JanCit prints a PID18:52
JanCjust not the one you want  ;)18:52
djszapirotfl :D18:52
hackerondjszapi: it also misses being able to start a process as a different user :) - it misses loads of vital basic little things, but it's still the best we've got :)18:53
djszapinot for me18:53
djszapiaudit is bette for me right now18:53
hackeronlink?18:53
djszapisorry, but I am at home and I would like to focus for the KDE project :)18:53
djszapilet us speak about it during the daytime when I spend my time in the main job :P18:54
hackeronok, for now, link please?18:54
djszapihttp://google.com18:54
hackeronI tried, nothing18:54
JanChackeron: he needs teh PID of the shell that starts the daemon instead of the PID of the daemon18:54
djszapinot true18:54
djszapinot instead of the daemon18:55
JanCwell, in addition18:55
djszapiI just need that and that is all18:55
djszapinot a biggie.18:55
hackeronJanC: well, he said audit does it - I can't find this audit he's talking about :/18:55
JanChackeron: AFAIK he means http://people.redhat.com/sgrubb/audit/ 18:59
=== mezcaler1 is now known as mezcalero

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