[05:06] hi ppl, is it possible to use upstart to run an application when a file has been modified ? === pocek_ is now known as pocek [14:29] mase_wk: there's nothing built into upstart to do that [14:31] mase_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) [16:01] hey 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:02] is there some list of events, which are thrown during shutdown, so I know which event to bind my script to? [16:03] SatanClaus: that depends on your distro's setup. You should ask in #yourdistro [16:04] ubuntu 9.10 again... is there some way to log all events cronologically into a file? [16:06] SatanClaus: you might make a job that just logs its triggering event to a file and make it "start on *" [16:06] ...I think that works [16:10] yupp, 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:11] SatanClaus: the infinite loop thing is... interesting [16:11] SatanClaus: the name of the event is put into the script environment for you [16:13] can't find it in the docs again... how's that variable called then? [16:13] $EVENT ??? ;) [16:13] I think its UPSTART_EVENTS [16:13] events? [16:13] so possibly even multiple? [16:13] SatanClaus: yes. thanks to the "and" operator your job can actually be triggered by two or more events [16:17] Upstart 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] ah, 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:18] SatanClaus: yes. The and operator is an ugly thing [16:18] SatanClaus: generally stay away from it. === robbiew_ is now known as robbiew [16:22] ion: yupp, such an event would be nice [16:22] sadmac2: so upstart doesn't detect deadlocks? [16:23] SatanClaus: the theory behind upstart was that deadlocks would be impossible [16:24] ok ;) [16:24] thought i just presented a counter example [16:24] The *implementation* is on its way to the goal. :-P [16:24] ;) [16:25] ok, cause an admin should be warned about such things... [16:25] SatanClaus: the and operator was... not implemented on one of Keybuk's good days. [16:25] but for this you'd need a simulation run, etc. [16:25] We can ditch the and operator in its current form as soon as we get real states into Upstart. [16:27] ok, 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:28] (i.e. the script writes output about its progress to stdout, which is gone since upstart) [16:30] SatanClaus: that's an Ubuntu issue [16:31] SatanClaus: and I think they may tell you NOTABUG when you ask [16:31] exec >log 2>&1 [16:31] ion: uhm, where should I put that... currently i only have the old sysinitv link in /etc/rc0.d [16:32] so there's no upstart .conf file [16:32] at least not for the backup [16:33] SatanClaus: that goes in the top of your sysvrc, and "log" is the name of a logfile [16:33] SatanClaus: so he's telling you to go log the output [16:33] uhm, but I want to see it... [16:33] while shutting down [16:33] SatanClaus: I believe Ubuntu policy forbids making that easy [16:34] anyhow, I know that tomcat is shown somehow, I'll investigate that ;) [16:34] hmm, 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... ugh [16:51] hmm, i don't understand why other sysinitv scripts can show their output with echo on screen, while my script can't. [16:52] there's no "console output" stanza in /etc/init/rc.conf [16:52] and when I track back the log-calls in /etc/rc0.d/K08tomcat6 then I can find that it uses echo as well [16:53] ok, via a function in /lib/lsb/init-functions, but I don't know how this could matter. [16:54] SatanClaus: maybe its piping to somewhere [16:55] thought about that, but couldn't find anything [16:55] SatanClaus: use whatever tomcat's using [16:56] i can't, i don't only want to see echo output but also rsync [16:59] hm === robbiew is now known as roobiew_