[21:02] <gansbrest> I need to run couple commands on system shutdown, how can I trigger upstart script to run on shutdown / reboot?
[21:14] <SpamapS> gansbrest: start on runlevel [06] if you want it to run in parallel with shutdown...
[21:15] <SpamapS> gansbrest: start on starting rc RUNLEVEL=[06][newline]task to have it block shutdown until it is done
[21:16] <gansbrest> if I run it on starting rc - will it run only on shutdown or on boot as well?
[21:37] <SpamapS> gansbrest: RUNLEVE=[06] means "on shutdown and reboot"
[21:38] <gansbrest> I see, so start on starting rc RUNLEVEL=[06] ( no need for AND between those? )
[21:38] <SpamapS> gansbrest: no, its not an AND, it is a filter
[21:38] <SpamapS> gansbrest: RUNLEVEL != runlevel
[21:39] <SpamapS> a bit confusing I know
[21:39] <gansbrest> I see, thanks a lot
[21:39] <SpamapS> gansbrest: 'starting rc' is the event, RUNLEVEL=[06] makes it only match if those environment vars match
[22:03] <gansbrest> one more question, I need to execute multiple commands on stop, and I'm doing it like this 
[22:03] <gansbrest> task
[22:04] <gansbrest> exec cmd1
[22:04] <gansbrest> exec cmd2
[22:04] <gansbrest> but only cmd2 gets executed?
[22:04] <gansbrest> (basically I'm calling same command but with different options )
[22:05] <gansbrest> exec /usr/bin/knife node delete
[22:05] <gansbrest> exec /usr/bin/knife node delete
[22:05] <gansbrest> exec /usr/bin/knife client delete
[22:08] <gansbrest> ----------------
[22:09] <gansbrest> created simple example which illustrates the problem
[22:09] <gansbrest> task
[22:09] <gansbrest> exec echo "YOOO" > /tmp/y 2>&1
[22:09] <gansbrest> exec echo "MUUU" > /tmp/m 2>&1
[22:09] <gansbrest> will execute only MUUU
[22:09] <gansbrest> and I need both of them
[23:02] <SpamapS> gansbrest: you want 'script\nput stuff here\nend script'
[23:02] <gansbrest> yes, but it seems like when I use script the process keeps going
[23:02] <gansbrest> where with task it waits for process to finish
[23:03] <gansbrest> I ended up moving my commands to a separate script
[23:03] <gansbrest> and execute just that one script
[23:13] <SpamapS> gansbrest: should be identical
[23:13] <SpamapS> gansbrest: script spawns /bin/sh and pipes the rest into it. with task, the 'start on' events will block until that /bin/sh exits