devinteske

analysis of new dumpdev service use case outcomes

Jan 18th, 2014
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. Before r256348:
  2. + '# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable' is always appended to rc.conf
  3. + User is always presented the dialog "Would you like to enable crash dumps? If you start having problems with the system it can help the FreeBSD developers debug the problem. But the crash dumps can take up a lot of disk space in /var."
  4.  
  5. Case 1 (still before r256348):
  6. - User selects "Yes" to abovementioned dialog prompt
  7. + dumpdev="AUTO" is appended to rc.conf
  8.  
  9. Case 2 (still before r256348):
  10. - User selects "No" to abovementioned dialog prompt
  11. + dumpdev="NO" is appended to rc.conf
  12.  
  13. So we have two out-comes:
  14.  
  15. Case 1 rc.conf:
  16. # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
  17. dumpdev="AUTO"
  18.  
  19. Case 2 rc.conf:
  20. # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
  21. dumpdev="NO"
  22.  
  23. The intent or r256348 is to stop asking the user if they want to enable dumbdev and instead integrate it into the services menu (enabled by default). This reduces the amount of keystrokes required to get to the very end "Reboot" option.
  24.  
  25. It seems fair to think that code should be changed so that when the dumpdev service is disabled, the same cases occur. However, this is how the current code works:
  26.  
  27. After r259276 in HEAD, or after r259621 in stable/10, or after r259652 in releng/10.0, incorporated in time for release/10.0:
  28. + The dumpdev option is now integrated into the services menu.
  29.  
  30. Case 1:
  31. - User leaves the dumpdev checklist enabled
  32. + '# Set dumpdev to "AUTO" to enable crash dumps, "NO" 'to disable' is appended to rc.conf
  33. + dumpdev="AUTO" is appended to rc.conf
  34.  
  35. Case 2:
  36. - User unchecks the dumpdev option in the services menu
  37. + dumpdev="NO" is appended to rc.conf
  38.  
  39. So again, we still have only two outcomes, but they are now:
  40.  
  41. Case 1 rc.conf:
  42. # Set dumpdev to "AUTO" to enable crash dumps, "NO" 'to disable
  43. dumpdev="AUTO"
  44.  
  45. Case 2 rc.conf:
  46. dumpdev="NO"
  47.  
  48. The proper patch to make the Case 2 outcome match the pre-r256348 Case 2 outcome would be as follows:
  49.  
  50. Index: services
  51. ===================================================================
  52. --- services (revision 259618)
  53. +++ services (working copy)
  54. @@ -63,5 +63,7 @@ for daemon in $DAEMONS; do
  55. done
  56.  
  57. if [ ! "$havedump" ]; then
  58. + echo '# Set dumpdev to "AUTO" to enable crash dumps, "NO"' \
  59. + 'to disable' >> $BSDINSTALL_TMPETC/rc.conf.services
  60. echo dumpdev=\"NO\" >> $BSDINSTALL_TMPETC/rc.conf.services
  61. fi
  62.  
  63. Note how the patch prefers to keep the comment next to the setting.
  64. EDIT: See completed/committed patch...
  65. http://svnweb.freebsd.org/base?view=revision&revision=260866
  66.  
  67. A note to the person that brought this to my attention... in this
  68. particular case, it wasn't enough to say "the comment isn't showing
  69. up" because in between r256348 and r259276 (an elapsed time of 2
  70. months) there was an unintended bug wherein the outcomes were as
  71. described:
  72.  
  73. Case 1 rc.conf (after r256348 but before r259276):
  74. dumpdev="AUTO"
  75.  
  76. Case 2 rc.conf (after r256348 but before r259276):
  77. dumpdev="NO"
  78.  
  79. So for just over 2 months, we weren't getting the comment for either outcome. I believe the above patch will restore what it is that you request, which is to have both cases produce the pre-r256348 outcomes).
  80. --
  81. Devin
Add Comment
Please, Sign In to add comment