/srv/irclogs.ubuntu.com/2010/01/22/#upstart.txt

mase_wkhi ppl, is it possible to use upstart to run an application when a file has been modified ?05:06
=== pocek_ is now known as pocek
sadmac2mase_wk: there's nothing built into upstart to do that14:29
sadmac2mase_wk: you could have somes sort of inotify daemon tell upstart to run things, but then you could also have it run them directly (depending on your application upstart man be the better choice)14:31
SatanClaushey guys, once more I'm trying to update my old init-scripts. this time a script which automatically performs a backup. In the old system I started it in runlevel 0 via link: /etc/rc0.d/S15backup, so after all daemons stopped, but before the partitions are unmounted.16:01
SatanClausis there some list of events, which are thrown during shutdown, so I know which event to bind my script to?16:02
sadmac2SatanClaus: that depends on your distro's setup. You should ask in #yourdistro16:03
SatanClausubuntu 9.10 again... is there some way to log all events cronologically into a file?16:04
sadmac2SatanClaus: you might make a job that just logs its triggering event to a file and make it "start on *"16:06
sadmac2...I think that works16:06
SatanClausyupp, thought about that, but 2 problems: 1: how do I assign the calling event (start on *) to a variable, which I could then log? 2: doesn't the start of my job then produce events itself (starting, etc.), which would cause an infinite loop?16:10
sadmac2SatanClaus: the infinite loop thing is... interesting16:11
sadmac2SatanClaus: the name of the event is put into the script environment for you16:11
SatanClauscan't find it in the docs again... how's that variable called then?16:13
SatanClaus$EVENT ??? ;)16:13
sadmac2I think its UPSTART_EVENTS16:13
SatanClausevents?16:13
SatanClausso possibly even multiple?16:13
sadmac2SatanClaus: yes. thanks to the "and" operator your job can actually be triggered by two or more events16:13
ionUpstart doesn’t really do shutdown in Ubuntu 9.10. The sysvrc scripts still handle it. My suggestion for the next-generation Upstart is that “system running” is a state, and anything that should happen just before shutting down should get triggered by the ‘system pre-stop’ event or equivalent, and the ‘system post-stop’ script would call reboot -f/halt -f.16:17
SatanClausah, true... cause I thought about that one as well... i first wanted to specify "ok, my backup shall be start on stopping mountall and stopping networking", but what if for any reason mountall needs to stop after networking is stopped. wouldn't that cause a lock?16:17
sadmac2SatanClaus: yes. The and operator is an ugly thing16:18
sadmac2SatanClaus: generally stay away from it.16:18
=== robbiew_ is now known as robbiew
SatanClausion: yupp, such an event would be nice16:22
SatanClaussadmac2: so upstart doesn't detect deadlocks?16:22
sadmac2SatanClaus: the theory behind upstart was that deadlocks would be impossible16:23
SatanClausok ;)16:24
SatanClausthought i just presented a counter example16:24
ionThe *implementation* is on its way to the goal. :-P16:24
SatanClaus;)16:24
SatanClausok, cause an admin should be warned about such things...16:25
sadmac2SatanClaus: the and operator was... not implemented on one of Keybuk's good days.16:25
SatanClausbut for this you'd need a simulation run, etc.16:25
ionWe can ditch the and operator in its current form as soon as we get real states into Upstart.16:25
SatanClausok, so as my backup currently runs I'll leave it like it is for now ;) nevertheless one thing: the output of the old sysinitv script is gone, can I get it back somehow?16:27
SatanClaus(i.e. the script writes output about its progress to stdout, which is gone since upstart)16:28
sadmac2SatanClaus: that's an Ubuntu issue16:30
sadmac2SatanClaus: and I think they may tell you NOTABUG when you ask16:31
ionexec >log 2>&116:31
SatanClausion: uhm, where should I put that... currently i only have the old sysinitv link in /etc/rc0.d16:31
SatanClausso there's no upstart .conf file16:32
SatanClausat least not for the backup16:32
sadmac2SatanClaus: that goes in the top of your sysvrc, and "log" is the name of a logfile16:33
sadmac2SatanClaus: so he's telling you to go log the output16:33
SatanClausuhm, but I want to see it...16:33
SatanClauswhile shutting down16:33
sadmac2SatanClaus: I believe Ubuntu policy forbids making that easy16:33
SatanClausanyhow, I know that tomcat is shown somehow, I'll investigate that ;)16:34
SatanClaushmm, i think it's bad style not to tell the user what's going on... so if all old sysinitv scripts are muted by default... ugh16:34
SatanClaushmm, i don't understand why other sysinitv scripts can show their output with echo on screen, while my script can't.16:51
SatanClausthere's no "console output" stanza in /etc/init/rc.conf16:52
SatanClausand when I track back the log-calls in /etc/rc0.d/K08tomcat6 then I can find that it uses echo as well16:52
SatanClausok, via a function in /lib/lsb/init-functions, but I don't know how this could matter.16:53
sadmac2SatanClaus: maybe its piping to somewhere16:54
SatanClausthought about that, but couldn't find anything16:55
sadmac2SatanClaus: use whatever tomcat's using16:55
SatanClausi can't, i don't only want to see echo output but also rsync16:56
sadmac2hm16:59
=== robbiew is now known as roobiew_

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