Advertisement
Guest User

Untitled

a guest
Nov 27th, 2015
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. /*
  2. * $ gcc -Wall -shared -fPIC -o patch_inotify_init1.so patch_inotify_init1.c
  3. *
  4. * LD_PRELOAD=patch_inotify_init1.so java ...
  5. *
  6. * [11.27.15 12:43:37.040 ERROR main .service.backup.BackupController] Exception setting up BackupController! , java.lang.UnsatisfiedLinkError: Error looking up function 'inotify_init1': /usr/local/crashplan/jre/bin/java: undefined symbol: inotify_init1
  7. * STACKTRACE:: java.lang.UnsatisfiedLinkError: Error looking up function 'inotify_init1': /usr/local/crashplan/jre/bin/java: undefined symbol: inotify_init1
  8. * at com.sun.jna.Function.<init>(Function.java:208)
  9. * at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:536)
  10. * at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:513)
  11. * at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:499)
  12. * at com.sun.jna.Library$Handler.invoke(Library.java:199)
  13. * at com.sun.proxy.$Proxy35.inotify_init1(Unknown Source)
  14. * at com.code42.jna.LinuxPlatform.inotifyInit1(LinuxPlatform.java:292)
  15. * at com.code42.jna.inotify.InotifyManager.start(InotifyManager.java:207)
  16. * at com.code42.jna.inotify.JNAInotifyFileWatcherDriver.<init>(JNAInotifyFileWatcherDriver.java:61)
  17. * at com.code42.backup.path.BackupSetsManager.initFileWatcherDriver(BackupSetsManager.java:417)
  18. * at com.code42.backup.path.BackupSetsManager.setUp(BackupSetsManager.java:153)
  19. * at com.code42.backup.BackupManager.setUp(BackupManager.java:141)
  20. * at com.backup42.service.backup.BackupController.setUp(BackupController.java:467)
  21. * at com.backup42.service.CPService.start(CPService.java:665)
  22. * at com.backup42.service.CPService.main(CPService.java:2239)
  23. *
  24. * [11.27.15 12:43:37.040 INFO main .service.backup.BackupController] BackupController.setup(): EXIT
  25. *
  26. * If you get "Unable to add watch for path ..., errno: , 28" in service.log.0, then:
  27. *
  28. * $ echo 1048576 > /proc/sys/fs/inotify/max_user_watches
  29. * sysctl.conf: fs.inotify.max_user_watches=1048576
  30. *
  31. * bin/CrashPlanEngine:
  32. *
  33. * nice -n 19 env LD_PRELOAD=$TARGETDIR/patch_inotify_init1.so $JAVACOMMON $SRV_JAVA_OPTS -classpath $FULL_CP com.backup42.service.CPService > $TARGETDIR/log/engine_output.log 2> $TARGETDIR/log/engine_error.log &
  34. */
  35.  
  36. #include <stdio.h>
  37. #include <sys/inotify.h>
  38.  
  39. int inotify_init1(int flags)
  40. {
  41. if (flags != 0) {
  42. fprintf(stderr, "inotify_init1(%d) -- BEWARE! Ignoring flags.\n", flags);
  43. }
  44.  
  45. return inotify_init();
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement