File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,6 +213,12 @@ https://github.com/networkupstools/nut/milestone/9
213213 with either or both, maximizing compatibility with old and new setups.
214214 [#2946]
215215
216+ - `upsmon` client:
217+ * Clearer debug logging of `SHUTDOWNCMD` and `NOTIFYCMD` that would be used
218+ (or warnings that none was set); flush output buffers after these messages
219+ and after each main loop cycle, so any emitted text is seen in a timely
220+ manner. [issue #3003, PR #3008]
221+
216222 - Manual page recipes and contents:
217223 * Introduced handling (possibly rewriting) for man page section "Overviews,
218224 conventions, and miscellaneous" (commonly number 7), to deliver support
Original file line number Diff line number Diff line change @@ -3823,11 +3823,22 @@ int main(int argc, char *argv[])
38233823 if (checking_flag )
38243824 exit (check_pdflag ());
38253825
3826- if (shutdowncmd == NULL )
3826+ if (shutdowncmd == NULL ) {
38273827 printf ("Warning: no shutdown command defined%s\n" ,
38283828 (minsupplies < 1 )
38293829 ? ", but that is OK for a monitoring-only client."
38303830 : "!" );
3831+ fflush (stdout );
3832+ } else {
3833+ upsdebugx (1 , "will use a shutdown command (SHUTDOWNCMD): '%s'" , shutdowncmd );
3834+ }
3835+
3836+ if (notifycmd == NULL ) {
3837+ printf ("Warning: no custom notification command defined, just so you know\n" );
3838+ fflush (stdout );
3839+ } else {
3840+ upsdebugx (1 , "will use custom notification command (NOTIFYCMD): '%s'" , notifycmd );
3841+ }
38313842
38323843 /* we may need to get rid of a flag from a previous shutdown */
38333844 if (powerdownflag != NULL )
@@ -4162,8 +4173,10 @@ int main(int argc, char *argv[])
41624173 }
41634174
41644175end_loop_cycle :
4165- /* No-op to avoid a warning about label at end of compound statement */
4166- (void )1 ;
4176+ /* If anyone printed anything, be sure it is output
4177+ * in a timely manner, not buffered indefinitely: */
4178+ fflush (stdout );
4179+ fflush (stderr );
41674180 }
41684181
41694182 upslogx (LOG_INFO , "Signal %d: exiting" , exit_flag );
You can’t perform that action at this time.
0 commit comments