=== jamescarr_ is now known as jamescarr | ||
=== jamescarr_ is now known as jamescarr | ||
=== muh-die-1uh is now known as muh-die-kuh | ||
Screwba | xnox: You around? | 12:42 |
---|---|---|
xnox | Screwba: yeap =) what's up? | 12:43 |
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:44 |
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:45 |
Screwba | xnox: I should not have to `emit` anything correct? | 12:46 |
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:47 |
Screwba | xnox: YOU ROCK !!! If this works for me, then YOU RULE !!! | 12:48 |
Screwba | ;) | 12:48 |
Screwba | xnox: it is not working for me... =( | 13:21 |
xnox | increase debugging and see what events are emitted. | 13:22 |
xnox | jodh: is "starting rc" ever emitted? | 13:22 |
jodh | xnox: yes | 13:22 |
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:24 |
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:25 |
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:31 |
jodh | Screwba: you should use "start on started network-interface INTERFACE!=lo and starting rc RUNLEVEL=[2345]" | 13:35 |
Screwba | jodh: testing now | 13:37 |
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:38 |
xnox | ... and run update-grub ? | 13:41 |
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:42 |
Screwba | jodh/xnox: only ran for about 35 seconds this time | 13:45 |
Screwba | jodh/xnox: New paste http://pastebin.com/9V7G4B7E | 13:53 |
Screwba | updated with my testsjy.sh script and the updated .conf file | 13:53 |
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:54 |
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:58 |
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 | 13:59 |
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 :) | 14:32 |
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:10 |
Screwba | jodh / xnox: I am now getting a log file in /var/log/upstart/mytesttask.log | 15:11 |
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. | 15:59 |
Screwba | xnox / jodh: is it possible to totally pause the boot up between network-interface and rc until my script totally finishes? | 16:00 |
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:24 |
Screwba | jodh: ahhhhhhhh...so my start on should look like: start on starting network-interface INTERFACE!=lo | 16:25 |
Screwba | jodh: or the full string `start on starting network-interface INTERFACE!=lo and starting rc RUNLEVEL=[2345]` | 16:27 |
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:28 |
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:30 |
jodh | Screwba: sounds like you want to use cloud-init. That solves your problem in a generic manner: https://launchpad.net/cloud-init | 16:31 |
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:32 |
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:33 |
jodh | Screwba: maybe ping smoser then? | 16:34 |
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:35 |
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:36 |
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:37 |
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:39 |
Screwba | I really need this done before the GUI login is shown | 16:40 |
Screwba | =) | 16:40 |
xnox | Screwba: echo "start on started my-ad-task" >> /etc/init/lightdm.override | 16:41 |
xnox | Screwba: lightdm will not come up, until my-ad-task is finished & thus no-one will be able to login. | 16:42 |
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:43 |
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 | 16:44 |
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:52 |
Screwba | how does the script get the $JOB variable populated? is it internal to UpStart? | 20:55 |
=== jamescarr_ is now known as jamescarr |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!