Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-30 Thread Jonathan Wiltshire
On Fri, Jun 30, 2023 at 02:44:54PM +0200, Francesco P. Lovergine wrote:
> On Fri, Jun 30, 2023 at 12:54:23PM +0100, Jonathan Wiltshire wrote:
> > 
> > Can I have a source-only upload please? I'll reject the upload for now, you
> > can reuse the same version.
> > 
> 
> Done.

You'll need to bump the version and make a source-only upload to unstable
as well for testing migration.

Thanks,

-- 
Jonathan Wiltshire  j...@debian.org
Debian Developer http://people.debian.org/~jmw

4096R: 0xD3524C51 / 0A55 B7C5 1223 3942 86EC  74C3 5394 479D D352 4C51
ed25519/0x196418AAEB74C8A1: CA619D65A72A7BADFC96D280196418AAEB74C8A1



Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-30 Thread Francesco P. Lovergine

On Fri, Jun 30, 2023 at 12:54:23PM +0100, Jonathan Wiltshire wrote:


Can I have a source-only upload please? I'll reject the upload for now, you
can reuse the same version.



Done.

--
Francesco P. Lovergine



Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-30 Thread Jonathan Wiltshire
On Tue, Jun 27, 2023 at 08:44:53PM +0100, Jonathan Wiltshire wrote:
> Control: tag -1 confirmed
> 
> 
> This is much more palatable, thank you for persevering with it.
> 
> On Mon, Jun 26, 2023 at 08:18:35PM +0200, Francesco P. Lovergine wrote:
> > diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS 
> > proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS
> > --- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS2023-03-13 
> > 12:24:28.0 +0100
> > +++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS2023-06-22 
> > 11:15:57.0 +0200
> > @@ -1,3 +1,16 @@
> > +proftpd-dfsg (1.3.8+dfsg-4+deb12u1) bookworm; urgency=medium
> > +
> > +If you upgrade from 1.3.8+dfsg-4 (i.e. th 12.0 edition of bookworm) 
> > note
> 
> Tiny typo at "the". Otherwise it looks fine, please go ahead.
> 

Can I have a source-only upload please? I'll reject the upload for now, you
can reuse the same version.

Thanks,

-- 
Jonathan Wiltshire  j...@debian.org
Debian Developer http://people.debian.org/~jmw

4096R: 0xD3524C51 / 0A55 B7C5 1223 3942 86EC  74C3 5394 479D D352 4C51
ed25519/0x196418AAEB74C8A1: CA619D65A72A7BADFC96D280196418AAEB74C8A1



Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-27 Thread Jonathan Wiltshire
Control: tag -1 confirmed


This is much more palatable, thank you for persevering with it.

On Mon, Jun 26, 2023 at 08:18:35PM +0200, Francesco P. Lovergine wrote:
> diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS 
> proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS
> --- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS  2023-03-13 
> 12:24:28.0 +0100
> +++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS  2023-06-22 
> 11:15:57.0 +0200
> @@ -1,3 +1,16 @@
> +proftpd-dfsg (1.3.8+dfsg-4+deb12u1) bookworm; urgency=medium
> +
> +If you upgrade from 1.3.8+dfsg-4 (i.e. th 12.0 edition of bookworm) note

Tiny typo at "the". Otherwise it looks fine, please go ahead.

Thanks,

-- 
Jonathan Wiltshire  j...@debian.org
Debian Developer http://people.debian.org/~jmw

4096R: 0xD3524C51 / 0A55 B7C5 1223 3942 86EC  74C3 5394 479D D352 4C51
ed25519/0x196418AAEB74C8A1: CA619D65A72A7BADFC96D280196418AAEB74C8A1



Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-26 Thread Francesco P. Lovergine

On Mon, Jun 26, 2023 at 07:28:36PM +0200, Francesco P. Lovergine wrote:


Updated debdiff attached.



Sorry wrong diff, this is the correct one :-/

--
Francesco P. Lovergine
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/changelog proftpd-dfsg-1.3.8+dfsg/debian/changelog
--- proftpd-dfsg-1.3.8+dfsg/debian/changelog	2023-03-14 10:16:31.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/changelog	2023-06-22 11:15:57.0 +0200
@@ -1,3 +1,15 @@
+proftpd-dfsg (1.3.8+dfsg-4+deb12u1) bookworm; urgency=medium
+
+  * Now do not enable proftpd.socket to avoid conflicts at boot time.
+(Closes: #1038416)
+  * Introduced a new prerm script to manage stop of service/socket before
+remove.
+  * Added an entry to NEWS file to explain the change in unit files
+and how to deal with changes.
+  * Revised README.Debian to reflect changes in unit file management.
+
+ -- Francesco Paolo Lovergine   Thu, 22 Jun 2023 11:15:57 +0200
+
 proftpd-dfsg (1.3.8+dfsg-4) unstable; urgency=medium
 
   * Correct Umask entry in commented section (Closes: #1006011).
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS
--- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS	2023-03-13 12:24:28.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS	2023-06-22 11:15:57.0 +0200
@@ -1,3 +1,16 @@
+proftpd-dfsg (1.3.8+dfsg-4+deb12u1) bookworm; urgency=medium
+
+If you upgrade from 1.3.8+dfsg-4 (i.e. th 12.0 edition of bookworm) note
+that you will need to
+systemctl disable --now proftpd.socket
+systemctl enable --now proftpd.service
+after upgrade, if you run the proftpd in (default) standalone mode and you did not
+do that before. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038416
+for more information. For other information about inetd/standalone switching
+see also the relevant section in /usr/share/doc/proftpd-core/README.Debian.gz. 
+
+ -- Francesco Paolo Lovergine   Wed, 21 Jun 2023 15:21:32 +0200
+
 proftpd-dfsg (1.3.7a+dfsg-6) unstable; urgency=medium
 
 The default method of installation is the traditional standalone
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm
--- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm	1970-01-01 01:00:00.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm	2023-06-22 11:15:57.0 +0200
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ;
+then
+deb-systemd-invoke stop 'proftpd.socket' 'proftpd.service' >/dev/null || true
+fi
+
+#DEBHELPER#
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.README.Debian proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.README.Debian
--- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.README.Debian	2023-03-13 12:24:28.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.README.Debian	2023-06-22 11:15:57.0 +0200
@@ -104,8 +104,7 @@
 
 That could be done by running 
 
-	service proftpd stop
-	systemctl disable proftpd.service
+	systemctl disable --now proftpd.service
 
 then changing from 'standalone' to 'inetd' the ServerType entry in
 /etc/proftpd/proftpd.conf, and: 
@@ -131,10 +130,7 @@
 
   - or using systemd support for socket. To do that run:
 
-	systemctl stop proftpd.service
-	systemctl disable proftpd.service
-	systemctl enable proftpd.socket
-	systemctl start proftpd.socket
+	systemctl enable --now proftpd.socket
 
 ** Other information
 
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/rules proftpd-dfsg-1.3.8+dfsg/debian/rules
--- proftpd-dfsg-1.3.8+dfsg/debian/rules	2023-03-13 12:24:28.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/rules	2023-06-22 11:15:57.0 +0200
@@ -93,7 +93,7 @@
 	dh_installinit --name=$(NAME)
 
 override_dh_installsystemd:
-	dh_installsystemd -p$(PACKAGE) --name=$(NAME) $(NAME).socket
+	dh_installsystemd -p$(PACKAGE) --no-enable --no-start --name=$(NAME) $(NAME).socket
 	dh_installsystemd -p$(PACKAGE) --name=$(NAME)@ $(NAME)@.service
 	dh_installsystemd -p$(PACKAGE) --name=$(NAME) $(NAME).service
 


Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-26 Thread Francesco P. Lovergine

On Mon, Jun 26, 2023 at 10:50:05AM +0200, Francesco P. Lovergine wrote:

Ok, I did my homework again and found that the best thing to do seems removing 
the
proftpd-run.service and enabling the proftpd.service only at 
installation time. That would allow proftpd working flawlessly at 
least for new installation on bookworm and even upgrades from bullseye 
to p-u.


Unfortunately, an upgrade from -4 would not fix the situation, which 
should be fixed by the admin in any case, by simply disabling 
proftpd.socket by hand. But for annotating this thing in NEWS, I can't 
see any other details to have care.


If you (RMs) like this plan, I would submit one more debdiff with the proposed 
changes
and wait for a final approvement, if possible.



Updated debdiff attached.

--
Francesco P. Lovergine
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/changelog proftpd-dfsg-1.3.8+dfsg/debian/changelog
--- proftpd-dfsg-1.3.8+dfsg/debian/changelog	2023-03-14 10:16:31.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/changelog	2023-06-22 11:15:57.0 +0200
@@ -1,3 +1,15 @@
+proftpd-dfsg (1.3.8+dfsg-4+deb12u1) bookworm; urgency=medium
+
+  * Now do not enable proftpd.socket to avoid conflicts at boot time.
+(Closes: #1038416)
+  * Introduced a new prerm script to manage stop of service/socket before
+remove.
+  * Added an entry to NEWS file to explain the change in unit files
+and how to deal with changes.
+  * Revised README.Debian to reflect changes in unit file management.
+
+ -- Francesco Paolo Lovergine   Thu, 22 Jun 2023 11:15:57 +0200
+
 proftpd-dfsg (1.3.8+dfsg-4) unstable; urgency=medium
 
   * Correct Umask entry in commented section (Closes: #1006011).
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS
--- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS	2023-03-13 12:24:28.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS	2023-06-22 11:15:57.0 +0200
@@ -1,3 +1,16 @@
+proftpd-dfsg (1.3.8+dfsg-4+deb12u1) bookworm; urgency=medium
+
+If you upgrade from 1.3.8+dfsg-4 (i.e. th 12.0 edition of bookworm) note
+that you will need to
+systemctl disable --now proftpd.socket
+systemctl enable --now proftpd.service
+after upgrade, if you run the proftpd in (default) standalone mode and you did not
+do that before. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038416
+for more information. For other information about inetd/standalone switching
+see also the relevant section in /usr/share/doc/proftpd-core/README.Debian.gz. 
+
+ -- Francesco Paolo Lovergine   Wed, 21 Jun 2023 15:21:32 +0200
+
 proftpd-dfsg (1.3.7a+dfsg-6) unstable; urgency=medium
 
 The default method of installation is the traditional standalone
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm
--- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm	1970-01-01 01:00:00.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm	2023-06-22 11:15:57.0 +0200
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ;
+then
+deb-systemd-invoke stop 'proftpd.socket' 'proftpd.service' >/dev/null || true
+fi
+
+#DEBHELPER#
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.README.Debian proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.README.Debian
--- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.README.Debian	2023-03-13 12:24:28.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.README.Debian	2023-06-22 11:15:57.0 +0200
@@ -104,8 +104,8 @@
 
 That could be done by running 
 
-	service proftpd stop
-	systemctl disable proftpd.service
+	systemctl stop proftpd.service
+	systemctl disable proftpd-run.service (only for xinetd/inetd use)
 
 then changing from 'standalone' to 'inetd' the ServerType entry in
 /etc/proftpd/proftpd.conf, and: 
@@ -132,10 +132,10 @@
   - or using systemd support for socket. To do that run:
 
 	systemctl stop proftpd.service
-	systemctl disable proftpd.service
-	systemctl enable proftpd.socket
 	systemctl start proftpd.socket
 
+The proftpd-run.service will take care of the mode switching at boot time.
+
 ** Other information
 
 Please, read accurately the NEWS, README and changelog file in /usr/share/doc/proftpd-basic
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/rules proftpd-dfsg-1.3.8+dfsg/debian/rules
--- proftpd-dfsg-1.3.8+dfsg/debian/rules	2023-03-13 12:24:28.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/rules	2023-06-22 11:15:57.0 +0200
@@ -93,7 +93,7 @@
 	dh_installinit --name=$(NAME)
 
 override_dh_installsystemd:
-	dh_installsystemd -p$(PACKAGE) --name=$(NAME) $(NAME).socket
+	dh_installsystemd -p$(PACKAGE) --no-enable --no-start --name=$(NAME) $(NAME).socket
 	dh_installsystemd -p$(PACKAGE) --name=$(NAME)@ $(NAME)@.service
 	dh_installsystemd -p$(PACKAGE) --name=$(NAME) $(NAME).service
 


Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-26 Thread Francesco P. Lovergine

On Sun, Jun 25, 2023 at 05:27:04PM +0100, Jonathan Wiltshire wrote:

> Maybe I missed something important, but this seems a very odd way of doing
> things. Do you really set up a dummy service unit which is expected to fail
> in standalone mode, and therefore starts the socket instead?
>
> Why not use an ExecStartPre= or ExecCondition= in your normal units to
> prevent starting when in inetd mode?
>

Unfortunately, Exec* directives can only be used in .service units.


This statement is at odds with the documentation for systemd.socket(5).



I meant ExecCondition (see https://github.com/systemd/systemd/issues/14012),
but indeed there is not way to by-pass the socket opening within a
socket unit. Once enabled, the ftp socket is under systemd control, the
only way to prevent that is by using ConditionPathExists AFAIK.


That's
the reason to enable an external oneshot .service unit to start
alternatively one of the two other units. Ideally one day or another such
features could
be available also in other type of units (there is an issue open since
2019). Incidentally, it is possible to add a ConditionPathExists and a
something like /etc/proftpd/proftpd_not_to_be_run (which is the trick used
in sshd) but would be completely Debian specific and out of the usual
workflow to manage inetd/standalone modes in proftpd. So, I'm not that keen
on
this kind of trick.


I don't think a ConditionPathExists hack is necessary here. Yes, in the
standalone case you will end up with the socket unit failing, and the local
admin will have to disable that if it annoys them, but any competent
administrator should be able to figure that out with the help of
NEWS.Debian.



Ok, I did my homework again and found that the best thing to do seems removing 
the
proftpd-run.service and enabling the proftpd.service only at installation time. 
That would allow proftpd working flawlessly at least for new installation on bookworm 
and even upgrades from bullseye to p-u. 

Unfortunately, an upgrade from -4 would not fix the situation, which should 
be fixed by the admin in any case, by simply disabling proftpd.socket by hand. 
But for annotating this thing in NEWS, I can't see any other details to have care. 


If you (RMs) like this plan, I would submit one more debdiff with the proposed 
changes
and wait for a final approvement, if possible.


--
Francesco P. Lovergine



Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-25 Thread Jonathan Wiltshire
On Sun, Jun 25, 2023 at 11:06:14AM +0200, Francesco P. Lovergine wrote:
> On Sat, Jun 24, 2023 at 05:45:33PM +0100, Jonathan Wiltshire wrote:
> > > diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm 
> > > proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm
> > > --- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm 1970-01-01 
> > > 01:00:00.0 +0100
> > > +++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm 2023-06-22 
> > > 11:13:30.0 +0200
> > > @@ -0,0 +1,11 @@
> > > +#!/bin/sh
> > > +
> > > +set -e
> > > +
> > > +if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d 
> > > /run/systemd/system ] ;
> > > +then
> > > +deb-systemd-invoke stop 'proftpd.service' >/dev/null || true
> > > +deb-systemd-invoke stop 'proftpd.socket' >/dev/null || true
> > > +fi
> > 
> > This gives rise to a race condition where the socket starts the service
> > again before the socket is stopped.
> > 
> 
> Well, this is exactly what debhelper does in current prerm in bookworm.
> Eventually, it could be unified in `deb-systemd-invoke stop 'proftpd.socket'
> 'proftpd.service' || true` like other packages do.
> I'm not sure if this is what you intend, but if that risks a race condition 
> it would applies to
> a lots of other packages.

Ok, I didn't look at the debhelper behaviour. It's not a big risk.

> > > diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service 
> > > proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service
> > > --- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service   
> > > 1970-01-01 01:00:00.0 +0100
> > > +++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service   
> > > 2023-06-22 11:12:42.0 +0200
> > > @@ -0,0 +1,14 @@
> > > +[Unit]
> > > +Description=ProFTPD FTP Server in standalone/socket mode
> > > +Documentation=man:proftpd(8)
> > > +OnFailure=proftpd.socket
> > > +OnSuccess=proftpd.service
> > > +
> > > +[Service]
> > > +Type=oneshot
> > > +Environment=CONFIG_FILE=/etc/proftpd/proftpd.conf
> > > +EnvironmentFile=-/etc/default/proftpd
> > > +ExecStart=/usr/bin/grep -iqE 
> > > '^[[:space:]]*ServerType[[:space:]]+standalone$' $CONFIG_FILE
> > 
> > Maybe I missed something important, but this seems a very odd way of doing
> > things. Do you really set up a dummy service unit which is expected to fail
> > in standalone mode, and therefore starts the socket instead?
> > 
> > Why not use an ExecStartPre= or ExecCondition= in your normal units to
> > prevent starting when in inetd mode?
> > 
> 
> Unfortunately, Exec* directives can only be used in .service units.

This statement is at odds with the documentation for systemd.socket(5). 

> That's
> the reason to enable an external oneshot .service unit to start
> alternatively one of the two other units. Ideally one day or another such
> features could
> be available also in other type of units (there is an issue open since
> 2019). Incidentally, it is possible to add a ConditionPathExists and a
> something like /etc/proftpd/proftpd_not_to_be_run (which is the trick used
> in sshd) but would be completely Debian specific and out of the usual
> workflow to manage inetd/standalone modes in proftpd. So, I'm not that keen
> on
> this kind of trick.

I don't think a ConditionPathExists hack is necessary here. Yes, in the
standalone case you will end up with the socket unit failing, and the local
admin will have to disable that if it annoys them, but any competent
administrator should be able to figure that out with the help of
NEWS.Debian.


-- 
Jonathan Wiltshire  j...@debian.org
Debian Developer http://people.debian.org/~jmw

4096R: 0xD3524C51 / 0A55 B7C5 1223 3942 86EC  74C3 5394 479D D352 4C51
ed25519/0x196418AAEB74C8A1: CA619D65A72A7BADFC96D280196418AAEB74C8A1



Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-25 Thread Francesco P. Lovergine

On Sun, Jun 25, 2023 at 11:06:17AM +0200, Francesco P. Lovergine wrote:


Why not use an ExecStartPre= or ExecCondition= in your normal units to
prevent starting when in inetd mode?



Unfortunately, Exec* directives can only be used in .service units. 
That's the reason to enable an external oneshot .service unit to start 
alternatively one of the two other units. Ideally one day or another 
such features could
be available also in other type of units (there is an issue open since 
2019). Incidentally, it is possible to add a ConditionPathExists and a 
something like /etc/proftpd/proftpd_not_to_be_run (which is the trick 
used in sshd) but would be completely Debian specific and out of the 
usual workflow to manage inetd/standalone modes in proftpd. So, I'm 
not that keen on

this kind of trick.



Even, the ConditionPathExists would also imply adding code to
manage in postinst that kind of stuff, in order to update
admin's configuration in a proper way to respect the rule of least
surprise at upgrade time ...


--
Francesco P. Lovergine



Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-25 Thread Francesco P. Lovergine
First of all, thanks for the review. 


Answers are embedded below.

On Sat, Jun 24, 2023 at 05:45:33PM +0100, Jonathan Wiltshire wrote:

Control: tag -1 moreinfo

On Thu, Jun 22, 2023 at 02:29:54PM +0200, Francesco P. Lovergine wrote:

diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/changelog 
proftpd-dfsg-1.3.8+dfsg/debian/changelog
--- proftpd-dfsg-1.3.8+dfsg/debian/changelog2023-03-14 10:16:31.0 
+0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/changelog2023-06-22 11:15:57.0 
+0200
@@ -1,3 +1,15 @@
+proftpd-dfsg (1.3.8+dfsg-4+deb12u1) bookworm-proposed-updates; urgency=medium


You should target `bookworm`, not the admin suites.



Right, to be done.


diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm 
proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm
--- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm   1970-01-01 
01:00:00.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm   2023-06-22 
11:13:30.0 +0200
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ;
+then
+deb-systemd-invoke stop 'proftpd.service' >/dev/null || true
+deb-systemd-invoke stop 'proftpd.socket' >/dev/null || true
+fi


This gives rise to a race condition where the socket starts the service
again before the socket is stopped.



Well, this is exactly what debhelper does in current prerm in bookworm. 
Eventually, it could be unified in `deb-systemd-invoke stop 'proftpd.socket' 'proftpd.service' || true` 
like other packages do.

I'm not sure if this is what you intend, but if that risks a race condition it 
would applies to
a lots of other packages.


diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service 
proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service
--- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service 
1970-01-01 01:00:00.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service 
2023-06-22 11:12:42.0 +0200
@@ -0,0 +1,14 @@
+[Unit]
+Description=ProFTPD FTP Server in standalone/socket mode
+Documentation=man:proftpd(8)
+OnFailure=proftpd.socket
+OnSuccess=proftpd.service
+
+[Service]
+Type=oneshot
+Environment=CONFIG_FILE=/etc/proftpd/proftpd.conf
+EnvironmentFile=-/etc/default/proftpd
+ExecStart=/usr/bin/grep -iqE '^[[:space:]]*ServerType[[:space:]]+standalone$' 
$CONFIG_FILE


Maybe I missed something important, but this seems a very odd way of doing
things. Do you really set up a dummy service unit which is expected to fail
in standalone mode, and therefore starts the socket instead?

Why not use an ExecStartPre= or ExecCondition= in your normal units to
prevent starting when in inetd mode?



Unfortunately, Exec* directives can only be used in .service units. That's 
the reason to enable an external oneshot .service unit to start alternatively 
one of the two other units. Ideally one day or another such features could
be available also in other type of units (there is an issue open since 2019). 
Incidentally, it is possible to add a ConditionPathExists and a something 
like /etc/proftpd/proftpd_not_to_be_run (which is the trick used in sshd) 
but would be completely Debian specific and out of the usual workflow 
to manage inetd/standalone modes in proftpd. So, I'm not that keen on

this kind of trick.

--
Francesco P. Lovergine



Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-24 Thread Jonathan Wiltshire
Control: tag -1 moreinfo

On Thu, Jun 22, 2023 at 02:29:54PM +0200, Francesco P. Lovergine wrote:
> diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/changelog 
> proftpd-dfsg-1.3.8+dfsg/debian/changelog
> --- proftpd-dfsg-1.3.8+dfsg/debian/changelog  2023-03-14 10:16:31.0 
> +0100
> +++ proftpd-dfsg-1.3.8+dfsg/debian/changelog  2023-06-22 11:15:57.0 
> +0200
> @@ -1,3 +1,15 @@
> +proftpd-dfsg (1.3.8+dfsg-4+deb12u1) bookworm-proposed-updates; urgency=medium

You should target `bookworm`, not the admin suites.

> diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm 
> proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm
> --- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm 1970-01-01 
> 01:00:00.0 +0100
> +++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm 2023-06-22 
> 11:13:30.0 +0200
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +
> +set -e
> +
> +if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system 
> ] ;
> +then
> +deb-systemd-invoke stop 'proftpd.service' >/dev/null || true
> +deb-systemd-invoke stop 'proftpd.socket' >/dev/null || true
> +fi

This gives rise to a race condition where the socket starts the service
again before the socket is stopped.

> diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service 
> proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service
> --- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service   
> 1970-01-01 01:00:00.0 +0100
> +++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service   
> 2023-06-22 11:12:42.0 +0200
> @@ -0,0 +1,14 @@
> +[Unit]
> +Description=ProFTPD FTP Server in standalone/socket mode
> +Documentation=man:proftpd(8)
> +OnFailure=proftpd.socket
> +OnSuccess=proftpd.service
> +
> +[Service]
> +Type=oneshot
> +Environment=CONFIG_FILE=/etc/proftpd/proftpd.conf
> +EnvironmentFile=-/etc/default/proftpd
> +ExecStart=/usr/bin/grep -iqE 
> '^[[:space:]]*ServerType[[:space:]]+standalone$' $CONFIG_FILE

Maybe I missed something important, but this seems a very odd way of doing
things. Do you really set up a dummy service unit which is expected to fail
in standalone mode, and therefore starts the socket instead?

Why not use an ExecStartPre= or ExecCondition= in your normal units to
prevent starting when in inetd mode?


-- 
Jonathan Wiltshire  j...@debian.org
Debian Developer http://people.debian.org/~jmw

4096R: 0xD3524C51 / 0A55 B7C5 1223 3942 86EC  74C3 5394 479D D352 4C51
ed25519/0x196418AAEB74C8A1: CA619D65A72A7BADFC96D280196418AAEB74C8A1



Bug#1038879: bookworm-pu: package proftpd-dfsg/1.3.8+dfsg-4+deb12u1

2023-06-22 Thread Francesco P. Lovergine
Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian@packages.debian.org
Usertags: pu
X-Debbugs-Cc: proftpd-d...@packages.debian.org, 
pkg-proftpd-maintain...@alioth-lists.debian.net
Control: affects -1 + src:proftpd-dfsg

Hi

this is a pre-check before uploading in bookworm p-u a fixed package.

The proposed solution is described in 
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1038416#25
and implies adding and enable one more unit to pre-check the socket vs service 
units,
and install/upgrade the other units in disabled mode. That even requires
stopping the service at prerm stage.

[ Reason ]

Murphy law applies and we (ProFTPD team) found a serious flaw in bookworm
proftpd - as summarized in the report #1038416 - which prevents having a 
working service after a new install or even an upgrade in bookworm.

[ Impact ]

The default proftpd configuration requires a standalone daemon running,
but the installation of a .socket unit prevents it to run and is not
working even, because the distributed proftpd.conf (and generally the
system admin's one) renders unusable the program via systemd. This is
evident after rebooting, while the daemon is regularly
working just after installation.

At the end of the day the admin get a not working service and 
needs to manually disable the .socket and enable the .service, or
change ServerType to inetd. This is unexpected and suboptimal.

[ Tests ]

The proposed solution works on a fresh install or an upgrade.

[ Risks ]

The change is quite trivial and should not impact other parts of the system.

[ Checklist ]
  [X] *all* changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in (old)stable
  [X] the issue is verified as fixed in unstable

[ Changes ]

Adding a new service unit which runs on-exit/on-success alternatively
the original .socket/.service unit on the basis of the current
proftpd configuration after install. The prerm script now stop services
just before removing package units.
Changes include documentation of the new units management in NEWS
and README.Debian.

[Other info]


-- 
Francesco P. Lovergine
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/changelog proftpd-dfsg-1.3.8+dfsg/debian/changelog
--- proftpd-dfsg-1.3.8+dfsg/debian/changelog	2023-03-14 10:16:31.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/changelog	2023-06-22 11:15:57.0 +0200
@@ -1,3 +1,15 @@
+proftpd-dfsg (1.3.8+dfsg-4+deb12u1) bookworm-proposed-updates; urgency=medium
+
+  * Introduced a new systemd service to start the main socket/service 
+on the basis of the proftpd.conf configuration (standalone/inetd).
+(Closes: #1038416)
+  * Introduced a new prerm script to manage stop of service/socket now
+not more managed by DH scripts.
+  * Added an entry to NEWS file to explain the change in unit files.
+  * Revised README.Debian to reflect changes in unit file management.
+
+ -- Francesco Paolo Lovergine   Thu, 22 Jun 2023 11:15:57 +0200
+
 proftpd-dfsg (1.3.8+dfsg-4) unstable; urgency=medium
 
   * Correct Umask entry in commented section (Closes: #1006011).
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS
--- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS	2023-03-13 12:24:28.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.NEWS	2023-06-22 11:15:57.0 +0200
@@ -1,3 +1,15 @@
+proftpd-dfsg (1.3.8+dfsg-4+deb12u1) bookworm-proposed-updates; urgency=medium
+
+Starting from this version a new systemd unit file 'proftpd-run.service' has
+been introduced to allow switching between standalone and systemd (socket) mode.
+In order to switch mode, it is possible to change ServerType from standalone to inetd
+in /etc/proftpd/proftpd.conf and run systemctl stop proftpd.service
+systemctl start proftpd.socket
+The only unit to be maintained enabled is proftpd-run.service, and disabling
+it would ensures to stop the ftp service at boot time.
+
+ -- Francesco Paolo Lovergine   Wed, 21 Jun 2023 15:21:32 +0200
+
 proftpd-dfsg (1.3.7a+dfsg-6) unstable; urgency=medium
 
 The default method of installation is the traditional standalone
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm
--- proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm	1970-01-01 01:00:00.0 +0100
+++ proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.prerm	2023-06-22 11:13:30.0 +0200
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+set -e
+
+if [ -z "${DPKG_ROOT:-}" ] && [ "$1" = remove ] && [ -d /run/systemd/system ] ;
+then
+deb-systemd-invoke stop 'proftpd.service' >/dev/null || true
+deb-systemd-invoke stop 'proftpd.socket' >/dev/null || true
+fi
+
+#DEBHELPER#
diff -Nru proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service proftpd-dfsg-1.3.8+dfsg/debian/proftpd-core.proftpd-run.service
---