[01:26] quick upstart question - when using exec, how do I execute a process as a different user? [01:31] A 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:35] ion: I see, I take it if I do that, then using chdir is kind of pointless in the service config file, right? [01:38] and I created a new file /etc/init/xanview_backend.conf - how do I make it available as a service? [01:47] ah, service --status-all didn't show it, but initctl list did :) - service won't start though, where does upstart log errors? [01:53] I'm trying to do: [01:53] exec su -s /bin/bash -c 'cd /opt/xanview; exec "$0" "$@"' xanview -- python run_core.py >/tmp/logfile.txt 2>/tmp/logfile.txt [01:54] when I run it just says initctl: Job failed to start [01:54] same in syslog [01:54] no log file is created :/ [01:54] any ideas? [02:16] anyone here? [02:18] Please 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:19] I got it working, there was a command that failed to run on pre-start script -- now trying to make it start after postgresql [02:19] if I manually do start xanview_backend - it starts [02:19] if I restart postgresql it stops and starts [02:19] but it won't start on boot :/ [02:19] I'm using this line: start on started postgresql until stopping postgresql [02:20] and switching to sh, thanks [02:21] init(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] start on started postgresql [02:21] stop on stopping postgresql [02:23] thanks trying [02:26] ion: no go :( - any ideas? < http://pastie.org/1472215 [02:27] ion: it all works fine and stops/starts with postgres if I do start xanview_frontend - but it won't start on boot :( [02:28] postgres starts properly? [02:30] hmm, actually status postgresql says unknown but service --status-all shows [ + ] postgresql [02:31] service concerns sysvinit scripts, not Upstart jobs. You don’t seem to have a postgres job in your system. [02:32] service shows my xanview_frontend running - so seems to have upstart jobs as well as sysvinit? [02:32] but I'm guessing there is no such event as postgresql started [02:33] any recommendations for an equivalent? [02:35] A 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] ion: oooh, very nice, thanks for that [02:35] Sorry, i mean ‘start on started-postgresql’ and ‘stop on stopping-postgresql’ of course. [02:39] You 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:40] added :) [02:43] wow, that is really beautiful [02:43] thanks for your help :) [02:44] A future version of Upstart will transparently handle legacy sysvinit scripts, but that’s still some time away. [02:44] very nice, now I see just how much better it is compared to sysvinit :) [09:19] ion: why is upstart used in so many projects if it is in childhood ? [09:19] oops, not for ion only ovb. [09:19] * obv [12:22] How can I see pre-start exec $CSD pre-start like lines in upstart config jobs ? [12:22] I was reading on the official website exec, processing should not occur in pre/post stuff, just preparetion + cleaning === warly_ is now known as warly [15:26] djszapi: Millions of Ubuntu users have been running it for years with success. [15:33] upstart has all the features it needs to emulate sysvinit, so it can replace that in projects without problems [15:36] then implementing more and more services as upstart jobs makes it clearer what is really needed [15:39] djszapi: 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" ;) [18:47] JanC: do idea what you mean [18:47] upstart misses basic features [18:48] "basic features" that aren't in most other init systems anyway? [18:49] your mean ? [18:51] considering 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:52] to print out a pid is not a basic thing ? [18:52] come on :) [18:52] which doesn't mean the complaint is invalid, just not "basic usage" [18:52] it prints a PID [18:52] just not the one you want ;) [18:52] rotfl :D [18:53] djszapi: 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] not for me [18:53] audit is bette for me right now [18:53] link? [18:53] sorry, but I am at home and I would like to focus for the KDE project :) [18:54] let us speak about it during the daytime when I spend my time in the main job :P [18:54] ok, for now, link please? [18:54] http://google.com [18:54] I tried, nothing [18:54] hackeron: he needs teh PID of the shell that starts the daemon instead of the PID of the daemon [18:54] not true [18:55] not instead of the daemon [18:55] well, in addition [18:55] I just need that and that is all [18:55] not a biggie. [18:55] JanC: well, he said audit does it - I can't find this audit he's talking about :/ [18:59] hackeron: AFAIK he means http://people.redhat.com/sgrubb/audit/ === mezcaler1 is now known as mezcalero