Skip to content
This repository
Browse code

inotifywait introduced with until.. sleep refactored to improve logging

  • Loading branch information...
commit ae1cc1dc73e16d0f341cd12b0585900efc0fa4cf 1 parent 74182b7
Kai Hendry authored August 06, 2012
7  etc/webc/live-config.sh
@@ -134,10 +134,11 @@ update_cmdline() {
134 134
 	touch /etc/webc/cmdline
135 135
 }
136 136
 
137  
-until test -p $live_config_pipe # wait for xinitrc to trigger an update
  137
+# wait for xinitrc to create pipe
  138
+while read OUTPUT
138 139
 do
139  
-    sleep 0.25 # wait for xinitrc to create pipe
140  
-done
  140
+    if echo $OUTPUT | grep -q "CREATE $(basename $live_config_pipe)"; then break; fi
  141
+done < <(inotifywait -qm -e create $(dirname $live_config_pipe))
141 142
 
142 143
 . "/etc/webc/webc.conf"
143 144
 cmdline_has noconfig || update_cmdline
7  etc/webc/updates.sh
@@ -45,10 +45,11 @@ update_keys() {
45 45
 	gpg --refresh-keys --keyserver hkp://keys.gnupg.net &>/dev/null && touch /var/run/gpg-check
46 46
 }
47 47
 
48  
-until test -p $updates_pipe # wait for xinitrc to trigger an update
  48
+# wait for xinitrc to create pipe
  49
+while read OUTPUT
49 50
 do
50  
-    sleep 0.25 # wait for xinitrc to create pipe
51  
-done
  51
+    if echo $OUTPUT | grep -q "CREATE $(basename $updates_pipe)"; then break; fi
  52
+done < <(inotifywait -qm -e create $(dirname $updates_pipe))
52 53
 
53 54
 # ensure $updates_url has latest $webc_id
54 55
 . "/etc/webc/webc.conf"
BIN  usr/bin/inotifywait
Binary file not shown
BIN  usr/bin/inotifywatch
Binary file not shown
1  usr/lib/libinotifytools.so.0
BIN  usr/lib/libinotifytools.so.0.4.1
Binary file not shown
41  var/lib/dpkg/available
@@ -6367,6 +6367,27 @@ Description: X Window System (X.Org) infrastructure
6367 6367
  terms are functionally interchangeable in an Debian system.
6368 6368
 Multi-Arch: foreign
6369 6369
 
  6370
+Package: inotify-tools
  6371
+Priority: optional
  6372
+Section: misc
  6373
+Installed-Size: 96
  6374
+Maintainer: Ryan Niebur <ryan@debian.org>
  6375
+Architecture: i386
  6376
+Version: 3.13-3
  6377
+Depends: libc6 (>= 2.2), libinotifytools0 (>= 3.11)
  6378
+Size: 27124
  6379
+Description: command-line programs providing a simple interface to inotify
  6380
+ inotify-tools is a set of command-line programs for Linux providing a
  6381
+ simple interface to inotify. These programs can be used to monitor and
  6382
+ act upon filesystem events. inotify-tools consists of two utilities:
  6383
+ .
  6384
+ inotifywait simply blocks for inotify events, making it appropriate
  6385
+ for use in shell scripts.
  6386
+ .
  6387
+ inotifywatch collects filesystem usage statistics and outputs counts
  6388
+ of each inotify event.
  6389
+Homepage: http://inotify-tools.sourceforge.net/
  6390
+
6370 6391
 Package: net-tools
6371 6392
 Priority: important
6372 6393
 Section: net
@@ -9641,6 +9662,26 @@ Description: small, friendly text editor inspired by Pico
9641 9662
   - full internationalization support.
9642 9663
 Homepage: http://www.nano-editor.org/
9643 9664
 
  9665
+Package: libinotifytools0
  9666
+Priority: optional
  9667
+Section: libs
  9668
+Installed-Size: 96
  9669
+Maintainer: Ryan Niebur <ryan@debian.org>
  9670
+Architecture: i386
  9671
+Source: inotify-tools
  9672
+Version: 3.13-3
  9673
+Replaces: inotify-tools (<< 3.10-2)
  9674
+Depends: libc6 (>= 2.4)
  9675
+Size: 21552
  9676
+Description: utility wrapper around inotify
  9677
+ Inotify is a Linux kernel feature enabling user space programs to
  9678
+ monitor parts of the filesystem in a efficient way. libinotifytools
  9679
+ is a thin layer on top of the kernel interface which makes it easy
  9680
+ to set up watches on many files at once, read events without having
  9681
+ to deal with low-level I/O, and several utility functions for inotify-
  9682
+ related string formatting
  9683
+Homepage: http://inotify-tools.sourceforge.net/
  9684
+
9644 9685
 Package: live-config
9645 9686
 Priority: optional
9646 9687
 Section: misc
15  var/lib/dpkg/info/inotify-tools.list
... ...
@@ -0,0 +1,15 @@
  1
+/.
  2
+/usr
  3
+/usr/bin
  4
+/usr/bin/inotifywatch
  5
+/usr/bin/inotifywait
  6
+/usr/share
  7
+/usr/share/man
  8
+/usr/share/man/man1
  9
+/usr/share/man/man1/inotifywait.1.gz
  10
+/usr/share/man/man1/inotifywatch.1.gz
  11
+/usr/share/doc
  12
+/usr/share/doc/inotify-tools
  13
+/usr/share/doc/inotify-tools/changelog.Debian.gz
  14
+/usr/share/doc/inotify-tools/changelog.gz
  15
+/usr/share/doc/inotify-tools/copyright
7  var/lib/dpkg/info/inotify-tools.md5sums
... ...
@@ -0,0 +1,7 @@
  1
+f59b3b6886b6950c1ce4d741804070cf  usr/bin/inotifywatch
  2
+696bdda97c1f171854800bef3020b86d  usr/bin/inotifywait
  3
+bca597abe84e5bab3c3504bafcb38044  usr/share/man/man1/inotifywait.1.gz
  4
+150155ddf881bb8409ba220071b0af07  usr/share/man/man1/inotifywatch.1.gz
  5
+651dac47c714180faef5c8b38b77120f  usr/share/doc/inotify-tools/changelog.Debian.gz
  6
+bec072ad3036411a770e0500e110815e  usr/share/doc/inotify-tools/changelog.gz
  7
+21c5f73c830a2494dd752e5c4f5886ce  usr/share/doc/inotify-tools/copyright
13  var/lib/dpkg/info/libinotifytools0.list
... ...
@@ -0,0 +1,13 @@
  1
+/.
  2
+/usr
  3
+/usr/lib
  4
+/usr/lib/libinotifytools.so.0.4.1
  5
+/usr/share
  6
+/usr/share/doc
  7
+/usr/share/doc/libinotifytools0
  8
+/usr/share/doc/libinotifytools0/changelog.Debian.gz
  9
+/usr/share/doc/libinotifytools0/changelog.gz
  10
+/usr/share/doc/libinotifytools0/copyright
  11
+/usr/share/doc/libinotifytools0/README
  12
+/usr/share/doc/libinotifytools0/NEWS.gz
  13
+/usr/lib/libinotifytools.so.0
6  var/lib/dpkg/info/libinotifytools0.md5sums
... ...
@@ -0,0 +1,6 @@
  1
+29fb0d578a7552d96daf75446a12dc0a  usr/lib/libinotifytools.so.0.4.1
  2
+651dac47c714180faef5c8b38b77120f  usr/share/doc/libinotifytools0/changelog.Debian.gz
  3
+bec072ad3036411a770e0500e110815e  usr/share/doc/libinotifytools0/changelog.gz
  4
+21c5f73c830a2494dd752e5c4f5886ce  usr/share/doc/libinotifytools0/copyright
  5
+b3f068e4ac2f1d5704b444d2baf70649  usr/share/doc/libinotifytools0/README
  6
+8914d446335bfc22f720955daede4b52  usr/share/doc/libinotifytools0/NEWS.gz
7  var/lib/dpkg/info/libinotifytools0.postinst
... ...
@@ -0,0 +1,7 @@
  1
+#!/bin/sh
  2
+set -e
  3
+# Automatically added by dh_makeshlibs
  4
+if [ "$1" = "configure" ]; then
  5
+	ldconfig
  6
+fi
  7
+# End automatically added section
7  var/lib/dpkg/info/libinotifytools0.postrm
... ...
@@ -0,0 +1,7 @@
  1
+#!/bin/sh
  2
+set -e
  3
+# Automatically added by dh_makeshlibs
  4
+if [ "$1" = "remove" ]; then
  5
+	ldconfig
  6
+fi
  7
+# End automatically added section
1  var/lib/dpkg/info/libinotifytools0.shlibs
... ...
@@ -0,0 +1 @@
  1
+libinotifytools 0 libinotifytools0
68  var/lib/dpkg/info/libinotifytools0.symbols
... ...
@@ -0,0 +1,68 @@
  1
+libinotifytools.so.0 libinotifytools0 #MINVER#
  2
+ _niceassert@Base 3.11
  3
+ chrtostr@Base 3.11
  4
+ cleanup_tree@Base 3.12
  5
+ create_watch@Base 3.11
  6
+ destroy_watch@Base 3.11
  7
+ empty_stats@Base 3.11
  8
+ event_compare@Base 3.11
  9
+ filename_compare@Base 3.11
  10
+ get_num@Base 3.11
  11
+ inotifytools_cleanup@Base 3.12
  12
+ inotifytools_error@Base 3.11
  13
+ inotifytools_event_to_str@Base 3.11
  14
+ inotifytools_event_to_str_sep@Base 3.11
  15
+ inotifytools_filename_from_wd@Base 3.11
  16
+ inotifytools_fprintf@Base 3.11
  17
+ inotifytools_get_max_queued_events@Base 3.11
  18
+ inotifytools_get_max_user_instances@Base 3.11
  19
+ inotifytools_get_max_user_watches@Base 3.11
  20
+ inotifytools_get_num_watches@Base 3.11
  21
+ inotifytools_get_stat_by_filename@Base 3.11
  22
+ inotifytools_get_stat_by_wd@Base 3.11
  23
+ inotifytools_get_stat_total@Base 3.11
  24
+ inotifytools_ignore_events_by_regex@Base 3.11
  25
+ inotifytools_initialize@Base 3.11
  26
+ inotifytools_initialize_stats@Base 3.11
  27
+ inotifytools_next_event@Base 3.11
  28
+ inotifytools_next_events@Base 3.11
  29
+ inotifytools_printf@Base 3.11
  30
+ inotifytools_remove_watch_by_filename@Base 3.11
  31
+ inotifytools_remove_watch_by_wd@Base 3.11
  32
+ inotifytools_replace_filename@Base 3.11
  33
+ inotifytools_set_filename_by_filename@Base 3.11
  34
+ inotifytools_set_filename_by_wd@Base 3.11
  35
+ inotifytools_set_printf_timefmt@Base 3.11
  36
+ inotifytools_snprintf@Base 3.11
  37
+ inotifytools_sprintf@Base 3.11
  38
+ inotifytools_str_to_event@Base 3.11
  39
+ inotifytools_str_to_event_sep@Base 3.11
  40
+ inotifytools_watch_file@Base 3.11
  41
+ inotifytools_watch_files@Base 3.11
  42
+ inotifytools_watch_recursively@Base 3.11
  43
+ inotifytools_watch_recursively_with_exclude@Base 3.11
  44
+ inotifytools_wd_from_filename@Base 3.11
  45
+ inotifytools_wd_sorted_by_event@Base 3.11
  46
+ isdir@Base 3.11
  47
+ onestr_to_event@Base 3.11
  48
+ rb_null@Base 3.11
  49
+ rbcloselist@Base 3.11
  50
+ rbdelete@Base 3.11
  51
+ rbdestroy@Base 3.11
  52
+ rbfind@Base 3.11
  53
+ rbinit@Base 3.11
  54
+ rblookup@Base 3.11
  55
+ rbopenlist@Base 3.11
  56
+ rbreadlist@Base 3.11
  57
+ rbsearch@Base 3.11
  58
+ rbwalk@Base 3.11
  59
+ read_num_from_file@Base 3.11
  60
+ record_stats@Base 3.11
  61
+ remove_inotify_watch@Base 3.11
  62
+ replace_filename@Base 3.11
  63
+ stat_ptr@Base 3.11
  64
+ tree_filename@Base 3.11
  65
+ tree_wd@Base 3.11
  66
+ watch_from_filename@Base 3.11
  67
+ watch_from_wd@Base 3.11
  68
+ wd_compare@Base 3.11
41  var/lib/dpkg/status
@@ -6752,6 +6752,27 @@ Description: X Window System (X.Org) infrastructure
6752 6752
  terms are functionally interchangeable in an Debian system.
6753 6753
 Multi-Arch: foreign
6754 6754
 
  6755
+Package: inotify-tools
  6756
+Status: install ok installed
  6757
+Priority: optional
  6758
+Section: misc
  6759
+Installed-Size: 96
  6760
+Maintainer: Ryan Niebur <ryan@debian.org>
  6761
+Architecture: i386
  6762
+Version: 3.13-3
  6763
+Depends: libc6 (>= 2.2), libinotifytools0 (>= 3.11)
  6764
+Description: command-line programs providing a simple interface to inotify
  6765
+ inotify-tools is a set of command-line programs for Linux providing a
  6766
+ simple interface to inotify. These programs can be used to monitor and
  6767
+ act upon filesystem events. inotify-tools consists of two utilities:
  6768
+ .
  6769
+ inotifywait simply blocks for inotify events, making it appropriate
  6770
+ for use in shell scripts.
  6771
+ .
  6772
+ inotifywatch collects filesystem usage statistics and outputs counts
  6773
+ of each inotify event.
  6774
+Homepage: http://inotify-tools.sourceforge.net/
  6775
+
6755 6776
 Package: net-tools
6756 6777
 Status: install ok installed
6757 6778
 Priority: important
@@ -10226,6 +10247,26 @@ Description: small, friendly text editor inspired by Pico
10226 10247
   - full internationalization support.
10227 10248
 Homepage: http://www.nano-editor.org/
10228 10249
 
  10250
+Package: libinotifytools0
  10251
+Status: install ok installed
  10252
+Priority: optional
  10253
+Section: libs
  10254
+Installed-Size: 96
  10255
+Maintainer: Ryan Niebur <ryan@debian.org>
  10256
+Architecture: i386
  10257
+Source: inotify-tools
  10258
+Version: 3.13-3
  10259
+Replaces: inotify-tools (<< 3.10-2)
  10260
+Depends: libc6 (>= 2.4)
  10261
+Description: utility wrapper around inotify
  10262
+ Inotify is a Linux kernel feature enabling user space programs to
  10263
+ monitor parts of the filesystem in a efficient way. libinotifytools
  10264
+ is a thin layer on top of the kernel interface which makes it easy
  10265
+ to set up watches on many files at once, read events without having
  10266
+ to deal with low-level I/O, and several utility functions for inotify-
  10267
+ related string formatting
  10268
+Homepage: http://inotify-tools.sourceforge.net/
  10269
+
10229 10270
 Package: live-config
10230 10271
 Status: install ok installed
10231 10272
 Priority: optional

0 notes on commit ae1cc1d

Please sign in to comment.
Something went wrong with that request. Please try again.