[From nobody Mon Jul 13 19:21:08 2026
Received: (at submit) by bugs.debian.org; 14 May 2019 13:01:51 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.2-bugs.debian.org_2005_01_02
 (2018-09-13) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-5.9 required=4.0 tests=BAYES_00,FOURLA,
 MURPHY_DRUGS_REL8,SPF_FAIL,SPF_HELO_PASS,XMAILER_REPORTBUG
 autolearn=ham autolearn_force=no
 version=3.4.2-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 76; hammy, 150; neutral, 214; spammy,
 0. spammytokens: hammytokens:0.000-+--UD:init.d, 0.000-+--initd, 
 0.000-+--init.d, 0.000-+--H*M:reportbug, 0.000-+--H*MI:reportbug
Return-path: &lt;debian.mexon@spamgourmet.com&gt;
Received: from exon.name ([209.97.141.204])
 by buxtehude.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.89) (envelope-from &lt;debian.mexon@spamgourmet.com&gt;)
 id 1hQX3S-0002A2-Ke
 for submit@bugs.debian.org; Tue, 14 May 2019 13:01:51 +0000
Received: by exon.name (Postfix, from userid 1001)
 id BCE1551E76; Tue, 14 May 2019 13:47:04 +0100 (BST)
Content-Type: multipart/mixed; boundary=&quot;===============8892419884921298585==&quot;
MIME-Version: 1.0
From: Matthew Exon &lt;debian.mexon@spamgourmet.com&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: icecc: Icecream writing logs to location with no permission
Message-ID: &lt;155783802453.1517.9563365536509645315.reportbug@exon.name&gt;
X-Mailer: reportbug 7.1.8ubuntu1
Date: Tue, 14 May 2019 13:47:04 +0100
X-Greylist: delayed 847 seconds by postgrey-1.36 at buxtehude;
 Tue, 14 May 2019 13:01:14 UTC
Delivered-To: submit@bugs.debian.org

This is a multi-part MIME message sent by reportbug.


--===============8892419884921298585==
Content-Type: text/plain; charset=&quot;us-ascii&quot;
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Source: icecc
Version: 1.2-1
Severity: normal
Tags: patch

Icecream is writing its log files directly to /var/log, even though it
is running as the icecc user which has no permission to write to
/var/log.  This problem has already been reported in Ubuntu here:

https://bugs.launchpad.net/ubuntu/+source/icecc/+bug/1671926

I've attached a patch to fix it.  As suggested in the Ubuntu bug, I have
added a HUP signal when the logs are rotated.  I have also added
/etc/default files to allow easily turning up the log level.

-- System Information:
Debian Release: buster/sid
  APT prefers bionic-updates
  APT policy: (500, 'bionic-updates'), (500, 'bionic-security'), (500, 'bionic'), (100, 'bionic-backports')
Architecture: amd64 (x86_64)

Kernel: Linux 4.15.0-48-generic (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

--===============8892419884921298585==
Content-Type: text/plain; charset=&quot;us-ascii&quot;
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=&quot;icecc_1.2-1.1.patch&quot;

diff -Nru icecc-1.2/debian/changelog icecc-1.2/debian/changelog
--- icecc-1.2/debian/changelog	2018-12-21 08:29:36.000000000 +0000
+++ icecc-1.2/debian/changelog	2019-05-14 12:12:44.000000000 +0000
@@ -1,3 +1,10 @@
+icecc (1.2-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Write log files to a location with appropriate permissions 
+
+ -- Matthew Exon &lt;mat@exoniceserver1&gt;  Tue, 14 May 2019 12:12:44 +0000
+
 icecc (1.2-1) unstable; urgency=medium
 
   [ Pino Toscano ]
diff -Nru icecc-1.2/debian/icecc.conf icecc-1.2/debian/icecc.conf
--- icecc-1.2/debian/icecc.conf	2018-12-21 07:52:33.000000000 +0000
+++ icecc-1.2/debian/icecc.conf	2019-05-14 12:12:44.000000000 +0000
@@ -8,7 +8,7 @@
 # icecc daemon log file
 #
 # ICECC_LOG_FILE=&quot;/var/log/iceccd.log&quot;
-ICECC_LOG_FILE=&quot;/var/log/iceccd.log&quot;
+ICECC_LOG_FILE=&quot;/var/log/icecc/iceccd.log&quot;
 
 #
 # Identification for the network the scheduler and daemon run on.
@@ -47,7 +47,7 @@
 # icecc scheduler log file
 #
 # ICECC_SCHEDULER_LOG_FILE=&quot;/var/log/icecc_scheduler.log&quot;
-ICECC_SCHEDULER_LOG_FILE=&quot;/var/log/icecc_scheduler.log&quot;
+ICECC_SCHEDULER_LOG_FILE=&quot;/var/log/icecc/icecc_scheduler.log&quot;
 
 #
 # If the daemon can't find the scheduler by broadcast (e.g. because
diff -Nru icecc-1.2/debian/icecc.iceccd.default icecc-1.2/debian/icecc.iceccd.default
--- icecc-1.2/debian/icecc.iceccd.default	1970-01-01 00:00:00.000000000 +0000
+++ icecc-1.2/debian/icecc.iceccd.default	2019-05-14 12:12:44.000000000 +0000
@@ -0,0 +1,7 @@
+# /etc/default/icecc
+
+# Defaults for icecc initscript.  This file is sourced by
+# /bin/sh from /etc/init.d/iceccd
+
+# Options to pass to iceccd
+#ICECCD_OPTS=
diff -Nru icecc-1.2/debian/icecc.iceccd.init icecc-1.2/debian/icecc.iceccd.init
--- icecc-1.2/debian/icecc.iceccd.init	2018-12-21 07:52:33.000000000 +0000
+++ icecc-1.2/debian/icecc.iceccd.init	2019-05-14 12:12:44.000000000 +0000
@@ -12,7 +12,7 @@
 
 DAEMON=/usr/sbin/iceccd
 CONFIGFILE=/etc/icecc/icecc.conf
-DEFAULTFILE=/etc/default/icecc
+DEFAULTFILE=/etc/default/iceccd
 
 # Read configuration files
 [ -r $CONFIGFILE ] &amp;&amp; . $CONFIGFILE
@@ -59,7 +59,7 @@
 	fi
 
 	start-stop-daemon --start --quiet --exec $DAEMON -- \
-	-d $logfile $nice $scheduler $netname -u icecc $basedir $maxjobs $noremote
+	-d $logfile $nice $scheduler $netname -u icecc $ICECCD_OPTS $basedir $maxjobs $noremote
 }
 
 stop_icecc_daemon() {
diff -Nru icecc-1.2/debian/icecc.icecc-scheduler.default icecc-1.2/debian/icecc.icecc-scheduler.default
--- icecc-1.2/debian/icecc.icecc-scheduler.default	1970-01-01 00:00:00.000000000 +0000
+++ icecc-1.2/debian/icecc.icecc-scheduler.default	2019-05-14 12:12:44.000000000 +0000
@@ -0,0 +1,7 @@
+# /etc/default/icecc
+
+# Defaults for icecc initscript.  This file is sourced by
+# /bin/sh from /etc/init.d/icecc-scheduler
+
+# Options to pass to icecc-scheduler
+#ICECC_SCHEDULER_OPTS=
diff -Nru icecc-1.2/debian/icecc.icecc-scheduler.init icecc-1.2/debian/icecc.icecc-scheduler.init
--- icecc-1.2/debian/icecc.icecc-scheduler.init	2018-12-21 07:52:33.000000000 +0000
+++ icecc-1.2/debian/icecc.icecc-scheduler.init	2019-05-14 12:12:44.000000000 +0000
@@ -12,7 +12,7 @@
 
 SCHEDULER=/usr/sbin/icecc-scheduler
 CONFIGFILE=/etc/icecc/icecc.conf
-DEFAULTFILE=/etc/default/icecc
+DEFAULTFILE=/etc/default/icecc-scheduler
 
 # Read configuration files
 [ -r $CONFIGFILE ] &amp;&amp; . $CONFIGFILE
@@ -36,7 +36,7 @@
 	: &gt; $ICECC_SCHEDULER_LOG_FILE
 	chown icecc $ICECC_SCHEDULER_LOG_FILE
 	start-stop-daemon --start --quiet --chuid icecc \
-	--exec $SCHEDULER -- -d $logfile $netname
+	--exec $SCHEDULER -- $ICECC_SCHEDULER_OPTS -d $logfile $netname
 }
 
 stop_icecc_scheduler() {
diff -Nru icecc-1.2/debian/icecc.logrotate icecc-1.2/debian/icecc.logrotate
--- icecc-1.2/debian/icecc.logrotate	2018-12-21 07:52:33.000000000 +0000
+++ icecc-1.2/debian/icecc.logrotate	2019-05-14 12:12:44.000000000 +0000
@@ -7,7 +7,9 @@
 
 /var/log/iceccd.log {
        missingok
-       copytruncate
+       postrotate
+           /usr/bin/killall -HUP iceccd
+       endscript
        notifempty
 }
 
diff -Nru icecc-1.2/debian/icecc.postinst icecc-1.2/debian/icecc.postinst
--- icecc-1.2/debian/icecc.postinst	2018-12-21 07:52:33.000000000 +0000
+++ icecc-1.2/debian/icecc.postinst	2019-05-14 12:12:44.000000000 +0000
@@ -12,6 +12,7 @@
 ICECC_GROUP=icecc
 ICECC_USER=icecc
 ICECC_HOME=/var/cache/icecc
+ICECC_LOG=/var/log/icecc
 
 # create group
 getent group $ICECC_GROUP &gt; /dev/null || ( echo Creating $ICECC_GROUP group... ; \
@@ -24,6 +25,9 @@
 
 chown $ICECC_USER:$ICECC_GROUP $ICECC_HOME
 
+mkdir -p $ICECC_LOG
+chown $ICECC_USER:$ICECC_GROUP $ICECC_LOG
+
 if [ -x &quot;/etc/init.d/icecc-scheduler&quot; ]; then
         update-rc.d icecc-scheduler defaults &gt;/dev/null
         # disable icecc-scheduler either when upgrading from &lt; 1.0.0, or when
diff -Nru icecc-1.2/debian/icecc.postrm icecc-1.2/debian/icecc.postrm
--- icecc-1.2/debian/icecc.postrm	2018-12-21 07:52:33.000000000 +0000
+++ icecc-1.2/debian/icecc.postrm	2019-05-14 12:12:44.000000000 +0000
@@ -24,6 +24,7 @@
 		fi
 
 		rm -rf /var/cache/icecc
+		rm -rf /var/log/icecc
 		;;
 	remove)
 		;;

--===============8892419884921298585==--
]