On Fri Aug 29, 2025 at 12:04 PM CEST, Diederik de Haas wrote:
> On Sun Jul 6, 2025 at 5:46 PM CEST, Diederik de Haas wrote:
>> Source: icecc
>> Version: 1.4-1
>>
>> Based upon what Fedora has [1], I adopted it for Debian (variable
>> names), made it (more) consistent and expanded it so that all variables
>> as defined in ``/etc/icecc/icecc.conf`` would be handled.
>>
>> I'm neither a systemd 'expert', nor have I used icecc much (yet), but
>> when I installed the services, they at least started succesfully.
>
> I submitted a MR with a slightly adjusted version, together with some
> other (minor) lintian fixes here:
>
> https://salsa.debian.org/qt-kde-team/extras/icecc/-/merge_requests/2

I've updated the MR today as it contained 2 bugs and I've attached the
commits from MR 2 to this mail as patches.
From 695c19c520f297af9de57ff49776323a313c1b16 Mon Sep 17 00:00:00 2001
From: Diederik de Haas <[email protected]>
Date: Wed, 27 Aug 2025 14:03:19 +0200
Subject: [PATCH 1/6] Add systemd unit files

Not having native systemd unit files now causes lintian errors and
systemd was already spamming 'dmesg' about this issue.
So add systemd unit files which references wrapper scripts which parses
the config file and then starts the executable with those params.
I added a note why running the whole systemd unit as user 'icecc'
doesn't work (ie missing CAPNG_EFFECTIVE and CAP_SYS_CHROOT
permissions).

This implementation is based on what Fedora has, but adapted it for
Debian, made it more consistent and used the long-form parameter names
as that's more descriptive and thus easier to understand.

Arch Linux also has a similar implementation. They do hardcode 'Nice=5'
in their 'icecream.service' file, which I did not do. I do believe that
it's a more appropriate place, which also makes the service start with
adjusted niceness, but moving niceness out of icecc and into service
managers is something which should be done upstream.

Closes: #1039226

Fixes-lintian-tag: missing-systemd-service-for-init.d-script
Link: https://bugs.debian.org/1039226
Link: https://src.fedoraproject.org/rpms/icecream/tree/rawhide
Link: https://aur.archlinux.org/cgit/aur.git/tree/?h=icecream
Signed-off-by: Diederik de Haas <[email protected]>
---
 debian/changelog                       |  3 ++
 debian/icecc-scheduler-systemd-wrapper | 21 +++++++++++
 debian/icecc.icecc-scheduler.service   | 13 +++++++
 debian/icecc.iceccd.service            | 21 +++++++++++
 debian/icecc.install                   |  3 ++
 debian/iceccd-systemd-wrapper          | 48 ++++++++++++++++++++++++++
 debian/rules                           |  4 +++
 7 files changed, 113 insertions(+)
 create mode 100755 debian/icecc-scheduler-systemd-wrapper
 create mode 100644 debian/icecc.icecc-scheduler.service
 create mode 100644 debian/icecc.iceccd.service
 create mode 100755 debian/iceccd-systemd-wrapper

diff --git a/debian/changelog b/debian/changelog
index 70edd0c..478d17a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,9 @@ icecc (1.4-2) UNRELEASED; urgency=medium
     - drop the kfreebsd-specific libdevstat-dev build dependency, and dependency
       of the libicecc-dev binary package
 
+  [ Diederik de Haas ]
+  * Add systemd unit files (Closes: #1039226)
+
  -- Debian KDE Extras Team <[email protected]>  Sat, 03 Dec 2022 09:55:58 +0100
 
 icecc (1.4-1) unstable; urgency=medium
diff --git a/debian/icecc-scheduler-systemd-wrapper b/debian/icecc-scheduler-systemd-wrapper
new file mode 100755
index 0000000..1d9780d
--- /dev/null
+++ b/debian/icecc-scheduler-systemd-wrapper
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/icecc-scheduler
+CONFIGFILE=/etc/icecc/icecc.conf
+
+[ -e $CONFIGFILE ] && . $CONFIGFILE
+
+params=""
+
+if [ -n "$ICECC_NETNAME" ] ; then
+	params="$params --netname $ICECC_NETNAME"
+fi
+
+if [ -n "$ICECC_SCHEDULER_LOG_FILE" ] ; then
+	params="$params --log-file $ICECC_SCHEDULER_LOG_FILE"
+else
+	params="$params --log-file /var/log/icecc_scheduler"
+fi
+
+
+exec $DAEMON $params
diff --git a/debian/icecc.icecc-scheduler.service b/debian/icecc.icecc-scheduler.service
new file mode 100644
index 0000000..75c42f9
--- /dev/null
+++ b/debian/icecc.icecc-scheduler.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Icecream Distributed Compiler Scheduler
+Documentation=man:icecc-scheduler(1)
+
+[Service]
+Type=simple
+User=icecc
+Group=icecc
+SyslogIdentifier=icecc-scheduler
+ExecStart=/usr/libexec/icecc/icecc-scheduler-systemd-wrapper
+
+[Install]
+WantedBy=multi-user.target
diff --git a/debian/icecc.iceccd.service b/debian/icecc.iceccd.service
new file mode 100644
index 0000000..fc0f56b
--- /dev/null
+++ b/debian/icecc.iceccd.service
@@ -0,0 +1,21 @@
+[Unit]
+Description=Icecream Distributed Compiler
+Documentation=man:iceccd(1)
+After=network.target nss-lookup.target
+
+[Service]
+Type=simple
+# Set SHELL so that icecc-create-env does not have to attempt to detect its
+# value by reading /etc/passwd. The SELinux policy does not need to allow it.
+Environment=SHELL=/bin/bash
+SyslogIdentifier=iceccd
+# Running the whole unit as user icecc does not work due to insufficient
+# permissions. It needs at least CAPNG_EFFECTIVE and CAP_SYS_CHROOT to work
+# https://github.com/icecc/icecream/blob/1.4-branch/daemon/main.cpp#L2510
+# So pass the ``-u icecc`` parameter to the wrapper script
+#User=icecc
+#Group=icecc
+ExecStart=/usr/libexec/icecc/iceccd-systemd-wrapper -u icecc
+
+[Install]
+WantedBy=multi-user.target
diff --git a/debian/icecc.install b/debian/icecc.install
index 27314de..8883335 100644
--- a/debian/icecc.install
+++ b/debian/icecc.install
@@ -19,3 +19,6 @@ usr/share/man/man1/icecc.1
 usr/share/man/man1/iceccd.1
 usr/share/man/man1/icerun.1
 usr/share/man/man7/icecream.7
+#-- for systemd
+debian/iceccd-systemd-wrapper usr/libexec/icecc
+debian/icecc-scheduler-systemd-wrapper usr/libexec/icecc
diff --git a/debian/iceccd-systemd-wrapper b/debian/iceccd-systemd-wrapper
new file mode 100755
index 0000000..d87dac0
--- /dev/null
+++ b/debian/iceccd-systemd-wrapper
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/iceccd
+CONFIGFILE=/etc/icecc/icecc.conf
+
+[ -e $CONFIGFILE ] && . $CONFIGFILE
+
+params=""
+
+if [ -n "$ICECC_NICE_LEVEL" ] ; then
+	params="$params --nice $ICECC_NICE_LEVEL"
+fi
+
+if [ -n "$ICECC_LOG_FILE" ] ; then
+	params="$params --log-file $ICECC_LOG_FILE"
+fi
+
+if [ -n "$ICECC_NETNAME" ] ; then
+	params="$params --netname $ICECC_NETNAME"
+fi
+
+if [ -n "$ICECC_MAX_JOBS" ] ; then
+	if [ "$ICECC_MAX_JOBS" -eq 0 ] ; then
+		params="$params --max-processes 1"
+		params="$params --no-remote"
+	else
+		params="$params --max-processes $ICECC_MAX_JOBS"
+	fi
+fi
+
+if [ "$ICECC_ALLOW_REMOTE" != "yes" ] ; then
+	params="$params --no-remote"
+fi
+
+if [ -n "$ICECC_BASEDIR" ] ; then
+	params="$params --env-basedir $ICECC_BASEDIR"
+fi
+
+if [ -n "$ICECC_SCHEDULER_HOST" ] ; then
+	params="$params --scheduler-host $ICECC_SCHEDULER_HOST"
+fi
+
+if [ -n "$ICECC_CACHE_LIMIT" ] ; then
+	params="$params --cache-limit $ICECC_CACHE_LIMIT"
+fi
+
+
+exec $DAEMON "$@" $params
diff --git a/debian/rules b/debian/rules
index 279e864..579180c 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,4 +19,8 @@ override_dh_installinit:
 	dh_installinit -picecc --name=iceccd
 	dh_installinit -picecc --name=icecc-scheduler --noscripts
 
+override_dh_installsystemd:
+	dh_installsystemd -picecc --name=iceccd
+	dh_installsystemd -picecc --name=icecc-scheduler --noscripts
+
 .PHONY: override_dh_auto_test
-- 
2.53.0

From e18c30cd1c3481a983162f23a79c453fd2c99a51 Mon Sep 17 00:00:00 2001
From: Diederik de Haas <[email protected]>
Date: Wed, 27 Aug 2025 16:33:04 +0200
Subject: [PATCH 2/6] Replace old FSF address with URL

Lintian complained about references to the old postal address of the
FSF, so replace it with an URL.

Fixes-lintian-tag: old-fsf-address-in-copyright-file
Signed-off-by: Diederik de Haas <[email protected]>
---
 debian/changelog | 1 +
 debian/copyright | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 478d17a..03c1bd1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ icecc (1.4-2) UNRELEASED; urgency=medium
 
   [ Diederik de Haas ]
   * Add systemd unit files (Closes: #1039226)
+  * Replace old FSF address with URL
 
  -- Debian KDE Extras Team <[email protected]>  Sat, 03 Dec 2022 09:55:58 +0100
 
diff --git a/debian/copyright b/debian/copyright
index a0ba9b3..40504ef 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -85,8 +85,7 @@ License for icecc:
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this package; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 On Debian systems, the complete text of the GNU General
 Public License can be found in `/usr/share/common-licenses/GPL-2'.
-- 
2.53.0

From 1b5d912ec2719b7eae720de913a311755401b276 Mon Sep 17 00:00:00 2001
From: Diederik de Haas <[email protected]>
Date: Wed, 27 Aug 2025 16:37:06 +0200
Subject: [PATCH 3/6] Replace pkg-config build dependency with pkgconf

The pkg-config package is now a transitional package, so replace it with
its target pkgconf.

Fixes-lintian-tag: build-depends-on-obsolete-package
Signed-off-by: Diederik de Haas <[email protected]>
---
 debian/changelog | 1 +
 debian/control   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 03c1bd1..d570a26 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ icecc (1.4-2) UNRELEASED; urgency=medium
   [ Diederik de Haas ]
   * Add systemd unit files (Closes: #1039226)
   * Replace old FSF address with URL
+  * Replace pkg-config build dependency with pkgconf
 
  -- Debian KDE Extras Team <[email protected]>  Sat, 03 Dec 2022 09:55:58 +0100
 
diff --git a/debian/control b/debian/control
index 7379cc5..9857854 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Uploaders: Mark Purcell <[email protected]>,
  Pino Toscano <[email protected]>
 Build-Depends: debhelper-compat (= 12),
  docbook2x, docbook-xml,
- pkg-config,
+ pkgconf,
  libarchive-dev,
  liblzo2-dev,
  libzstd-dev,
-- 
2.53.0

From b626ccb45bf1521b8786459a7f221c774762337e Mon Sep 17 00:00:00 2001
From: Diederik de Haas <[email protected]>
Date: Wed, 27 Aug 2025 16:40:00 +0200
Subject: [PATCH 4/6] Drop lsb-base dependency

The lsb-base package is now a transitional package and its replacement
is sysvinit-utils. But that package is 'Essential: yes' and as we don't
need a specific version of it, the dependency can be dropped.

Fixes-lintian-tag: depends-on-obsolete-package
Signed-off-by: Diederik de Haas <[email protected]>
---
 debian/changelog | 1 +
 debian/control   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index d570a26..49fdb55 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,7 @@ icecc (1.4-2) UNRELEASED; urgency=medium
   * Add systemd unit files (Closes: #1039226)
   * Replace old FSF address with URL
   * Replace pkg-config build dependency with pkgconf
+  * Drop lsb-base dependency
 
  -- Debian KDE Extras Team <[email protected]>  Sat, 03 Dec 2022 09:55:58 +0100
 
diff --git a/debian/control b/debian/control
index 9857854..80b7d2d 100644
--- a/debian/control
+++ b/debian/control
@@ -20,7 +20,7 @@ Rules-Requires-Root: no
 Package: icecc
 Architecture: any
 Pre-Depends: ${misc:Pre-Depends}
-Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base, file,
+Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, file,
  g++ | c++-compiler | c-compiler
 Recommends: logrotate
 Suggests: icecc-monitor, clang [amd64 i386]
-- 
2.53.0

From 0127e4c76d5ff48adfc8c7589b55e461149fb6e0 Mon Sep 17 00:00:00 2001
From: Diederik de Haas <[email protected]>
Date: Wed, 27 Aug 2025 16:44:22 +0200
Subject: [PATCH 5/6] Bump debhelper-compat to 13

The current debhelper-compat has been at 13 for a while now, so let's
switch to it.

Fixes-lintian-tag: package-uses-old-debhelper-compat-version
Signed-off-by: Diederik de Haas <[email protected]>
---
 debian/changelog | 1 +
 debian/control   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 49fdb55..03f8a78 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,7 @@ icecc (1.4-2) UNRELEASED; urgency=medium
   * Replace old FSF address with URL
   * Replace pkg-config build dependency with pkgconf
   * Drop lsb-base dependency
+  * Bump debhelper-compat to 13
 
  -- Debian KDE Extras Team <[email protected]>  Sat, 03 Dec 2022 09:55:58 +0100
 
diff --git a/debian/control b/debian/control
index 80b7d2d..2400357 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian KDE Extras Team <[email protected]>
 Uploaders: Mark Purcell <[email protected]>,
  Pino Toscano <[email protected]>
-Build-Depends: debhelper-compat (= 12),
+Build-Depends: debhelper-compat (= 13),
  docbook2x, docbook-xml,
  pkgconf,
  libarchive-dev,
-- 
2.53.0

From 41881e7715bac2d63e8f251a12707c383c650fd7 Mon Sep 17 00:00:00 2001
From: Diederik de Haas <[email protected]>
Date: Wed, 27 Aug 2025 17:00:19 +0200
Subject: [PATCH 6/6] Bump Standards-Version to 4.7.2, no changes required.

Since S-V 4.7.0 according to paragraph 6.3, packages must now provide
systemd units, but that happened a few commit ago, so no additional
changes were required for that.

Fixes-lintian-tag: out-of-date-standards-version
Signed-off-by: Diederik de Haas <[email protected]>
---
 debian/changelog | 1 +
 debian/control   | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 03f8a78..3e06989 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,7 @@ icecc (1.4-2) UNRELEASED; urgency=medium
   * Replace pkg-config build dependency with pkgconf
   * Drop lsb-base dependency
   * Bump debhelper-compat to 13
+  * Bump Standards-Version to 4.7.2, no changes required.
 
  -- Debian KDE Extras Team <[email protected]>  Sat, 03 Dec 2022 09:55:58 +0100
 
diff --git a/debian/control b/debian/control
index 2400357..ef3d0e8 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@ Build-Depends: debhelper-compat (= 13),
  libzstd-dev,
  libcap-ng-dev [linux-any],
 Homepage: https://github.com/icecc/icecream
-Standards-Version: 4.6.0
+Standards-Version: 4.7.2
 Vcs-Git: https://salsa.debian.org/qt-kde-team/extras/icecc.git
 Vcs-Browser: https://salsa.debian.org/qt-kde-team/extras/icecc
 Rules-Requires-Root: no
-- 
2.53.0

Attachment: signature.asc
Description: PGP signature

Reply via email to