[debian-edu-commits] [Git][debian-edu/debian-edu-config][mr/cron-2-systemd-timers] 2 commits: Makefile: Use $(NULL) variable at end of file lists. Allow for better git-patch readability.

Mike Gabriel (@sunweaver) gitlab at salsa.debian.org
Mon Aug 7 17:32:42 BST 2023



Mike Gabriel pushed to branch mr/cron-2-systemd-timers at Debian Edu / debian-edu-config


Commits:
abde700b by Mike Gabriel at 2023-08-07T18:32:10+02:00
Makefile: Use $(NULL) variable at end of file lists. Allow for better git-patch readability.

- - - - -
8a74b4bb by Mike Gabriel at 2023-08-07T16:32:36+00:00
Convert CRON configuration to systemd timers.

- - - - -


15 changed files:

- Makefile
- debian/debian-edu-config.cron.daily
- debian/debian-edu-config.cron.hourly
- + debian/debian-edu-config.debian-edu-cups-queue-autoflush.service
- + debian/debian-edu-config.debian-edu-cups-queue-autoflush.timer
- + debian/debian-edu-config.debian-edu-cups-queue-autoreenable.service
- + debian/debian-edu-config.debian-edu-cups-queue-autoreenable.timer
- + debian/debian-edu-config.debian-edu-fsautoresize.service
- + debian/debian-edu-config.debian-edu-fsautoresize.timer
- + debian/debian-edu-config.debian-edu-update-netblock.service
- + debian/debian-edu-config.debian-edu-update-netblock.timer
- debian/rules
- + sbin/debian-edu-cups-queue-autoflush-for-netgroup-hosts
- + sbin/debian-edu-cups-queue-autoreenable-for-netgroup-hosts
- + sbin/debian-edu-fsautoresize-for-netgroup-hosts


Changes:

=====================================
Makefile
=====================================
@@ -1,11 +1,18 @@
 PACKAGE = debian-edu-config
 
+NULL =
+
 PROGS = \
 	debian-edu-ldapserver \
 	update-ini-file \
-	debian-edu-copy-pki
-
-SPROGS = debian-edu-fsautoresize \
+	debian-edu-copy-pki \
+	$(NULL)
+
+SPROGS = \
+	debian-edu-cups-queue-autoflush-for-netgroup-hosts \
+	debian-edu-cups-queue-autoreenable-for-netgroup-hosts \
+	debian-edu-fsautoresize \
+	debian-edu-fsautoresize-for-netgroup-hosts \
 	debian-edu-ltsp-chroot \
 	debian-edu-ltsp-install \
 	debian-edu-ltsp-initrd \
@@ -14,7 +21,8 @@ SPROGS = debian-edu-fsautoresize \
 	debian-edu-restart-services \
 	debian-edu-test-install \
 	debian-edu-update-netblock \
-	update-hostname-from-ip
+	update-hostname-from-ip \
+	$(NULL)
 
 INSTALL        = install -D -p -m 755
 INSTALL_DATA   = install -D -p -m 644
@@ -66,7 +74,8 @@ CF3FILES = \
 	cf.xrdp \
 	cf.icinga \
 	edu.cf \
-	promises.cf
+	promises.cf \
+	$(NULL)
 
 # Files to install in /etc/
 SYSCONFFILES = \
@@ -132,7 +141,8 @@ SYSCONFFILES = \
 	nagios3/debian-edu/timeperiods.cfg \
 	munin/debian-edu-munin-node.conf \
 	polkit-1/localauthority.conf.d/80-edu-admin.conf \
-	ntpsec/ntp.d/debian-edu.conf
+	ntpsec/ntp.d/debian-edu.conf \
+	$(NULL)
 
 SYSCONFSCRIPTS = \
 	dhcp/dhclient-exit-hooks.d/autofs-reload \
@@ -143,7 +153,8 @@ SYSCONFSCRIPTS = \
 	shutdown-at-night/clients-generator \
 	resolvconf/update.d/bind-debian-edu \
 	wicd/scripts/preconnect/set_wireless_mac_from_eth0 \
-	X11/Xsession-debian-edu
+	X11/Xsession-debian-edu \
+	$(NULL)
 
 SCHEMAS = \
 	autofs-debian-edu.schema \
@@ -164,7 +175,8 @@ SCHEMAS = \
 	gosa-samba3.schema \
 	gofax.schema \
 	goserver.schema \
-	goto-mime.schema
+	goto-mime.schema \
+	$(NULL)
 
 LDIFS = \
 	root.ldif \
@@ -177,7 +189,8 @@ LDIFS = \
 	krb5.ldif \
 	ltsp.ldif \
 	gosa.ldif \
-	gosa-server.ldif
+	gosa-server.ldif \
+	$(NULL)
 
 LDAPPROGRAMS = \
 	ldap-add-host-to-netgroup \
@@ -185,7 +198,8 @@ LDAPPROGRAMS = \
 	ldap-createuser-krb5 \
 	ldap2netgroup \
 	ldap-debian-edu-install \
-	sitesummary2ldapdhcp
+	sitesummary2ldapdhcp \
+	$(NULL)
 
 WWWFILES = \
 	index.html.ca \
@@ -206,10 +220,12 @@ WWWFILES = \
 	index.html.zh-tw \
 	skl-ren_css.css \
 	logo-trans.png \
-	wpad.dat
+	wpad.dat \
+	$(NULL)
 
 LIBFILES = \
 	thunderbird/distribution/policies.json \
+	$(NULL)
 
 all:
 	$(MAKE) -C www


=====================================
debian/debian-edu-config.cron.daily
=====================================
@@ -3,12 +3,5 @@
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 export PATH
 
-[ -x /usr/bin/innetgr ] || exit 0
-
-# Automatically flush print queues every night if the
-# host is a member of the cups-queue-autoflush-hosts netgroup.
-for hostname in "$(uname -n)" "$(hostname -s)" ; do
-    if innetgr -h $hostname cups-queue-autoflush-hosts ; then
-	/usr/share/debian-edu-config/tools/cups-queue-autoflush
-    fi
-done
+# regularly run CUPS Queue autoflush if configured via netgroups
+debian-edu-cups-queue-autoflush-for-netgroup-hosts


=====================================
debian/debian-edu-config.cron.hourly
=====================================
@@ -3,21 +3,8 @@
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 export PATH
 
-[ -x /usr/bin/innetgr ] || exit 0
+# regularly run fsautoresize if configured via netgroups
+debian-edu-fsautoresize-for-netgroup-hosts
 
-for hostname in "$(uname -n)" "$(hostname -s)" ; do
-
-    # Automatically extend full LVM volumes if the host is a member of
-    # the fsautoresize-hosts netgroup.
-    if [ -x /usr/sbin/debian-edu-fsautoresize ] &&
-	innetgr -h $hostname fsautoresize-hosts ; then
-        debian-edu-fsautoresize -n
-    fi
-
-    # Automatically restart disabled print queues every hour if the
-    # host is a member of the cups-queue-autoreenable-hosts netgroup.
-    if [ -x /usr/share/debian-edu-config/tools/cups-queue-autoreenable ] &&
-	innetgr -h $hostname cups-queue-autoreenable-hosts ; then
-	/usr/share/debian-edu-config/tools/cups-queue-autoreenable
-    fi
-done
+# regularly run CUPS Queue autoreenable if configured via netgroups
+debian-edu-cups-queue-autoreenable-for-netgroup-hosts


=====================================
debian/debian-edu-config.debian-edu-cups-queue-autoflush.service
=====================================
@@ -0,0 +1,6 @@
+[Unit]
+Description=Auto-flush CUPS queues on hosts configured via the cups-queue-autoflush-hosts netgroup.
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/debian-edu-cups-queue-autoflush-for-netgroup-hosts


=====================================
debian/debian-edu-config.debian-edu-cups-queue-autoflush.timer
=====================================
@@ -0,0 +1,9 @@
+[Unit]
+Description=Run d-e-cups-queue-autoreenable every day
+
+[Timer]
+OnBootSec=15min
+OnUnitActiveSec=1d
+
+[Install]
+WantedBy=timers.target


=====================================
debian/debian-edu-config.debian-edu-cups-queue-autoreenable.service
=====================================
@@ -0,0 +1,6 @@
+[Unit]
+Description=Auto-reenable CUPS queues on hosts configured via the cups-queue-autoreenable-hosts netgroup.
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/debian-edu-cups-queue-autoreenable-for-netgroup-hosts


=====================================
debian/debian-edu-config.debian-edu-cups-queue-autoreenable.timer
=====================================
@@ -0,0 +1,9 @@
+[Unit]
+Description=Run d-e-cups-queue-autoreenable every hour
+
+[Timer]
+OnBootSec=15min
+OnUnitActiveSec=1h
+
+[Install]
+WantedBy=timers.target


=====================================
debian/debian-edu-config.debian-edu-fsautoresize.service
=====================================
@@ -0,0 +1,6 @@
+[Unit]
+Description=Run fsautoresize regularly on hosts configured via the fsautoresize-hosts netgroup.
+
+[Service]
+Type=oneshot
+ExecStart=/usr/sbin/debian-edu-fsautoresize-for-netgroup-hosts


=====================================
debian/debian-edu-config.debian-edu-fsautoresize.timer
=====================================
@@ -0,0 +1,9 @@
+[Unit]
+Description=Run d-e-fsautoresize every hour
+
+[Timer]
+OnBootSec=15min
+OnUnitActiveSec=1h
+
+[Install]
+WantedBy=timers.target


=====================================
debian/debian-edu-config.debian-edu-update-netblock.service
=====================================
@@ -0,0 +1,6 @@
+[Unit]
+Description=Update netblock according to netblock-hosts netgroup configuration.
+
+[Service]
+Type=oneshot
+ExecStart="/usr/sbin/debian-edu-update-netblock auto"


=====================================
debian/debian-edu-config.debian-edu-update-netblock.timer
=====================================
@@ -0,0 +1,9 @@
+[Unit]
+Description=Run d-e-update-netblock every 5 minutes
+
+[Timer]
+OnBootSec=15min
+OnUnitActiveSec=5min
+
+[Install]
+WantedBy=timers.target


=====================================
debian/rules
=====================================
@@ -21,6 +21,10 @@ override_dh_installsystemd:
 	dh_installsystemd --no-start --name enable-nat
 	dh_installsystemd --no-start --name fetch-rootca-cert
 	dh_installsystemd --no-start --name firefox-ldapconf
+	dh_installsystemd --no-start --name debian-edu-fsautoresize
+	dh_installsystemd --no-start --name debian-edu-update-netblock
+	dh_installsystemd --no-start --name debian-edu-cups-queue-autoflush
+	dh_installsystemd --no-start --name debian-edu-cups-queue-autoreenable
 
 override_dh_installman:
 	dh_installman


=====================================
sbin/debian-edu-cups-queue-autoflush-for-netgroup-hosts
=====================================
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+[ -x /usr/bin/innetgr ] || exit 0
+
+# Automatically flush print queues every night if the
+# host is a member of the cups-queue-autoflush-hosts netgroup.
+for hostname in "$(uname -n)" "$(hostname -s)" ; do
+    if innetgr -h $hostname cups-queue-autoflush-hosts ; then
+	/usr/share/debian-edu-config/tools/cups-queue-autoflush
+    fi
+done


=====================================
sbin/debian-edu-cups-queue-autoreenable-for-netgroup-hosts
=====================================
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+[ -x /usr/bin/innetgr ] || exit 0
+
+for hostname in "$(uname -n)" "$(hostname -s)" ; do
+
+    # Automatically extend full LVM volumes if the host is a member of
+    # the fsautoresize-hosts netgroup.
+    if [ -x /usr/sbin/debian-edu-fsautoresize ] &&
+	innetgr -h $hostname fsautoresize-hosts ; then
+        debian-edu-fsautoresize -n
+    fi
+
+    # Automatically restart disabled print queues every hour if the
+    # host is a member of the cups-queue-autoreenable-hosts netgroup.
+    if [ -x /usr/share/debian-edu-config/tools/cups-queue-autoreenable ] &&
+	innetgr -h $hostname cups-queue-autoreenable-hosts ; then
+	/usr/share/debian-edu-config/tools/cups-queue-autoreenable
+    fi
+done


=====================================
sbin/debian-edu-fsautoresize-for-netgroup-hosts
=====================================
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+[ -x /usr/bin/innetgr ] || exit 0
+
+for hostname in "$(uname -n)" "$(hostname -s)" ; do
+
+    # Automatically extend full LVM volumes if the host is a member of
+    # the fsautoresize-hosts netgroup.
+    if [ -x /usr/sbin/debian-edu-fsautoresize ] &&
+	innetgr -h $hostname fsautoresize-hosts ; then
+        debian-edu-fsautoresize -n
+    fi
+
+done



View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/compare/77f4781679797e1f63e81f61a9dc9f5da72bb541...8a74b4bb6db4c456ae53e593c3213addfecf5db5

-- 
View it on GitLab: https://salsa.debian.org/debian-edu/debian-edu-config/-/compare/77f4781679797e1f63e81f61a9dc9f5da72bb541...8a74b4bb6db4c456ae53e593c3213addfecf5db5
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-edu-commits/attachments/20230807/cfce9f82/attachment-0001.htm>


More information about the debian-edu-commits mailing list