From 7619dc0bef58d00c816b6628e457a85845b9edee Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 26 Nov 2022 12:59:28 +0100 Subject: Cleanup via cron/systemd --- debian/README.Debian | 7 +++++++ debian/control | 2 +- debian/dirs | 1 - debian/rules | 6 ++++++ debian/whiteboard.conf | 3 --- debian/whiteboard.dirs | 1 + debian/whiteboard.install | 1 - debian/whiteboard.service | 13 ------------- debian/whiteboard.whiteboard-cleanup.service | 10 ++++++++++ debian/whiteboard.whiteboard-cleanup.timer | 10 ++++++++++ debian/whiteboard.whiteboard.service | 13 +++++++++++++ 11 files changed, 48 insertions(+), 19 deletions(-) delete mode 100644 debian/dirs delete mode 100644 debian/whiteboard.conf create mode 100644 debian/whiteboard.dirs delete mode 100644 debian/whiteboard.install delete mode 100644 debian/whiteboard.service create mode 100644 debian/whiteboard.whiteboard-cleanup.service create mode 100644 debian/whiteboard.whiteboard-cleanup.timer create mode 100644 debian/whiteboard.whiteboard.service (limited to 'debian') diff --git a/debian/README.Debian b/debian/README.Debian index f3f2434..07ab4d6 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -3,6 +3,10 @@ whiteboard for Debian This package is the Debian version of whiteboard. +It is an FCGI application communicating to a webserver, e.g. Reichwein.IT webserver. + +Via cron or systemd, whiteboard data in /var/lib/whiteboard is cleaned up once a day. +Data location and maximum data age can be configured via /etc/whiteboard.conf. Configuration ------------- @@ -18,6 +22,9 @@ Configuration 127.0.0.1:9014 +* Edit /etc/whiteboard.conf to adjust the whiteboard data path if different + from /var/lib/whiteboard + * Enable: # systemctl enable whiteboard.service diff --git a/debian/control b/debian/control index dc159fa..62b6e4c 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Homepage: http://www.reichwein.it/whiteboard/ Package: whiteboard Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, spawn-fcgi +Depends: ${shlibs:Depends}, ${misc:Depends}, spawn-fcgi, libxml2-utils Recommends: webserver Homepage: http://www.reichwein.it/whiteboard/ Description: Web application for an collaborative editor diff --git a/debian/dirs b/debian/dirs deleted file mode 100644 index 7b03c85..0000000 --- a/debian/dirs +++ /dev/null @@ -1 +0,0 @@ -var/lib/whiteboard diff --git a/debian/rules b/debian/rules index 9f52133..2ee2604 100755 --- a/debian/rules +++ b/debian/rules @@ -6,3 +6,9 @@ override_dh_fixperms: dh_fixperms chmod a+rwx debian/whiteboard/var/lib/whiteboard + + +override_dh_auto_install: + dh_auto_install + dh_installsystemd --name whiteboard + dh_installsystemd --name whiteboard-cleanup diff --git a/debian/whiteboard.conf b/debian/whiteboard.conf deleted file mode 100644 index 91a868a..0000000 --- a/debian/whiteboard.conf +++ /dev/null @@ -1,3 +0,0 @@ - - /var/lib/whiteboard - diff --git a/debian/whiteboard.dirs b/debian/whiteboard.dirs new file mode 100644 index 0000000..7b03c85 --- /dev/null +++ b/debian/whiteboard.dirs @@ -0,0 +1 @@ +var/lib/whiteboard diff --git a/debian/whiteboard.install b/debian/whiteboard.install deleted file mode 100644 index fa446b2..0000000 --- a/debian/whiteboard.install +++ /dev/null @@ -1 +0,0 @@ -debian/whiteboard.conf etc diff --git a/debian/whiteboard.service b/debian/whiteboard.service deleted file mode 100644 index c60f3f0..0000000 --- a/debian/whiteboard.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Whiteboard -After=network.target - -[Service] -Type=simple -# Restart=always -ExecStart=spawn-fcgi -a 127.0.0.1 -p 9014 -n -- /usr/lib/whiteboard/whiteboard.fcgi - -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/debian/whiteboard.whiteboard-cleanup.service b/debian/whiteboard.whiteboard-cleanup.service new file mode 100644 index 0000000..339c143 --- /dev/null +++ b/debian/whiteboard.whiteboard-cleanup.service @@ -0,0 +1,10 @@ +[Unit] +Description=Cleanup whiteboard data +Wants=whiteboard-cleanup.timer + +[Service] +Type=oneshot +ExecStart=/usr/bin/whiteboard-cleanup + +[Install] +WantedBy=multi-user.target diff --git a/debian/whiteboard.whiteboard-cleanup.timer b/debian/whiteboard.whiteboard-cleanup.timer new file mode 100644 index 0000000..e2c93f9 --- /dev/null +++ b/debian/whiteboard.whiteboard-cleanup.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Clean up whiteboard data +Requires=whiteboard-cleanup.service + +[Timer] +Unit=whiteboard-cleanup.service +OnCalendar=*-*-* 00:00:00 + +[Install] +WantedBy=timers.target diff --git a/debian/whiteboard.whiteboard.service b/debian/whiteboard.whiteboard.service new file mode 100644 index 0000000..c60f3f0 --- /dev/null +++ b/debian/whiteboard.whiteboard.service @@ -0,0 +1,13 @@ +[Unit] +Description=Whiteboard +After=network.target + +[Service] +Type=simple +# Restart=always +ExecStart=spawn-fcgi -a 127.0.0.1 -p 9014 -n -- /usr/lib/whiteboard/whiteboard.fcgi + +Restart=always + +[Install] +WantedBy=multi-user.target -- cgit v1.2.3