The scheduler's `-t` option did not force all errors to the standard error
file, making debugging of configuration problems hard (Issue #5041)
diff --git a/CHANGES.md b/CHANGES.md
index f5c88c7..b247c1f 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -4,6 +4,8 @@
 CHANGES IN CUPS V2.2.5
 ----------------------
 
+- The scheduler's `-t` option did not force all errors to the standard error
+  file, making debugging of configuration problems hard (Issue #5041)
 - Fixed a typo in the CUPS Programming Manual (Issue #5042)
 - Fixed RPM packaging issue (Issue #5043, Issue #5044)
 - The `cupsGetDests` function incorrectly returned an empty list of printers if
diff --git a/scheduler/conf.c b/scheduler/conf.c
index 3897073..dcac7b6 100644
--- a/scheduler/conf.c
+++ b/scheduler/conf.c
@@ -190,7 +190,7 @@
 static int		parse_aaa(cupsd_location_t *loc, char *line,
 			          char *value, int linenum);
 static int		parse_fatal_errors(const char *s);
-static int		parse_groups(const char *s);
+static int		parse_groups(const char *s, int linenum);
 static int		parse_protocols(const char *s);
 static int		parse_variable(const char *filename, int linenum,
 			               const char *line, const char *value,
@@ -953,7 +953,7 @@
 
   if (NumSystemGroups == 0)
   {
-    if (!parse_groups(CUPS_DEFAULT_SYSTEM_GROUPS))
+    if (!parse_groups(CUPS_DEFAULT_SYSTEM_GROUPS, 0))
     {
      /*
       * Find the group associated with GID 0...
@@ -2494,7 +2494,8 @@
  */
 
 static int				/* O - 1 on success, 0 on failure */
-parse_groups(const char *s)		/* I - Space-delimited groups */
+parse_groups(const char *s,		/* I - Space-delimited groups */
+             int        linenum)        /* I - Line number in cups-files.conf */
 {
   int		status;			/* Return status */
   char		value[1024],		/* Value string */
@@ -2550,7 +2551,14 @@
       NumSystemGroups ++;
     }
     else
+    {
+      if (linenum)
+        cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown SystemGroup \"%s\" on line %d of %s.", valstart, linenum, CupsFilesFile);
+      else
+        cupsdLogMessage(CUPSD_LOG_ERROR, "Unknown default SystemGroup \"%s\".", valstart);
+
       status = 0;
+    }
 
     endgrent();
 
@@ -3547,11 +3555,8 @@
       * SystemGroup (admin) group(s)...
       */
 
-      if (!parse_groups(value))
+      if (!parse_groups(value, linenum))
       {
-	cupsdLogMessage(CUPSD_LOG_ERROR,
-	                "Unknown SystemGroup \"%s\" on line %d of %s.", value,
-	                linenum, CupsFilesFile);
         if (FatalErrors & CUPSD_FATAL_CONFIG)
           return (0);
       }
diff --git a/scheduler/log.c b/scheduler/log.c
index 95aa23e..3ffa193 100644
--- a/scheduler/log.c
+++ b/scheduler/log.c
@@ -1,7 +1,7 @@
 /*
  * Log file routines for the CUPS scheduler.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the