/srv/irclogs.ubuntu.com/2013/05/06/#upstart.txt

=== soren_ is now known as soren
gansbrestI need to run couple commands on system shutdown, how can I trigger upstart script to run on shutdown / reboot?21:02
SpamapSgansbrest: start on runlevel [06] if you want it to run in parallel with shutdown...21:14
SpamapSgansbrest: start on starting rc RUNLEVEL=[06][newline]task to have it block shutdown until it is done21:15
gansbrestif I run it on starting rc - will it run only on shutdown or on boot as well?21:16
SpamapSgansbrest: RUNLEVE=[06] means "on shutdown and reboot"21:37
gansbrestI see, so start on starting rc RUNLEVEL=[06] ( no need for AND between those? )21:38
SpamapSgansbrest: no, its not an AND, it is a filter21:38
SpamapSgansbrest: RUNLEVEL != runlevel21:38
SpamapSa bit confusing I know21:39
gansbrestI see, thanks a lot21:39
SpamapSgansbrest: 'starting rc' is the event, RUNLEVEL=[06] makes it only match if those environment vars match21:39
gansbrestone more question, I need to execute multiple commands on stop, and I'm doing it like this 22:03
gansbresttask22:03
gansbrestexec cmd122:04
gansbrestexec cmd222:04
gansbrestbut only cmd2 gets executed?22:04
gansbrest(basically I'm calling same command but with different options )22:04
gansbrestexec /usr/bin/knife node delete22:05
gansbrestexec /usr/bin/knife node delete22:05
gansbrestexec /usr/bin/knife client delete22:05
gansbrest----------------22:08
gansbrestcreated simple example which illustrates the problem22:09
gansbresttask22:09
gansbrestexec echo "YOOO" > /tmp/y 2>&122:09
gansbrestexec echo "MUUU" > /tmp/m 2>&122:09
gansbrestwill execute only MUUU22:09
gansbrestand I need both of them22:09
SpamapSgansbrest: you want 'script\nput stuff here\nend script'23:02
gansbrestyes, but it seems like when I use script the process keeps going23:02
gansbrestwhere with task it waits for process to finish23:02
gansbrestI ended up moving my commands to a separate script23:03
gansbrestand execute just that one script23:03
SpamapSgansbrest: should be identical23:13
SpamapSgansbrest: script spawns /bin/sh and pipes the rest into it. with task, the 'start on' events will block until that /bin/sh exits23:13

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!