[12:42] <Screwba> xnox: You around?
[12:43] <xnox> Screwba: yeap =) what's up?
[12:44] <Screwba> xnox: you helped me the other day and stated "You mostly likely want your job to start at network-interface IFACE!=lo and before runlevel job is executed."  Would my `start on` statement look like "start on started network-interface IFACE!=lo and starting rc RUNLEVEL=[2345]"
[12:44] <xnox> Screwba: looks right.
[12:45] <Screwba> xnox: cool...going to give it a test by just having a script which polls for the IP and pauses for 2 mins writing the IP and timing to a /tmp/mytest.log file
[12:46] <Screwba> xnox: I should not have to `emit` anything correct?
[12:47] <xnox> Screwba: nope.
[12:47] <Screwba> xnox: just write my screwbas_event.conf file in the /etc/init folder with a script section calling my /usr/local/bin/screwbas_script
[12:48] <Screwba> xnox:  YOU ROCK !!!  If this works for me, then YOU RULE !!!
[12:48] <Screwba> ;)
[13:21] <Screwba> xnox: it is not working for me...   =(
[13:22] <xnox> increase debugging and see what events are emitted.
[13:22] <xnox> jodh: is "starting rc" ever emitted?
[13:22] <jodh> xnox: yes
[13:24] <xnox> Screwba: boot with --debug kernel arg and see what happens - e.g. order of the events.
[13:24] <Screwba> xnox:  this is my /etc/init/mytesttask.conf file  http://pastebin.com/MW8657ew  maybe something wrong there in my script section?
[13:25] <Screwba> xnox:  will try the --debug option now
[13:25] <jodh> Screwba: that should be "start on net-device-up IFACE !=lo" or "start on started network-interface INTERFACE != lo".
[13:31] <Screwba> jodh: thanks, I will change my conf in a min and test again...   =)
[13:31] <Screwba> jodh: sorry, should it be both or one or the other?
[13:35] <jodh> Screwba: you should use "start on started network-interface INTERFACE!=lo and starting rc RUNLEVEL=[2345]"
[13:37] <Screwba> jodh:  testing now
[13:38] <Screwba> xnox:  I added the --debug option to Grub but it does not seem like I am getting any debug info...I made the change permanent by editing /etc/default/grub and I also removed the quiet and splash options
[13:41] <xnox> ... and run update-grub ?
[13:42] <Screwba> xnox:  LoL...sorry, brain fart this morning
[13:42] <Screwba> rebooting now...
[13:42] <Screwba> jodh: that sort of worked, I have a 1 minute pause in my /usr/local/bin/testsjy.sh script, but it appears that the script only hits about 40 secs then maybe UpStart is killing it?
[13:42] <Screwba> jodh/xnox:  testing again now...
[13:45] <Screwba> jodh/xnox:  only ran for about 35 seconds this time
[13:53] <Screwba> jodh/xnox:  New paste  http://pastebin.com/9V7G4B7E
[13:53] <Screwba> updated with my testsjy.sh script and the updated .conf file
[13:54] <jodh> Screwba: you need to get debug enabled. --debug gives a firehose of debug output that will get redirected by rsyslog depending on your config.
[13:54] <jodh> Screwba: take a look at /var/log/upstart/$your_job.log too
[13:58] <Screwba> jodh:  --debug enabled, powering off machine and rebooting in a min
[13:58] <Screwba> jodh:  there is only a .1.gz file in /var/log/upstart/mytesttask.conf and that is an old version, seems like it is not logging there
[13:58] <Screwba> back in a bit
[13:58] <jodh> Screwba: your script isn't producing output then
[13:59] <Screwba> jodh: it is only echo'ing to my /tmp/testjsy.log file, not sure if that would be output
[13:59] <Screwba> jodh: or if I need to modify it so UpStart sees something else
[14:32] <linuxnewbie> i'm having some trouble with an ts3 upstart script http://pastebin.com/ijFBrZnL ...it starts the server but it gives me wrong PID ..and status ts3 shows me ts3 stop/waiting
[14:32] <linuxnewbie> if anyone have an idea what I do wrong please answer :)
[15:10] <Screwba> jodh / xnox: I added a line to my script which just echo's to the console, it would appear that my script is running fully now but it does not seem to 'hold/pause' the boot sequence for the 1 minute that the script should run...does the `sleep` command work in the UpStart {script/end script} section?
[15:11] <Screwba> jodh / xnox: I am now getting a log file in /var/log/upstart/mytesttask.log
[15:59] <Screwba> xnox: it is not 'stopping' the boot sequence until my script finishes, I have now confirmed that.  My script continues to run even after logging in.  I used initctl2dot and created a graph, my script is definately dependant on network-interface and rc.
[16:00] <Screwba> xnox / jodh: is it possible to totally pause the boot up between network-interface and rc until my script totally finishes?
[16:24] <jodh> Screwba: if you look at upstart-events(7), you'll see that to do that you'd need to specify "start on starting network-interface ...". The 'starting' event blocks, whereas the 'started' event does not.
[16:25] <Screwba> jodh:  ahhhhhhhh...so my start on should look like:  start on starting network-interface INTERFACE!=lo
[16:27] <Screwba> jodh:  or the full string `start on starting network-interface INTERFACE!=lo and starting rc RUNLEVEL=[2345]`
[16:28] <jodh> Screwba: the latter I think (although I don't have the full context of what you're trying to do).
[16:28] <Screwba> jodh:  or possibly just the `start on starting network-interface` and from there, I poll to wait for an actual IP address to be assigned to the NIC, then do my work and exit 0
[16:30] <Screwba> jodh:  I have a configuration script which I want to run on first boot up of an Ubuntu machine.  The script will mount a floppy and read information from files on there, then rename the host, join it to an Active Directory domain and configure a few other things on the system.  With CentOS/Red Hat it is easy because they are still using SysV init, with Ubuntu and Debian, it is harder since UpStart is the boot init
[16:31] <jodh> Screwba: sounds like you want to use cloud-init. That solves your problem in a generic manner: https://launchpad.net/cloud-init
[16:32] <Screwba> jodh:  xnox suggested I look at cloud-init but that is something else that I would have to teach to 'others' who may be using this.  I would really like to just get it done via UpStart natively since it is there by default and everything in my configuration script uses default/built-in utilities
[16:32] <jodh> Screwba: cloud-init runs on centos too fwiw.
[16:33] <xnox> Screwba: you still didn't tell us what you want to do. And upstart spend a lot of work speeding up the boot and parallelising. Not inserting 1 minute sleeps blocking everyone =)
[16:33] <Screwba> jodh:  hmmmmmmm...I could not find any really good configuration scripts which would show the host rename and some other things.  I looked at the site but the docs seem to be lacking
[16:34] <jodh> Screwba: maybe ping smoser then?
[16:35] <Screwba> xnox / jodh :  Thanks a lot, I will tackle the cloud-init side of things and report back.   =)
[16:35] <Screwba> jodh:  I will try that as well
[16:36] <xnox> Screwba: do note that e.g. cloud-init runs in parallel, such that there is login prompt but cloud-init may still be running remaining parts of configuration (e.g. upgrading packages) but the generic stuff is done by that time (e.g. networking configuration & setting hostname)
[16:37] <jodh> Screwba: also note that cloud-init runs earlier. it specifies 'start on mounted MOUNTPOINT=/' (note that mounted also blocks - see upstart-events(7) again).
[16:39] <Screwba> thanks guys
[16:39] <Screwba> the biggest thing with my script is joining the AD Domain, that usually takes 2 - 5 mins using the `net ads join` command
[16:40] <Screwba> I really need this done before the GUI login is shown
[16:40] <Screwba> =)
[16:41] <xnox> Screwba: echo "start on started my-ad-task" >> /etc/init/lightdm.override
[16:42] <xnox> Screwba: lightdm will not come up, until my-ad-task is finished & thus no-one will be able to login.
[16:43] <Screwba> xnox:  but does that mean I need another task (/etc/init/my-ad-task.conf) created first?
[16:43] <xnox> Screwba: yes, that would be where you run your scripts to do AD stuff.
[16:43] <Screwba> xnox:  is there a rc.override as well?
[16:44] <xnox> Screwba: you can .override any  .conf file
[16:44] <Screwba> xnox:  you see what I am getting at...   ;-)
[16:44] <Screwba> ahhhhhhhh...
[16:44] <Screwba> xnox:  excellent...will give it a go
[16:44] <xnox> Screwba: and it overlays config. It's documented in man pages & the cookbook......
[16:44] <Screwba> thanks again guys for your information and especially your PATIENCE with me...   =)
[16:44] <Screwba> thanks again
[20:52] <Screwba> all:  what does `instance $JOB` do?  I see it but when I try to use it, I get an error when I do a `status myjob`
[20:55] <Screwba> how does the script get the $JOB variable populated?  is it internal to UpStart?