#upstart 2007-08-20
* Starting logfile irclogs/upstart.log
<mbiebl> Keybuk: it's been very quite around upstart lately. What's the current status? Are you just busy with other things?
<vlt> Hello. Afer an upgrade from Edgy to Feisty the system only boots to runlevel "unknown". I have to run `telinit 3` (sic!) to run all the daemons listed in /etc/rc3.d/ -- `telinit 2` leads to "unknown", too. apt-get dist-upgrade returns "0 ..., 0 ..., 0 ..., 0 ..." so everything should be in a proper state. Any idea how to fix upstart?
#upstart 2009-08-17
<kindjal> I have upstart 0.6.2 successfully starting up and running rc.sysinit, but for some reason, tty1.conf won't start mingetty on runlevel 3. mingetty on tty1 only works if I "start on startup".
<kindjal> Is this to be expected?
<kindjal> maybe something about rc-sysinit.conf having "console owner"?
<sadmac2> kindjal: could be that
<kindjal> Is there a known "standard" tty1.conf job file?
<sadmac2> kindjal: I thought 0.6 shipped with examples for one
<kindjal> nope
<kindjal> ./conf dir has a few .conf files...
<kindjal> none for gettys
<sadmac2> kindjal: look at what ubuntu has then
<kindjal> Alright
<kindjal> does it matter that they have upstart 0.3.9 vs. 0.6.2
<kindjal> I have an ubuntu 9.04 box...
<sadmac2> kindjal: it does, but they should be in a hurry to get 0.6. Check their upstream on launchpad.
<kindjal> yeah I found them
<kindjal> thanks for the tip
<sadmac2> np
<sadmac2> Keybuk: around?
#upstart 2009-08-18
<sadmac2> ion: you wouldn't happen to know where Keybuk is, would you? seems he vanished.
<sadmac2> Karmic has a freeze in 9 days...
<ion> Iâm afraid i have no idea.
<sadmac2> well damn.
#upstart 2009-08-20
<keesj> Hi
<keesj> I am trying to cross compile upstart, for that I would need the nih-dbus-tools to be compiled for the host target and not the target target. did anybody corss compile 0.6.3?
<Hatrix> Keybuk: hello keybuk, i was reading some time ago an email from yours where you explain that actually in septembre upstart will be in a state to act as a supervise daemon, is this right on track? As I have to make some decisions regarding a client and what I am going to use to daemon supervising, as I really HATE the djb supervise tool thingy i would LOVE to use upstart
<ion> Upstart can already do that for simple cases.
<ion> It always has. It just hasnât been ready for booting the entire system as Upstart jobs.
<Hatrix> i can not use it for daemons which forks into the background  ... ?
<ion> 0.6 has somewhat working support for it, although 0.10 will do it much better.
<Hatrix> hmmm, how do i use it for this forking daemons? i could not get it to work as as soon as the daemon forked, upstart did not now anything about it (state, pid, ...)
<plautrba_> Hatrix: you can use expect stanza with daemon or fork, then proccess should be traced for forks by ptrace() 
<Hatrix> hmmmm
<Hatrix> i did not know about the expect stanza, where is the docu for the current stanzas anyway, anyone knows? (besides of the source ...)
<Keybuk> Hatrix: man 5 upstart
<Hatrix> ray@dev-01:~$ man 5 upstart
<Hatrix> No manual entry for upstart in section 5
<Hatrix> hmm, seams in my debian upstart 06.2.1-1 package are no manpages ... hmmm
<Hatrix> nope, section 5 missing ... ok, i'l grab the source, thanks 
<Keybuk> err, man 5 init sorry
<ion> Which reminds me, i should finish my Upstart manpage changes and post a patch.
<sadmac2> Keybuk: you're alive! er.. hi.
<Hatrix> got it now ... so expect daemon is if it's running from an init-script, and therefore forks twice and expect fork is a direct call to the daemon, am i right?
<Hatrix> and, fearing being kicked of the channel, but, when will the 0.10 be useable, any ideas?
<ion> keybuk: Would you mind reformatting all the manpages with your editor (ctrl-meta-z-7-skull-and-crossbones-Ã¥-5 or whatever) and committing that change, so i can emulate the proper formatting in my changes?
<sadmac2> ion: nobody spells it out like that. C-M-z-7-â -Ã¥-5
<ion> Ah
<ion> Forgive my lack of emacs-fu
<sadmac2> ion: in vim its just :piratedance
<ion> One can come up with somewhat obscure things with vim, too. :-P 2006-06-02 17:16:13 < _ion> Vip:norm W"xyE$T_D"xp;gU$
<ion> Looking at the IRC log, i typed the line "    normal = Gtk::STATE_NORMAL", duplicated it a few times, replacing normal with active, insensitive, prelight etc. and then wrote that command to replace the Gtk::STATE_* entries with the respective equivalents.
<sadmac2> ion: I can't make it work
<sadmac2> where did you start?
<ion> Vip should âpaintâ the whole block first, then :norm should do the list of normal-mode commands for each selected line.
<sadmac2> ion: that can't be right... maybe I need to be in C++ mode or it doesn't work.
<ion> V should start selecting lines, and ip should select the current âparagraphâ.
<sadmac2> yep
<ion> Then :norm applies to that selection
<sadmac2> yep
<sadmac2> and the results are borked
<ion> Did you have the indentation? Without it, you need to drop the W
<sadmac2> ah.
<sadmac2> ion: this is what macros are for btw.
<sadmac2> probably would have just typed out the inital words and then started with '<,'>s/.*/\0 = Gtk::STATE_\0/
<ion> Not much difference between :norm and macros. The difference only starts to show when the changes are so complex you need to see them happening while typing the commands.
<sadmac2> then gone about uppercasing
<sadmac2> ion: for your method I probably would have had a macro to do it to one line then done :norm @q
<ion> In fact, you could have uppercased them within the expression. :s/.*/\0 = Gtk::STATE_\U\0/
<sadmac2> oh that's right.
<ion> But that would have missed the
<ion> somethinglong = blah
<ion> short         = blah
<ion> formatting :-P
<sadmac2> not big on that anyway. I end up spending more time on whitespace than code.
<sadmac2> ls
<sadmac2> ...well its been awhile since that's happened
<ion> rm -fr ~
<sadmac2> ion: ...you seem to be confused as to how this works
<wasabi> byxnet.net
<wasabi> Oops
#upstart 2009-08-22
<Stevee> hello, iÂ´ve some problems with upstart and shutdown the system
<Stevee> iÂ´ve written some jobs for that, but I think there is something missing
<Stevee> the shutdown itself takes just some seconds
<Stevee> and the system powerd off
<Stevee> iÂ´m using upstart 0.6.3 without compatiblity mode
<Stevee> hello, iÂ´ve a question about upstart and the variables
<Stevee> especially UPSTART_JOB and UPSTART_EVENTS
#upstart 2009-08-23
<Stevee> hello, iÂ´ve a question on upstart and the variables UPSTART_JOB and UPSTART_EVENTS
<Stevee> is it possible to check with job or events started an other job
<Stevee> and to put this information into an if function ?
<Stevee> i need that at the end of the shutdown job
<Stevee> so reboot or to shutdown the system
<Stevee> hello, anybody here at the moment ?
#upstart 2010-08-23
<kklimonda> hey, what's the status of 0.10? It were mentioned on the last uds but since then there were no new info about it.
<Stevee> oh, new information about the next rel. would be great
<ion> Keybuk said it wonât be ready in time for Ubuntu 10.10. Heâs still working on it.
<kklimonda> ion: Is He doing it behind closed doors? there are no commits in lp:upstart
<ion> Alas, yeah.
<ashb> fail. is this opensoruce or what?
<marcc> what's the strategy if I want to log the output of a job?
<Stevee> i don't know, but i also think, that a more transparend development process would be good
#upstart 2010-08-25
<robinsmidsrod> is it possible to redirect output (stderr/stdout) to a file or syslog in upstart 0.3.9 (as bundled by ubuntu 8.04)?
#upstart 2010-08-26
<fancybit> hi
<robinsmidsrod> how can I make upstart jobs output stderr/stdout to syslog?
#upstart 2010-08-27
<robinsmidsrod> are there any plans to allow upstart to start specific jobs as a specific user?
<ion> yes
<robinsmidsrod> having to use "su" to switch user and then running the command keeps a lot of su processes running, and the pid reported by upstart is actually the su process instead of the actual app
<ion> yep
<ashb> robinsmidsrod: sudo instead of su might work slightly better, no?
<warly> Hello, I have a simple question regarding writing upstart command. I would like to have a script run when entering runlevel 4, and run again when quitting runlevel 4, is there a way to do that with upstart ?
<ashb> stats on runlevel[4]
<ashb> or similar
<warly> stats ?
<warly> You may mean start. Actually starting the script on entering runlevel 4 is ok, but I cannot really manage to have it run again when leaving runlevel 4
<ion> start on runlevel 4
<ion> stop on runlevel [!4]
<ion> post-start exec yourthing
<ion> pre-stop exec yourthing
<warly> ion: thanks I will try that!
<ion> Actually, maybe make that pre-start and post-stop.
<fancybit> hi
<fancybit> my ubuntu don't have the /etc/inittab file, so where should I start my reading of the script?
<fancybit> I browsed the web of upstart, seems no manual but only blueprints 
<fancybit> That's the only way to study?
<fancybit> ...
<warly> fancybit: have you looked at http://upstart.ubuntu.com/wiki/ ?
<fancybit> yes
<salman> Hi. I'm trying to find some documentation on how to implement the equivalent of kb::kbrequest in an upstart script... could someone link me to the docs?
<salman> tried a wiki search but nothing turned up
#upstart 2010-08-28
<eivanov> Hi! Specs on wiki looks "mixed" with implemented and to be implemented things. Am I right? Then any other documentation?
<ion> The man pages
<eivanov> Well I was looking for something like Remnant's blog posts.
<JanC> which blog posts?
<JanC> for the current version, the manpages should document the "implemented things"
<eivanov> JanC: e.g. http://www.netsplit.com/2006/12/14/upstart-0-3/
<eivanov> It's good to read about upstart in common.
<eivanov> But you're right, I missed man pages and they're really good.
<phil> hiho
<JanC> eivanov: Upstart 0.3 is very old
<phil> I am currently trying to add a custom script to execute when switching to runlevel 0
<eivanov> JanC: yeah, but I have to work with it, at least now.
<JanC> eivanov:  :-(
<phil> i can't seem to find an /etc/event.d , but rc?.d/ misses services, so i think i do have upstart installed, but where the heck? ubuntu 10.04 LTS
<JanC> phil: upstart uses /etc/init/ now
<JanC> as is documented in the manpage...
<phil> sorry, i see now
<phil> i'm familiar with the old style but didn't dig into linux that much since
<JanC> if you need to change/add services, see 'man 5 init' for the new syntax
<phil> is there something like pre-stop?
<ion> Yes, pre-stop.
<phil> nice
<phil> is a change to a script in effect instantly?
<eivanov> 0.3.5 man pages are really poor :(
<phil> how can i make sure a script is executed very early in the shutdown process?
<ion> Why?
<phil> i asked first :P
<phil> i want to execute a custom script before a service shuts down
<phil> added it to the service in pre-stop but that does not seem to do the trick, probably because dependencies are not met any more
<phil> so if  i could just do it first in a shutdown sequence it is solved
<phil> now you :P
<ion> pre-stop should be the right thing. What do you mean by dependencies not being met?
<phil> it's a python script, uses mysql db i.e.
<phil> so if mysql is shut down you know what happens
<ion> The job should have âstop on stopping mysqlâ or however the mysql job is named.
<phil> thanks
<ion> âstop on fooâ causes the stopping of your job to block the foo event.
#upstart 2010-08-29
<eivanov> I want a service without exec/script. I have pre-start, post-stop scripts and instance (similar to network-interface.conf). After I start this service it dies (status is stopped/waiting). What's wrong? 
<eivanov> pre-start/post-stop are almost empty (just an echo to file). I want to add "initctl emit" to both.
<eivanov> Oops, I confused post-stop and pre-stop
<eivanov> sorry
<eivanov> I have following job to control failures of another job: http://pastebin.com/d4p559M6  When I kill fake_apache (or it exists abnormally) it's respawned, but the log is empty... What's wrong?
<eivanov> stopped is generated, but not stopped failed. Why?
<frederickjh> When upstart jobs or sysvinit scripts run which runs them  su  or sudo?
<frederickjh> I am dealing with a pam.d authenication  problem and am trying to assign the proper permissions to the correct one.
<JanC_> frederickjh: upstart runs as root, so no su/sudo is needed?
<frederickjh> Thanks I already figured that out, however pam.d is not letting my program start with real time priorities unless the user the daemon runs as start it.
<JanC> you can always use su or sudo yourself of course
#upstart 2011-08-23
<dcorbin_work> What event is emitted when an upstart script is started?
<jhunt_> dcorbin_work: this is covered in all the docs. See "man 5 init", "man 8 init", "man upstart", "man upstart-events" or http://upstart.ubuntu.com/cookbook/#job-lifecycle
<JanC> dcorbin_work: "upstart script" is a dangerous/confusing phrase to use  ;)
#upstart 2011-08-24
<dcorbin_work> JanC: What is an appropriate term to use?  Configuration?
<dcorbin_work> JanC: I'm referring to the entire file of information.
<dcorbin_work> started events seem a tad different than the general case.  I can "initctl emit foo", or "initctl emit foo A=B", but I don't seem to be able to admit "initctl emit foo started"
<jhunt_> dcorbin_work: I would suggest reading "man 8 initctl" and the cookbook. You don't emit the started event - upstart does it for you when you run "start foo".
<dcorbin_work> jhunt_: I have been looking through them. I'm trying to integrate an old-style init script with upstart jobs(?).  It would be nice if the start condition was independent of what the other script was.
<jhunt_> dcorbin_work: so, you're not trying to convert a sysv service to an upstart job, you're trying to trigger an upstart job when a sysv service starts?
<wraiden> dcorbin_work: use "initctl emit started JOB=jobname INSTANCE=" like documented in  "man 5 started"
#upstart 2011-08-26
<jY> should upstart automatically start the process if it is dead?
#upstart 2011-08-27
<ryoohki> is sysv-rc-conf the recommended way to turn off unwanted services?
<ryoohki> or are you supposed to edit the files in /etc/init?
#upstart 2011-08-28
<fasta> How can I list all upstart events?
#upstart 2012-08-20
<cco3> When I do "setuid someuser", that user doesn't seem to have environment variables like $USER set...is this intentional?
#upstart 2012-08-21
<Tv_> any help on how to use the socket bridge *and* let the daemon safely exit when idle? i haven't figured out a race-free version yet
<SpamapS> cco31: yes thats intentional. Those are set by login shells.
<SpamapS> cco31: easy enough to set wth 'env USER=xxx'
<cco31> SpamapS: ok, that's what I did.  Thanks.
#upstart 2012-08-22
<tjaalton> hi, I can't get logger/console output to work on a job pre-script, did everything as on the cookbook
<tjaalton> hmm wait
<tjaalton> just realized it probably doesn't do what I wanted
<tjaalton> there's no way to print an error when a service is started by hand?
<tjaalton> currently, it just says "foo start/running" when it actually fails to start
<tjaalton> and another start run fails by "job is already running: foo"
<SpamapS> tjaalton: not sure I understand your question
<tjaalton> SpamapS: if i run 'start foo', can the job print the error on the stderr?
<SpamapS> tjaalton: errors go into the logs for the most part
<SpamapS> tjaalton: no there's no way currently
<tjaalton> ok
#upstart 2012-08-23
<thatguydan> Hey gents, I was hoping someone could help WRT the right way to execute a command as another user in a script stanza while preserving /etc/environment
<thatguydan> exec sudo -u user1 -i "/usr/bin/foo /opt/bar >> /var/log/bar.log 2>&1" works in shell, but doesn't in the upstart script
<thatguydan> and I can't for the life up me get it working with su
<thatguydan> I was trying to source the environment from /etc/environment.local, but I was having problems getting upstart to monitor the right PID
<thatguydan> It was working if I sourced from /etc/environment.local with su, but no love with the PID's, that's why I'm trying to get it going with sudo
<thatguydan> I've spent about a day on this, and the more I read the less I know
<thatguydan> Is it at all possible to run a command as another user with upstart?
<jodh> thatguydan: http://upstart.ubuntu.com/cookbook/#run-a-job-as-a-different-user
<thatguydan> I've tried the su way of doing it, but stopping the service just leads the bash/su being killed, not the actual command i'm trying to run
<thatguydan> su -s /bin/sh -c 'exec "$0" "$@"' username -- /path/to/command 
<thatguydan> that just did it
<thatguydan> found after hours of reading
<thatguydan> i can't believe the use case of running a command as non-privileged and passing through environment variables is so difficult to accomplish
<thatguydan> or at least it was for me
<thatguydan> i might be an idiot though
<pixie79> hi, it there a way to have two variables passed to an upstart job, i see we have instance which would allow one variable but i also need to import a second for example customer
<SpamapS> you can pass as many variables as you want
<SpamapS> pix	instance expands all variables
<SpamapS> pixie79: ^^
<SpamapS> pixie79: so you can have instance $VAR1$VAR2$VAR3
<pixie79> ok then i take it to start the job i would do something like, 'start job TTY=1 cust=demo'
<SpamapS> pixie79: exactly
<pixie79> thanks
<SpamapS> pixie79: note that if you have a 'start on' line you can also pick up any exported variables from jobs that cause you to start
<pixie79> ok
<pixie79> SpamapS: is there a way to require that the variables have both been given otherwise refuse to start?
<SpamapS> pixie79: yes in pre-start you can check for them and if they're not set just run 'stop; exit 0;'
<pixie79> ok thanks
<pixie79> SpamapS: does this look ok? http://pastie.org/4575169
<pixie79> at the moment when i run it i am getting unknown job
<pixie79> back later to fix my pre-start script
<SpamapS> pixie79: you can try 'init-checkconf /etc/init/yourjob.conf'
<SpamapS> pixwell if pixie79 comes back.. I think he fell victim to bug 328366
<SpamapS> s/he/they/ :-P
#upstart 2012-08-24
<pixie79> hi, can i create an env variable inside a pre-script whose variable is set by the output of a program, i.e env DATE=`date`
<pixie79> as I have been trying but seem to get left with an empty variable
<ion> If you add âprintf "%s\n" "$DATE" >/tmp/fooâ after that, what will /tmp/foo contain?
<pixie79> ion, i had been doing echo "TZ:$TZ" >> /tmp/tz which just gave me TZ:
<ion> Oh, also: you might want just âDATE="$(date)"â or âexport DATE="$(date)"â in an sh script.
<ion> Certainly not âenvâ in front of it.
<pixie79> ok thanks that is correct, do i not need the 'env' in order to make is an environment variable which i can set for the main exec, ( i need to set the Timezone) the exec runs under
<pixie79> hm, is this correct to check if a file exists and if it does not then exit printing a warning to daemon log. At the moment it seems to be stopping me when the file exists and printing nothing  [ ! -e $COMPFI ] && { echo "please enter CUST and COMP correctly" | logger -t CASS -p daemon.info ; stop; exit 0; }
<ion> Alas, you canât teleport environment variables between scripts just by setting them. Youâll need to set them in the main script and exec the final program in the end.
<pixie79> ion ok, in that case i will move the tz to a main script, 
<ion> You might want to add something like this to the beginning of the script to debug it:
<ion> exec >/tmp/jobname.out 2>&1
<ion> set -x
<pixie79> thanks - i had not seen the exec/set -x before, looks useful, 
<pixie79> ion: are these expecting bash style tests or something else ? as I am trying '!-e' to stop if the file does not exist
<ion> if ! [ -e "$file" ]; then stop; exit; fi or something.
<pixie79> ok that seems to be working better, now i just need to work out how to set the environment variable TZ so that when i exec the correct timezone is set, I have the value $TZ in the main script now correctly
<pixie79> if i do: 'exec TZ=$TZ date' then i get an error that is tries to exec /TZ=Europe/London
<ion> export TZ
<ion> exec date
<pixie79> arh - thanks thought i had tried that one :)
<pixie79> ion: thanks for your help - i now have a working script, 1 down 2 to fix :)
#upstart 2012-08-26
<kontinuity> hi all
<kontinuity> can someone please explain to me what run level [23] means? I thought there were 6
<kontinuity> I see it in the cookbooks and all examples
<pulz> whats the best way to find out why upstart report wrong status for my service (it says running but it has crashed)  having trouble finding proper doc on this subject
<pulz> im assuimg this is beacuse the process crashes before upstart gets a pid to track, but is there any workaround ? 
<yatesy> kontinuity: to answer your earlier question, i think it refers to level 2 OR 3 (rather than 23 which as you say doesn't exist)
<kontinuity> yatesy: either 2 or 3 makes sense instead of 23 but what does 2 or 3 mean? when will it execute?
<yatesy> kontinuity: if you have "start on runlevel [23]" then the job will be started when the system is in runlevel 2 OR 3
<yatesy> kontinuity: see http://upstart.ubuntu.com/cookbook/#runlevels
<kontinuity> yatesy: thanks!
<SpamapS> pulz: are you using 'expect fork' ?
<SpamapS> pulz: it is very problematic if the process does not fork the way upstart expects it to
<SpamapS> pulz: if status shows a pid that does not exist, then its possible that your process needs to use 'expect daemon', or perhaps shouldn't even use expect anything
<pulz> SpamapS: im using expect fork, and im not getting an pid at startup either
<pulz> so it dies to fast
<pulz> expect daemon yields the same results 
<JanC> if you can run it without forking, that simplifies things
<pulz> JanC: what are you thinking about ?
<JanC> pulz: some applications have an option to not run in the background (so no fork), which might make it easier to debug
<pulz> JanC: im telling it to daemonize 
<pulz> so im open for tips for how to debug it
<JanC> try not to daemonize it
<JanC> and remove any expect fork/daemon stanzas
<pulz> that helped
<pulz> now it gave me a pid
<pulz> atleast
<pulz> and its giving me the correct info
<JanC> maybe using start-stop-daemon as a helper
<JanC> but indeed, it should not lose track of the correct PID when doing that
<pulz> hmm should it still use expect daemon ?
<JanC> if it doesn't fork: no
<JanC> expect daemon = expect double fork IIRC
<pulz> ah
<pulz> whats the best way to double check it ?
<pulz> when using start-stop-daemon as helper and deamon values to the app seems to be working, but is it the correct way to work 
#upstart 2013-08-20
<jmux> Hi. Im on Ubuntu 12.04. I'm using FAI for software updates and want to run FAI on boot and trigger a reboot after the system was updated. Currently my job starts on starting kdm to run before X. Calling reboot just deadlocks the system in a state of starting an stopping jobs. How can I reboot my system from within an upstart job?
<jmux> joint #kubuntu-devel
<xnox> jmux: can you paste your job?
<jmux> xnox: http://paste.ubuntu.com/6005780/ and http://paste.ubuntu.com/6005791/
<jmux> xnox: the first script is the upstart job, the second the actual script (/etc/init.d/goto-configure-online). The FAI call is at the end of the second script (fai -N softupdate).
<xnox> jmux: that looks weird. usually scripts under /etc/init.d/* are started as normal sysv-init scripts by upstart when it is ready. Your start on condition for network is not deterministic. 
<xnox> jmux: maybe "start on (local-filesystems and net-device-up IFACE!=lo)" is better as you will have network at that point.
<xnox> jmux: you only need to reboot if "/var/run/reboot-required" is present after upgrades.
<xnox> jmux: instead of FAI, i'd use unattended-upgrades and cron those instead.
<xnox> jmux: with respect to hang debug the script & environment it's running under. is it expecting input or some other environment vars?
<xnox> jmux: instead of starting your init.d script from the upstart job: add proper LSB headers, remove upstart job, and let the init.d script be started by sysv-init.
<jmux> xnox: probably - this is an old job originating from 10.04 :-)
<xnox> as it should be.
<xnox> jmux: it looks very odd. in 12.04 there are many improvements for sssd/slapd et.al.  i'd start splitting that mega script into smaller chunks / separate jobs. whilst carefully considering if all the chunks are still needed.
<jmux> xnox: I'm fixed on FAI and the update has to run on boot. The update is triggered via a variable in LDAP.
<xnox> jmux: i see.
<jmux> Just some background - this is running on a client, we have our own APT repositories and we just update during startup, especially if you do a dist-upgrade from a previous release.. So back to my original problem - is there a way to reboot my machine from within an upstart job without deadlocking upstart? 
<xnox> jmux: one can. e.g. cloud-init has ability to apply updates and reboot the machine. but it does it before starting $most of the sysv-init scripts. One would reboot with "reboot", not "poweroff".
<jmux> xnox: ok - I'll check cloud-init and adopt my upstart jobs to the new "have network" dependency.
<jmux> I don't think there is a big difference between reboot or poweroff for upstart.
<xnox> jmux: poweroff cuts the power to the machine. and it doesn't come back up. with reboot it does.
<xnox> jmux: this may have been different in the past, but with newer kernels that's what the behaviour is.
<xnox> (and should be)
<jmux> xnox: yeah - I know :-) But from the upstart POV it just has to stop all jobs and prevent new jobs from starting, which it currently fails to handle, at least on 12.04.
<xnox> jmux: oh I see. so upstart stops all the jobs that it manages, and then changes the runlevel to stop all the init.d scripts. At that point sendsigs/syv-init completes the shutdown sequences.
<xnox> jmux: those init.d scripts can hang the shutdown, and unfortunately it's outside of upstart's control at that point (upstart is not running any more)
<xnox> increasing the upstart logging (e.g. boot with kernelarg --debug) should show if it's upstart job that hang.
<jmux> xnox: I'll check that and report back, but it may take a few minutes.
#upstart 2013-08-21
<ggl> I'm looking to run a python daemon that needs to source a python virtualenv environment to run.  This is trivial in init.d but I'm not figuring it out in upstart.  I have tried several of the script examples from the cookbook.
<ggl> Most of the environment in the virtualenv world is in bash as well and won't run under /bin/sh
#upstart 2013-08-22
<wrouesnel> is there a way to "shim" or extend a particular upstart script? I'd like to have a script that runs after say, mountall has executed but before it emits any other events or actions
<jamescarr> how can I stop an upstart job that claims it is running but the program has actually exited
<Aric> I made a .conf file in /etc/init and did start job name, it said started but I don't see it running
<jodh> Aric: can we see the job?
<Aric> sure
<Aric> http://pastie.org/private/jf5xpx4vaceaohig3bd3w
<Aric> status gives > meteor-subh start/running
<Aric> I made 7 of these very similar? like "meteor-ussunnah-www start/running, process 28231"
<jodh> Aric: that "cd /var/www/subh/" won't work - the main stanza that calls meteor will run in '/'. The solution is to remove the pre-start and add 'chdir /var/www/subh/' to your job.
<Aric> so do it in a script end script?
<jodh> Aric: no, do what I've said above.
<jodh> Aric: 'chdir' is an upstart stanza (keyword). so your job can essentially become:
<jodh> chdir /var/www/subh
<Aric> http://pastie.org/private/5q4tgxezkuuxwgffdo0wq
<jodh> exec meteor --port 3400
<Aric> like that? i haven't used oure bash much
<Aric> pure*
<jodh> Aric: yes
<Aric> ty jodh i'll try that
<jodh> Aric: the 'chdir' is not bash - it's upstart syntax.
<Aric> ok
<Aric> now i'm getting "start: Unknown job: meteor-subh"
<jodh> Aric: run "init-checkconf /etc/init/your-job.conf"
<Aric> ok
<Aric> ERROR: cannot run as root
<jodh> Aric: as it says, run it as a non-root user.
<Aric> ok
<Aric> created a user for it and now on start got:
<Aric> start: Rejected send message, 1 matched rules; type="method_call", sender=":1.19" (uid=1000 pid=29067 comm="start meteor-subh ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
<Aric> ERROR: cannot find dbus-launch
<jodh> Aric: looks like you are logged into a server remotely? try running it locally on a system with dbus installe.d
<Aric> i have to ssh to this server, it's my web server
<jodh> Aric: somehow, your changes have invalidated that job. If you cannot run init-checkconf on a system with dbus (any ubuntu desktop say), can you paste the updated job again?
<Aric> this is a server, no gui
<Aric> ubuntu server
<Aric> here is the job
<Aric> http://pastie.org/private/5nu7mljokrgcuwc6688a
<jodh> meteor-subh"
<jodh> Aric: that job is valid. are you sure it's called /etc/init/meteor-subh.conf?
<Aric> root@web:/etc/init# cat meteor-subh.conf 
<Aric> was how i got it  for the pastie
<Aric> when i run it as root i get no errors but it doesn't work because I'm root
<Aric> root@web:/etc/init# start meteor-subh
<Aric> meteor-subh start/running
<Aric> then:
<Aric> root@web:/etc/init# sudo -u upstart start meteor-subh
<Aric> start: Rejected send message, 1 matched rules; type="method_call", sender=":1.25" (uid=1000 pid=29471 comm="start meteor-subh ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
<jodh> Aric: only root can start system jobs, hence it won't work as user upstart.
<Aric> root@web:/etc/init# init-checkconf /etc/init/meteor-subh.conf 
<Aric> ERROR: cannot run as root
<Aric> so if i can't start it as upstart or root than?
<jodh> Aric: forget that tool for now - that's not trying to start the job.
<jodh> Aric: your job is running - you've shown us above.
<Aric> hmm but the meteor server never got started
<Aric> if i go to the directory and type meteor --port 3400
<Aric> it works fine
<jodh> sudo cat /var/log/upstart/meteor-subh.log
<Aric> /usr/local/bin/meteor: line 34: HOME: unbound variable
<Aric> hmm
<Aric> i'll check with the meteor guys
<Aric> ty for your help
<jodh> Aric: that topic is covered extensively in the cookbook. See: http://upstart.ubuntu.com/cookbook/#checking-how-a-service-might-react-when-run-as-a-job, http://upstart.ubuntu.com/cookbook/#see-the-environment-a-job-runs-in, http://upstart.ubuntu.com/cookbook/#determining-why-your-service-fails-to-start
<Aric> ty jodh 
<jodh> Aric: if it's just HOME, then add "env HOME=/home/..." to the job.
<Aric> would home be my apps directory right?
<jodh> Aric: if the job is not designed to run as root (and I'm guessing it isn't since it needs HOME), look at the 'setuid' and 'setgid' stanzas in the cookbook or "man 5 init".
<jodh> Aric: I have no idea what meteor expects it to be set to.
<Aric> ok
<blake> my script just hangs on 'service [scriptname] start/stop'... even if the only line in it is 'exec cd .' (ubuntu 12.04 amd64 server)
#upstart 2013-08-23
<checkers> I'm having problems debugging an issue where upstart hangs indefinitely when I try to start a job (rsyslog). how can I troubleshoot this?
<checkers> the debugging page on the wiki seems to be all about debugging boot time issues
<checkers> it almost seems like upstart hangs when sending the command over dbus
<JanC> checkers: Ubuntu uses rsyslog, so you might want to compare your job configuration for it with that in Ubuntu
<checkers> JanC: actually I am using ubuntu's rsyslog and just messed with its internal configuration, trying to figure out what's with the hanging
 * checkers pokes JanC 
<checkers> sorry, just totally stuck on this issue. I can start rsyslogd by hand using the same user/commandline as the upstart job, and upstart works for all other services just fine... completely weird. it seems to hang even start from a fresh ubuntu configuration now
<caleress> hi guys i have an upstart script that works on 12.04 but fails on 10.04 :/
<caleress> its just a basic run as different user
<caleress> exec start-stop-daemon --start -c dev --exec /opt/dev/test.sh
<caleress> any ideas ?
<xnox> don't use start-stop-daemon in an upstart script.
<xnox> well upstart job.
<caleress> isnt that the recommended way to do it ?
<caleress> http://upstart.ubuntu.com/cookbook/#changing-user
<caleress> the cookbook says so
<caleress> but it looks like my script doesnt even get executed as root
<caleress> start on startup
<caleress> exec /opt/dev/test.sh
<jodh> caleress: presumably the "dev" user exists on your 10.04 system?
<caleress> stop on runlevel [016]
<caleress> yes ofc
<caleress> same script runs on 12.04
<jodh> caleress: are you *sure* you want it to start that early? there isn't even a writeable disk at that point.
<jodh> caleress: 'start on runlevel [2345]' is much more conventional.
<caleress> ok
<caleress> i use it to start jboss
<jodh> caleress: you are starting the job too early then.
<jodh> caleress: See http://upstart.ubuntu.com/cookbook/#normal-start.
<caleress> ok i changed it
<caleress> but the script still doesnt run :p
<caleress> "sudo start script" and nothing happens
<jodh> caleress: run "sudo start foo" where foo is /etc/init/foo.conf
<jodh> caleress: ah - sorry. when you say "nothing" you mean no output or it hangs?
<caleress> no ouput basically and jboss doesnt start
<caleress> i tried "sudo start jboss"
<jodh> caleress: Look at http://upstart.ubuntu.com/cookbook/#see-the-environment-a-job-runs-in, http://upstart.ubuntu.com/cookbook/#checking-how-a-service-might-react-when-run-as-a-job, http://upstart.ubuntu.com/cookbook/#determining-why-your-service-fails-to-start
<jodh> caleress: have you looked at the jboss logs?
<caleress> yeah its like it never started
<caleress> PATH='/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin'
<caleress> well this look like java is missing from the path
<caleress> any ideas how to set this ? :)
<jodh> caleress: everything is in the cookbook :)
<caleress> haha i can imagine :p
<jodh> caleress: 'env PATH=/foo:/bar:/baz'
<caleress> so i set it basically the same as with export
<caleress> yeah still doesnt start :/
<jodh> caleress: have you read and tried the checks in the 3 links above ?
<caleress> checking env now
<caleress> procenv: command not found
<caleress> ridicilious
<jodh> caleress: procenv isn't in the 10.04 archive - you should be able to download and build it easily enough though - it's only a single C file. But for speed, just use "set" or "env".
<jodh> http://upstart.ubuntu.com/cookbook/#see-the-environment-a-job-runs-in
<caleress> i tried set and env, the environment looks ok, its got java and everything
<caleress> think for the time being i'll have to give it up as i have other stuff to do, but thank you very much for your help and for the startup tip !
<caleress> thank you very much
* jodh changed the topic of #upstart to: Upstart 1.10 | http://upstart.ubuntu.com/cookbook/ | Post to mailing list if no response here: http://bit.ly/ooeNVv
<FunnyLookinHat> Yo guys - I'm having trouble finding doc on running periodic scripts ( i.e. replace cron )
<FunnyLookinHat> The cookbook doesn't seem to be aware that temporal events were built in: https://launchpad.net/upstart/+spec/replace-cron
<xnox> FunnyLookinHat: that's just a spec. Temporal events are not released in upstart. Use normal cron/anacron facilities, or make a cron job that does $ initctl emit-event my-event
<xnox> FunnyLookinHat: or e.g. $ initctl start mytask
<FunnyLookinHat> Oh still not done
<FunnyLookinHat> Ah ok - thanks xnox 
<FunnyLookinHat> It looked like it was done: https://code.launchpad.net/~daniel-sonck/upstart/cron-replacement
<FunnyLookinHat> My bad
#upstart 2013-08-24
<lexflex> hi!
<lexflex> question: is upstart not used/activated/installed with a fresh debian 7 install?
<Screwba> anyone around?
<Screwba> Have a question on UpStart boot up pausing
<Screwba> I want to run a script a single time upon boot up which will make some configuration changes to the system.  I have tried creating an UpStart Event but this seems to run and everything else runs with it, it does not pause the boot sequence and wait to finish until the rest of the boot up happens
<Screwba> is there a way I can accomplish this easily?
<Screwba> I have also tried running through rc.local within a loop watching the script but it still does not complete.  I really want the script to run once I have an IP address
<Screwba> ping
<xnox> lexflex: sysvinit is default in fresh debian 7 install, you can install upstart package & reboot and use upstart =)
<xnox> Screwba: read cookbook, there is a way to "block" other jobs from executing. You mostly likely want your job to start at network-interface IFACE!=lo and before runlevel job is executed.
<xnox> Screwba: alternatively you can use an override, e.g. echo "start on started your-magic-job" > /etc/init/runlevel.override, to prevent runlevel 2 event emitted before your job is executed.
<xnox> Screwba: i'd recommend to use initctl2dot to generate a graph of all jobs/events on your machine, for you to clearly see & decide where to plug your job in.
<lexflex> xnox: but i read in various places "only do this when you know what you're doing" which i dont :)
<xnox> Screwba: also maybe look at cloud-init, it's a few upstart jobs that modify system configuration on boot. That's what is used by most cloud providers to modify "stock" image into a "unique" cloud instance.
<xnox> lexflex: we are here to help. it does work great, but there can be debian specific bugs/quirks. You will be able to revert back easily by installing sysvinit again.
<xnox> lexflex: do think why you want to do this and whether you have time to troubleshoot if something goes wrong.
<lexflex> xnox: I'm trying to set up uwsgi and django
<xnox> lexflex: debian has eloquent uwsgi init scripts which let you configure a "projects" and it will start them all individually. Not sure if upstart will gain you anything, just for that.
<Screwba> xnox: THANKS A LOT...I went through the cookbook and nothing really poked out at me but this guidance is JUST what I need.
<lexflex> xnox: the thing is i couldn't find them
<lexflex> i didn't use apt-get
<xnox> lexflex: apt-cache search uwsgi
<xnox> lexflex: apt-cache search django
<lexflex> xnox: in the uwsgi doc it said the packages are outdated and i should build from source or something
<lexflex> i _think_ thats what i did
<lexflex> but now there are no init.d scripts or anything, just a bin
<xnox> lexflex: stable/testing has 1.2.3, unstable has 1.9.13, latest upstream is 1.9.14.
<xnox> lexflex: if you don't know how to use/compile software from source. It's best for you to use the package from debian, it's properly compiled & easy to use out of the box.
<xnox> lexflex: and has proper init.d scripts & simply just works on debian.
<xnox> lexflex: does it actually matter to you if you are using 1.2.3 or 1.9.x? are there features you rely on from newer uwsgi? as far as I can tell django would work with either.
<lexflex> xnox: is unstable obtainable by apt-get?
<Screwba> xnox:  cloud-init is not in the cookbook, should it be?  doing a search online for it now
<xnox> Screwba: cloud-init is an upstrem project and a package in ubuntu. Google for cloud-init, or ubuntu cloud images. Or blog posts by smoser / hallyn. 
<xnox> Screwba: the cookbook is about upstart and  best practises in writting upstart jobs. cloud-init has leveraged upstart jobs, but it does a lot more than just upstart jobs. it can configure your system, install/upgrade packages, resize filesystems, etc....
<Screwba> xnox: found it and have read the doc on it...seems pretty cool.  I will see if I am going to use that or use the Blocking method in the cookbook...thanks again, your info is definately valuable.   =)
<lexflex> xnox: I guess not. I'm a Linux/Python/Django noob, so :)
<lexflex> xnox: but the uwsgi docs say "Suggestion: when you start learning uWSGI try to build from official sources, using distro-supplied packages could bring you lot of headaches. "
<lexflex> xnox: and also: "If you think about writing some init.d script for spawning uWSGI, just sit down and realize that we are no more in 1995."
<xnox> lexflex: this is not a support channel for uwsgi/django. try #ubuntu for general support.
<xnox> lexflex: or uwsgi/django forums.
<lexflex> xnox: I know, but you asked me why I wanted to use upstart. and the reason is simply that the uwsgi docs suggest it
<lexflex> and also suggests compiling the source, which results in not having init.d. that's how I went trying using upstart
<xnox> lexflex: sure, it also suggests other systems as well. it makes sense to use upstart jobs for self-compiled uwsgi, if you already have system running under upstart =) there are other ways as well.
<lexflex> xenox: so a upstart related question: what happens when i install upstart and disable the "standard" under debian? will init.d be ignored from that moment on?
<xnox> lexflex: i do suggests you $ apt-get install uwsgi, drop a config file for it in /etc/uwsgi.d/ & start developing/running your django apps =)
<lexflex> but i want to learn about upstart now that i heard of it :P
<xnox> lexflex: upstart does support executing normal init.d scripts, so everything will continue to work.
<lexflex> oh, okay. so it will execute the existing ones as well as the upstart ones?
<lexflex> why isn't it standard then? why do i "have to know what i do" to replace it?
<JanC> sysvinit has been the default for ages, upstart and a bunch of other init systems are available for those who want, but aren't the default because people couldn't agree (yet?) which one should be the default
<JanC> but that's more a Debian question than an upstart one really...
<lexflex> JanC: well upstart should be the default obviously!! ;)
<lexflex> just kidding
<JanC> it's the default in Ubuntu & Ubuntu derivatives
<lexflex> oh, okay
<lexflex> as a Windows veteran I have to wrap my mind around different "init systems"
#upstart 2013-08-25
<jrib> does anyone know how/where to report an error in ttp://upstart.ubuntu.com/faq.html ?  "initctl reload" should read "initctl reload-configuration"
<jrib> https://bugs.launchpad.net/upstart/+bug/1216595 created that
<xnox> jrib: only jodh can edit that by the looks of things =) assigned to him. Thanks for spotting.
<jrib> no problem!
#upstart 2014-08-18
<cwillu_at_work> on a typical ubuntu system, how early is lo up? can I assume that a job triggered by local-filesystems will always see lo up?
<cwillu_at_work> alternatively, will "start on filesystem and net-device-up IFACE=lo" work regardless of the order the two things happen in?  (and is that true in general, or are either of those special in some way?)
<ajweiss> http://pastebin.com/GQNa6Fcj
<ajweiss> if i start that, then try to stop it... the stop hangs and init goes into a funny state where it hangs on every start/stop request until i kill pid 1
<ajweiss> this happens with amazon's default ami on ec2
<ajweiss> anyone have any ideas?
#upstart 2014-08-20
<myndzi> i put a mistaken 'expect fork' in a script and now it just plain won't launch or anything even after i fixed it, used stop -n, ensured the process was killed, etc.
<myndzi> ideas?
<myndzi> well nm that, reboot took care of it... now how can i figure out why the process is ending when i can't seem to reproduce it from a shell?
<ion> As for your first question, https://github.com/ion1/workaround-upstart-snafu
<ion> As for the second one, âexpectâ has some very specific requirements for the forking behavior of the process. If it does not follow them, problems will ensue.
<myndzi> first = thanks, second = got it working after a number of reboots
<myndzi> but now i have a slightly different problem
<myndzi> which is that it's not starting on startup
<myndzi> i've also got this - init: /etc/init.conf: Unable to load configuration: No such file or directory
<myndzi> uncertain if related?
<myndzi> okay, i think i figured what's going on
<myndzi> i wanted to run as another user, so i used 'su'
<myndzi> it doesn't appear to like that, perhaps because the daemon is getting spawned many levels deep or something, dunno
<myndzi> but it's some old version on centos 6.5 so i can't use setuser or whatever the commands are
<myndzi> okay, i just made it not bother with daemonization
<myndzi> or rather, it runs the app directly
<myndzi> when i stop it it says stopped but the process is still running??
<myndzi> daemonize answered my problems :P
#upstart 2014-08-21
<twm> Where to Upstart state change messages go in Trusty?  They were in syslog in precise but they don't appear to matter what I set log-priority to.
<twm> *Where do
#upstart 2014-08-22
<hpj_> hi, how to enable user jobs (or session jobs -- i'm not sure of the difference) on ubuntu 14.04, upstart 1.12.1?
<hpj_> i need to run a job on an ubuntu server (no X), manually (no automatic start and stop), as a non-root user
<hpj_> all the job needs to do is to "respawn" when the process crashes
#upstart 2015-08-17
<Proksima> I have a script that dynamically populate fstab. Is "start on starting mountall" the right anchor if I want it to complete before mountall starts?
<JanC> if it's defined as a task, yes
<Proksima> Good, thanks ! :)
#upstart 2015-08-18
<Ackis> hey everyone - is there an interpreter for upstart configs? Kind of like www.shellcheck.net/ ?
#upstart 2015-08-20
<Orm_Ancalagon> Evening all, if this is not the right place to ask i apologise and would be greatful for directions to it. I have a couple of questions regarding upstart order for initialising services if anyone could give a few pointers?
<JanC> Orm_Ancalagon: any questions about upstart are welcome here, but the channel is very quiet generally
<Orm_Ancalagon> Thatâs most kind
<JanC> also, make sure to read the manpages & the cookbook
<JanC> also, so /topic for a link to the mailing list
<JanC> *see*
<Orm_Ancalagon> Cool
<Orm_Ancalagon> I am having a little difficulty with two services on Ubuntu server 14.04 and their start order
<Orm_Ancalagon> I have an XMPP server called Prosody which I configured to use MYSQL for its database
<Orm_Ancalagon> I changed it from SQL lite since I wanted to support password hashing
<Orm_Ancalagon> Anyway
<Orm_Ancalagon> On first boot, I think prosody gets started before MYSQL and hence fails 
<Orm_Ancalagon> Thereâs a error log noting âcanât connect to MYSQL database"
<JanC> sounds like that, yeah
<Orm_Ancalagon> However, once the sytem is booted, restarting prosody spools up just fine
<Orm_Ancalagon> Is there a way to make Prosody check MYSQL is up and running before starting?
<Orm_Ancalagon> Or perhaps a delay I could set against it
<JanC> how is prosody started right now?
<Orm_Ancalagon> Itâs daemonised and configured to start on boot following the apt-get install
<Orm_Ancalagon> Iâve had a read through the cookbook, but I am quite newbish at this level
<Orm_Ancalagon> And must admit iâve never really needed to poke at init before
<JanC> I mean, is it started by an upstart config or using a sysvinit script?
<JanC> is there a /etc/init/prosody.conf ?
<Orm_Ancalagon> you know what iâm being dum
<Orm_Ancalagon> the /etc/init is upstart and /etc/init.d is sysvinit isnât it
<Orm_Ancalagon> thereâs no prosody.conf in /etc/init but it is in /etc/init.d/prosody
<JanC> okay, so that complicates things a bit, I guess  :)
<Orm_Ancalagon> Heh
<Orm_Ancalagon> I note mysql actually appears in both /etc/init and /etc/init.d
<Orm_Ancalagon> So does Ubuntu combine by sysvinit scripts and upstart for starting services then?
<JanC> the mysql one in init.d is not a real sysvinit script (it's there for compatibility with some other software, I guess)
<Orm_Ancalagon> Ah ok
<JanC> and upstart can start/stop/etc. sysvinit scripts for backwards compatibility
<JanC> like the prosody one
<Orm_Ancalagon> ah thatâs why a sudo service restart prosody works 
<Orm_Ancalagon> I see
<JanC> I'm not 100% sure what is the "right way" to make a sysvinit script wait on mysql though...
<Orm_Ancalagon> Yeah I wonder, given the mixture, if it might be possible to set a delay on sysvinit start for prosdy 
<Orm_Ancalagon> in order to avoid complication
<JanC> maybe best would be to make a prosody.conf for it  :)
<Orm_Ancalagon> wow is that possible?
<Orm_Ancalagon> Jan thanks for you help, it was most appreciated, iâm going to have a play at writing a .conf
<Orm_Ancalagon> Hope you have a great day
#upstart 2015-08-21
<Fooster> hi there
<Fooster> anyone around?
#upstart 2016-08-23
<fedora_newb> I am trying to start multiple services with another service. However, I am having a hard time of getting it setup. I keep getting unknown job attendance. However, I can start attendance outside of the control no problem. http://pastebin.com/zN9fP0Gr
<AnrDaemon> fedora_newb: You should use events to manipulate job start. Never call "initctl start" directly without a good reason. A VERY good reason, and even then - don't.
<AnrDaemon> If all you need is to change the start parameters of another job, make an .override with desired "start on" clause.
<ruptwelve> Hello Upstart peoples
<ruptwelve> Is anyone around to assist with a question I have ?
<ruptwelve> Regarding script stanzas and exit codes
<ruptwelve> The issue I am having is parsing errors from apache startup
<AnrDaemon> ruptwelve: What specifically you are "parsing" ?
<ruptwelve> So
<ruptwelve> I have an upstart config 
<ruptwelve> that runs httpd with some arguments
<ruptwelve> when I run initctl start httpd I get the message: httpd start/running PID xxxx
<AnrDaemon> Want an advice? Ditch as many "arguments" as possible.
<ruptwelve> Regardless if the apache server started or not 
<ruptwelve> right
<ruptwelve> so event if I run just /usr/sbin/httpd 
<AnrDaemon> Tell apache to not daemonize.
<ruptwelve> Should I get an exit code ?
<AnrDaemon> You ALWAYS get an exit code, when program exits.
<ruptwelve> right
<ruptwelve> but I always get a 0 
<ruptwelve> even if Apache did not start
<AnrDaemon> Yes. So, again.
<AnrDaemon> FFFFFFFFFFFFFFF
<AnrDaemon> 1. If you are delegating all active scripting to other daemons or running mpm-itk, tell apache to not daemonize.
<AnrDaemon> 2. If you are using active content filters, then see cookbook, "tracking the wrong PID".
<AnrDaemon> In either case, do not test it on live system.
<ruptwelve> This is not a live system so that is fine
<AnrDaemon> And always ensure that initctl status reporting "stopped".
<ruptwelve> what I am trying to achieve here is to be sure weather apache did start or not
<AnrDaemon> Before starting the job again.
<ruptwelve> Right
<AnrDaemon> upstart will manage that by itself, once you set up PID tracking correctly.
<AnrDaemon> I hope you do not use any wrapper scripts?
<ruptwelve> Allow me to paint  a picture 
<AnrDaemon> Better pastebin your job script :)
<ruptwelve> sure one sec 
<AnrDaemon> That would be an image worth 1000 words.
<ruptwelve> so
<ruptwelve> http://pastebin.com/raw/CUYkRcGX
<ruptwelve> that is httpd.conf
<ruptwelve> under /etc/init/
<AnrDaemon> Use exec. Not script.
<AnrDaemon> And use upstart to set ulimits.
<AnrDaemon> And other vars.
<ruptwelve> And this is a part of the /etc/init.d/httpd 
<ruptwelve> http://pastebin.com/raw/ZTCBNNBu
<ruptwelve> Which triggers initctl 
<AnrDaemon> If you have init/httpd.conf the init.d/httpd will only be called by idiots and degenerates.
<ruptwelve> well
<AnrDaemon> "service" wrapper will find upstart/systemd scripts before init.d
<ruptwelve> right
<ruptwelve> but even if just using initctl 
<AnrDaemon> Just make sure you update-rc.d -f apache2 remove
<AnrDaemon> Ok, to reiterate:
<AnrDaemon> 1. You're using wrapper script. Thus making the job of finding the right PID to track unnecessarily hard.
<AnrDaemon> 2. You're using runlevels instead of proper signals. start on local-filesystems and net-device-up IFACE!=lo is usually sufficient.
<AnrDaemon> Also remove any "respawn" stanzas until your job is tracking the right pid.
<ruptwelve> Okay! Thank you for clearing some stuff up AnrDaemon 
<ruptwelve> But I still don't understand why I cannot just get an exit code other than 0 from the initctl script ?
<ruptwelve> Even if  I just run exit 1 
<ruptwelve> "exec exit 1" 
<ruptwelve> if I run initctl start httpd 
<ruptwelve> echo $? 
<ruptwelve> I will always get 0 
<AnrDaemon> Because "initctl start ..." sends signal to init daemon, and if signal is sent all proper, the exit code is a success.
<ruptwelve> right 
<ruptwelve> That makes sense 
<AnrDaemon> Also I'm not sure "exit" is an actual binary. :D Try /bin/false
<ruptwelve> my bad :) I just ran exec exit 1 and got a 1 
<ruptwelve> so I did not test it 
<ruptwelve> under script tho, it is still 0
<AnrDaemon> I'm very suspicious of any scripts in upstart job as of late.
<ruptwelve> Yeah, unfortunately due to the /bin/sh -e 
<ruptwelve> if any of the commands fail, the script exits
<ruptwelve> and it just ends there 
<ruptwelve> no error or nothing :/ 
<AnrDaemon> Plus you have test ${PIPESTATUS[0]} -eq 0
<ruptwelve> yeah that is just to test the output before tee 
<ruptwelve> but even if I have /usr/sbin/httpd -D FOREGROUND
<ruptwelve> i still get the same result
<AnrDaemon> http://pastebin.com/M6AUXFzy
<AnrDaemon> Something like that. (untested)
<AnrDaemon> Err, typo in #14.
<ruptwelve> I see :)
<ruptwelve> the expect for marks the service as running
<ruptwelve> even though it is not 
<AnrDaemon> That's why I said it needs testing and correct handling.
<AnrDaemon> http://upstart.ubuntu.com/cookbook/#expect
<ruptwelve> Well thank AnrDaemon, you were of assitance
<ruptwelve> I spent the entire day googling this
<AnrDaemon> Googling what? :D
<ruptwelve> upstart and exit codes :D 
<ruptwelve> I was hoping that it would return an exit code of the script block
<AnrDaemon> Sorry, it was on my todo list to make apache2 run from upstart, but I didn't find time to actually port it.
<ruptwelve> but I guess it doesn't work 
<ruptwelve> as I expected
<ruptwelve> Well, the thing is it starts 
<AnrDaemon> It works but not the way you expect.
<ruptwelve> I can have it run no problem 
<ruptwelve> I just want to make sure it runs with error handling 
<AnrDaemon> Just ask yourself one question: when the system is booting, where to return the exit codes?
<ruptwelve> Hmm, let me explain a bit
<AnrDaemon> upstart is designed to do precisely that.
<ruptwelve> I have this big wrapper application around the server(s) 
<ruptwelve> that restarts the apache server once you push new data to it
<AnrDaemon> To not just start the job, but also suprvise its execution.
<ruptwelve> new configs / applications / whatever 
<AnrDaemon> That's parallel to init daemon's job.
<ruptwelve> and it runs service stop httpd 
<ruptwelve> copies new stuff 
<ruptwelve> service start http d
<AnrDaemon> Well, that's the wrong way to do itâ¦
<ruptwelve> and from the applications perspective everything started fine 
<AnrDaemon> You don't need to stop httpd just to upload new data.
<AnrDaemon> LEarn the power of atomic operations ;)
<ruptwelve> as there is no error from initctl regarding starting apache
<ruptwelve> ah no :)
<ruptwelve> well I can also upload a new version of httpd.conf :)
<AnrDaemon> Well, then you are probably better off with something like LXD or docker.
<ruptwelve> And I can have a user make a mistake in the httpd.conf 
<ruptwelve> and he wont know why apache did not start
<ruptwelve> it will just show as started 
<ruptwelve> right! :) You have a point, there are so many better ways to do this
<ruptwelve> but that is not my call ;) 
<ruptwelve> I am just trying to find the best solution here
<AnrDaemon> No, if apache did not start, it will not be shown as started.
<ruptwelve> Correct! 
<AnrDaemon> Also, make pre-start script with apachectl -t
<ruptwelve> But the actual output of initctl start httpd will be good 
<ruptwelve> yes I did that :)
<ruptwelve> but that just checks the configuration
<ruptwelve> I would like to be more resiliant
<AnrDaemon> Well, it have more optionsâ¦
<ruptwelve> for example if the  socket is occupied 
<AnrDaemon> It is as resilient as possible.
<ruptwelve> Wish there was a dry-run option for apache :)
<AnrDaemon> If pre-start script fails, the job will never run in forst place.
<AnrDaemon> first**
<AnrDaemon> And thus you can take actions.
<ruptwelve> That is fine
<ruptwelve> when it comes down to config
<ruptwelve> but is there an option to dry-run apache?
<ruptwelve> Like a test run, to just make sure it will run - and if so, just continue with upstart
<AnrDaemon> That's what apachectl do. Else it wouldn't be able to test config.
<AnrDaemon> Since module-dependent options can only be recognized by the respective modules.
<ruptwelve> but what happens if there a port already occupied ? 
<ruptwelve> that is if the socket is not available
<ruptwelve> hmm let me test that :)
<AnrDaemon> Nothing. (If we talk about test runs.)
<ruptwelve> oh nice
<ruptwelve> It actually tests that <3
<ruptwelve> THERE IS MY SOLUTION
<ruptwelve> You Sir deserve a beer 
<AnrDaemon> Sure. Golden Barrel light 0.5 will suffice. In glass, please.
<ruptwelve> I guess Golden Barrel is American? 
<ruptwelve> Russian! 
<AnrDaemon> hehehe
<AnrDaemon> I guess it testing if the port is occupied by some other application?
<ruptwelve> Correct
<ruptwelve> I am just trying to finish up the .conf file
<ruptwelve> I will share once I am done :)
<AnrDaemon> Ahha. 'Cause I've tried to find a way for it to break when it is already running. With no success.
<AnrDaemon> I've 2 weeks since I moved most of my services into containers. And there's at most 2 services running per each.
<AnrDaemon> Ok, plus Samba where it is applicable.
<AnrDaemon> (I.e. MySQL container runs only MySQL with minimum support.)
#upstart 2016-08-24
<fedora_newb> Can anyone share a link showing how to start multiple init services with another upstart service? 
<AnrDaemon> fedora_newb: What do you want to do, specifically?
<fedora_newb> AnrDaemon, so I have a couple of upstart services that handle laravel (php) stuff. Exec their own commands. I would like another upstart service that I could use to pass start/stop to control all the other services at once
<AnrDaemon> brrr
<AnrDaemon> What stops you from just creating relevant pools in PHP FPM?
<fedora_newb> AnrDaemon, never really thought about that. Hmm...
<AnrDaemon> And specifically, what "laravel stuff" you are managing? F.e. what do you mean by "their own commands"?
<fedora_newb> AnrDaemon, most using their artisan command stuff to do jobs in the background, such as sending messages or processing other data that takes longer. We are currently using supervisor but the server is having trouble with it sometimes and randomly crashes. So I figured I would hop on upstart and give that a go.
<AnrDaemon> Well, that's an entirely different question then.
<fedora_newb> I have the configurations for each job (sending messages, moving members around, etc) but I would like another upstart server (maybe task?) to start and stop all of them at once
<fedora_newb> service*
<fedora_newb> However, I usually get service not found (like the specific job itself) or it just stops
<AnrDaemon> I think you just need a better supervisor for that.
<fedora_newb> Anything you can recommend?
<AnrDaemon> Because you can't efficiently detect if a task finished successfully or crashed.
<AnrDaemon> Nothing off the tp of my head, sorry :'(
<fedora_newb> np sir. I just read that upstart was similar to supervisor, so was giving it a try
<AnrDaemon> Similar, yes, but it is very generalised and geared towards the daemon supervision.
<AnrDaemon> Supervising finite running tasksâ¦ I'm not sure it is possible, but you may try. Just heed the warning: avoid using a script ... end script as your job as much as possible.
#upstart 2017-08-24
<scottmmjackson> I'm having a curious issue on Ubuntu 14.04 using upstart to spawn a service that subsequently spawns child processes using `su`. Specifically on Ubuntu 14.04, for some reason, `systemd-logind` is sending SIGHUP to any spawned child. Aside from being confused by seeing `systemd-logind` on the default ubuntu14 box where `init` is `upstart`, I'm also a bit baffled by why systemd-logind is sniping my 
<scottmmjackson> service's children with HUP.
<scottmmjackson> I've regressed this on Ubuntu 12 and the bug isn't there, which just raises further questions.
<xnox> systemd-logind is normal, as we have moved to that from consolekit
<xnox> scottmmjackson, why are you using su, instead of using setgid/setuid stanzas? http://upstart.ubuntu.com/cookbook/#setgid
<xnox> systemd-logind in this case is just the daemon for session management / reconcilation
<scottmmjackson> xnox: su isn't being used in the exec stanza. the parent process is exec'd directly. Its child processes are being forked and calling pam_open_session.
<scottmmjackson> The service of which is `su`
<scottmmjackson> sorry for the confusion
<scottmmjackson> Ironically, however, if the exec line is written like the session-init.conf as listed in this part of the cookbook, forking works just fine: http://upstart.ubuntu.com/cookbook/#non-graphical-sessions-ubuntu-specific
<scottmmjackson> Which uses su directly.
<scottmmjackson> So there's a fix- wrap it in `/bin/su` like the cookbook says. But I don't feel great not grokking what conditions cause `systemd-logind` to behave this way.
#upstart 2018-08-20
<darkmagic> LRH OFFICIAL: We are not spamming you | https://www.youtube.com/watch?v=_utMUBnl3nk
<nb3> LRH OFFICIAL: We are not spamming you | https://www.youtube.com/watch?v=_utMUBnl3nk
<Phanes> LRH OFFICIAL: We are not spamming you | https://www.youtube.com/watch?v=_utMUBnl3nk
<Strog14> LRH OFFICIAL: We are not spamming you | https://www.youtube.com/watch?v=_utMUBnl3nk
<borsin23> LRH OFFICIAL: We are not spamming you | https://www.youtube.com/watch?v=_utMUBnl3nk
<Shibe11> LRH OFFICIAL: We are not spamming you | https://www.youtube.com/watch?v=_utMUBnl3nk
#upstart 2018-08-21
<sparr13> |
<sparr13> |                  .---------.
<sparr13> |                 /:::::::::::\
<sparr13> |                |:::::::::::::|
<sparr13> |                |:::::::::::::|
<sparr13> |                |::::::::::::/
<sparr13> |                |:___________\
<sparr13> |                //c  \___/ /__)
<sparr13> |               /' . .,_    |  | -- SLICK P-B-D
<sparr13> |              |': ; /  \   /_/     THE GHETTO V-I-P
<sparr13> |              oo ;  `"`"    }      WILL LEAVE YOU R-I-P
<sparr13> |             ; 'oo,         {      Shizzle my nizzle.
<sparr13> |            /     oo        }
<sparr13> |           ; '::.   oo\/\ /\|
<sparr13> |          |.      ':. oo`"`oo\
<sparr13> |         / '::'::'    / o o  ;
<sparr13> |        |':::' '::'  /  ($)  |
<sparr13> |        \   '::' _.-`;       ;
<sparr13> |        /`-..--;` ;  |       |
<sparr13> |       ;  ;  ;  ;  ; |       |
<sparr13> |       ; ;  ;  ; ;  ;        /        ,--........,,
<sparr13> |       |; ;  ;  ;  ;/       ;       .'           -='.
<sparr13> |       | ;  ;  ; ; /       /       .\               :
<sparr13> |       |  ;   ;  /`      .\   _,=="  \             .'
<sparr13> |       \;  ; ; .'. _  ,_'\.\~"   //`. \          .'
<sparr13> |       |  ;  .___~' \ \- |-|    /,\ `  \      _.'
<sparr13> |     ~ ; ; ;/  _,.-~'|-| |$|       _,-''\..--'
<sparr13> |     ~ /; ;/=""      |$| |-|    _="`
<sparr13> |     ~..==`     \\   |-| /_/_="`
<sparr13> |      ~` ~      /,\ / /_,)")
<sparr13> |     ~ ~~       _,.-)")
<funnel9>                     _..._
<rosseaux27> |                     _..._     
<rej3> |
<rej3> |                  .---------.
<rej3> |                 /:::::::::::\
<rej3> |                |:::::::::::::|
<Zoddo22>   ________________ _      .    ____      *
<Zoddo22>  <-_______________|*) .  ___==/    \==___
<Fieldy4> |                                  ___
<Fieldy4> |                 ,---.        /""'_,/
<Fieldy4> |                 |    '\''""-:   /
<Fieldy4> |                /\   /'\\     `;'
<strugee>                      _..._
<Ceber>                   _..._
<Guest850432>                      _..._
<ozy26>                   ____ 
<ozy26>               _,-'____``-.
<ozy26>              / ,='    `-. `.
<ozy26>            ,',  `.  _    `. \
<ozy26>            /.'`.  `.o)  /__| \
<ozy26>           | |':.`.  `.  |  | |
<ozy26>           `.\: ; /`.  `./_// /
<ozy26>            | \;  `"``.  `./ /
<ozy26>           ; `.`.      `.   /
<ozy26>          /    `._`----' ,-'
<ozy26>         ; '::.   `----'' {
<ozy26>        |.      ':. ;``"``\
<ozy26>       / '::'::'    /      ;
<ozy26>      |':::' '::'  /       |
<ozy26>      \   '::' _.-`;       ;
<ozy26>      /`-..--;` ;  |       |
<ozy26>     ;  ;  ;  ;  ; |       |
<ozy26>     ; ;  ;  ; ;  ;        /        ,--.........,
<ozy26>     |; ;  ;  ;  ;/       ;       .'           -='.
<ozy26>     | ;  ;  ; ; /       /       .\               '
<ozy26>     |  ;   ;  /`      .\   _,=="  \             .'
<ozy26>     \;  ; ; .'. _  ,_'\.\~"   //`. \          .'
<ozy26>     |  ;  .___~' \ \- | |    /,\ `  \      ..'
<ozy26>   ~ ; ; ;/  =="'' |`| | |       =="''\.==''
<ozy26>   ~ /; ;/=""      |`| |`|   ==="`
<ozy26>   ~..==`     \\   |`| / /=="`
<ozy26>    ~` ~      /,\ / /= )")
<ozy26>   ~ ~~         _')")
<ozy26>   ~ ~   _,=~";`
<ozy26>   ~  =~"|;  ;|       Fuck your birds
<ozy26>    ~  ~ | ;  |       ===============
<ozy26> ~ ~     |;|\ |
<ozy26>         |/  \|
<thumbs29> |                     __
#upstart 2018-08-22
<kek918>                    ___
<clorophormo> |             _.--"""""--._
<clorophormo> |           .'             '.
<pmn> |                --      --
<pmn> |              /:"  | /:'" |
<pmn> |            --  ___   ___  -
<pmn> |          /:.  /(o)\ /(o)\ .\
<nealshire>                  ___________________
<nealshire>                 '.   ______________ '.
<cholcombe4>                   | | |
<BWBellairs19>          __
<tinyhippo24>                                _____________________ 
<tinyhippo24>                    /|  /| |   |                     |
<tinyhippo24>                    ||__|| |   |       DO NOT        |
<lannister>  *p e n i s b i r d p e n i s b i r d *
<msm19>                   ____ 
<msm19>               _,-'____``-.
<msm19>              / ,='    `-. `.
<msm19>            ,',  `.  _    `. \
<msm19>            /.'`.  `.o)  /__| \
<msm19>           | |':.`.  `.  |  | |
<msm19>           `.\: ; /`.  `./_// /
<msm19>            | \;  `"``.  `./ /
<msm19>           ; `.`.      `.   /
<msm19>          /    `._`----' ,-'
<msm19>         ; '::.   `----'' {
<msm19>        |.      ':. ;``"``\
<msm19>       / '::'::'    /      ;
<msm19>      |':::' '::'  /       |
<msm19>      \   '::' _.-`;       ;
<msm19>      /`-..--;` ;  |       |
<msm19>     ;  ;  ;  ;  ; |       |
<msm19>     ; ;  ;  ; ;  ;        /        ,--.........,
<msm19>     |; ;  ;  ;  ;/       ;       .'           -='.
<msm19>     | ;  ;  ; ; /       /       .\               '
<msm19>     |  ;   ;  /`      .\   _,=="  \             .'
<msm19>     \;  ; ; .'. _  ,_'\.\~"   //`. \          .'
<msm19>     |  ;  .___~' \ \- | |    /,\ `  \      ..'
<msm19>   ~ ; ; ;/  =="'' |`| | |       =="''\.==''
<msm19>   ~ /; ;/=""      |`| |`|   ==="`
<msm19>   ~..==`     \\   |`| / /=="`
<msm19>    ~` ~      /,\ / /= )")
<msm19>   ~ ~~         _')")
<msm19>   ~ ~   _,=~";`
<msm19>   ~  =~"|;  ;|       Fuck your birds
<msm19>    ~  ~ | ;  |       ===============
<msm19> ~ ~     |;|\ |
<msm19>         |/  \|
<Jacob843>  *p e n i s b i r d p e n i s b i r d *
<JustTheDoctor9>  *p e n i s b i r d p e n i s b i r d *
<l2y> |             _.--"""""--._
<high_fiver> |         ___  _____
<high_fiver> |     .'/,-Y"     "~-.
<high_fiver> |    l.Y             ^.
#upstart 2018-08-23
<y0sh21> * b a n t o w n * b a n t o w n * b a n t o w n *
<y0sh21> b                                               b
<y0sh21> a /     \             \            /    \       a
<y0sh21> n|       |             \          |      |      n
<y0sh21> t|       `.             |         |       :     t
<y0sh21> o`        |             |        \|       |     o
<y0sh21> w \       | /       /  \\\   --__ \\       :    w
<y0sh21> n  \      \/   _--~~          ~--__| \     |    n
<y0sh21> *   \      \_-~                    ~-_\    |    *
<y0sh21> b    \_     \        _.--------.______\|   |    b
<y0sh21> a      \     \______// _ ___ _ (_(__>  \   |    a
<y0sh21> n       \   .  C ___)  ______ (_(____>  |  /    n
<y0sh21> t       /\ |   C ____)/      \ (_____>  |_/     t
<y0sh21> o      / /\|   C_____)BANTOWN|  (___>   /  \    o
<y0sh21> w     |   (   _C_____)\______/  // _/ /     \   w
<y0sh21> n     |    \  |__   \\_________// (__/       |  n
<y0sh21> *    | \    \____)   `----   --'             |  *
<y0sh21> b    |  \_          ___\       /_          _/ | b
<y0sh21> a   |              /    |     |  \            | a
<y0sh21> n   |             |    /       \  \           | n
<ski77777>                     _..._
<ski77777>                  .-'     '-.
<ski77777>                 /     _\   _\
<ramsey29> Delink the sacred server
<Vercas26>                                                                                 
<Vercas26>                                                                      
<Vercas26>                                                                      
<Vercas26>                         KILL ALL FREENODE OPERATORS                             
<Vercas26>                         KILL ALL FREENODE OPERATORS                             
<Vercas26>                         KILL ALL FREENODE OPERATORS                             
<Vercas26>                                                                                 
<Vercas26>                                                                                 
<Vercas26>                   ColdHeat, _Hyper_, fatalbit  of #isislab 
<Vercas26>                   call for a jihad (holy war) on the 
<Vercas26>                   pro-western, anti-islamic infidels 
<Vercas26>                   who run the "free node"
<xnox> Unit193, please set this channel to registered users only
<xnox> that's enough of crap
<Guest29805> |                     _..._
<Unit193> xnox: Done.
