Bug#1034833: sysv init script missing in tomcat10 package

2023-04-26 Thread Thorsten Glaser
On Wed, 26 Apr 2023, Emmanuel Bourg wrote:

> willing to cooperate to ensure the sysvinit integration remains possible

You could start by mergng the (tomcat9) sysvinit branch, then
separating the init script into orphan-init-scripts and removing
the |adduser alternative but keeping the remaining patches to
both tomcat’s packaging and the init script.

As of currently, that branch basically is the way to do it right.

bye,
//mirabilos
-- 
Infrastrukturexperte • tarent solutions GmbH
Am Dickobskreuz 10, D-53121 Bonn • http://www.tarent.de/
Telephon +49 228 54881-393 • Fax: +49 228 54881-235
HRB AG Bonn 5168 • USt-ID (VAT): DE122264941
Geschäftsführer: Dr. Stefan Barth, Kai Ebenrett, Boris Esser, Alexander Steeg


/⁀\ The UTF-8 Ribbon
╲ ╱ Campaign against  Mit dem tarent-Newsletter nichts mehr verpassen:
 ╳  HTML eMail! Also, https://www.tarent.de/newsletter
╱ ╲ header encryption!




Bug#1034833: sysv init script missing in tomcat10 package

2023-04-26 Thread Emmanuel Bourg

Hi Mark,

I still think relying on orphan-sysvinit-scripts is the best option as 
it

clearly separates the responsibilities and the maintenance burden. I'm
willing to cooperate to ensure the sysvinit integration remains possible
(as was done with the dependency on systemd-sysusers instead of 
systemd),
but I can't see a compelling reason to integrate the script in the 
tomcat

package.

Emmanuel Bourg



Bug#1034833: sysv init script missing in tomcat10 package

2023-04-26 Thread Mark Hindley
Control: affects -1 tomcat10

Emmanuel,

Thanks for this.

On Wed, Apr 26, 2023 at 08:54:14AM +0200, Emmanuel Bourg wrote:
> Thank you for offering your help. The sysvinit script for Tomcat
> is now maintained in the orphan-sysvinit-scripts source package.

Whilst this is the current situation for tomcat9 (although not without some
outstanding issues[1]), I would like to encourage you to reconsider this for
tomcat10.

Maintaining initscripts in their parent package remains the best
option. Notwithstanding Matthew's considerable efforts, putting them in
orphan-sysvinit-scripts has a number of difficulties that are outlined in the
orphan-sysvinit-scripts source README[2].

Including the supplied script with Andreas' offer of ongoing testing and support
within tomcat10 would

 - provide the smoothest experience users of all init systems
 - be of no detriment to users of the default init system
 - place no additional burden on you as maintainer

Thanks again for your further consideration.

Mark


[1]  https://bugs.debian.org/925473

[2]  
https://salsa.debian.org/matthew/orphan-sysvinit-scripts/-/blob/master/README.org



Bug#1034833: sysv init script missing in tomcat10 package

2023-04-26 Thread Emmanuel Bourg

There is a script for tomcat9 but not for tomcat10 yet.



Bug#1034833: sysv init script missing in tomcat10 package

2023-04-26 Thread Emmanuel Bourg

Control: reassign -1 orphan-sysvinit-scripts

Le 2023-04-25 19:35, Andreas Messer a écrit :


Dear maintainers, the tomcat10 package does not ship a sysvinit
script for use with traditional init. Please consider adding such
a script to the package since it will make things simpler for
users of sysvinit. I have attached a possible implementation of
such a script to this mail. (Derived from tomcat9 package with
some cleanup) I can offer to support/maintain this script
in future if desired.


Hi Andreas,

Thank you for offering your help. The sysvinit script for Tomcat
is now maintained in the orphan-sysvinit-scripts source package.
There is

Emmanuel Bourg



Bug#1034833: sysv init script missing in tomcat10 package

2023-04-25 Thread Andreas Messer
Package: tomcat10
Version: 10.1.6-1

Dear maintainers, the tomcat10 package does not ship a sysvinit 
script for use with traditional init. Please consider adding such
a script to the package since it will make things simpler for
users of sysvinit. I have attached a possible implementation of
such a script to this mail. (Derived from tomcat9 package with
some cleanup) I can offer to support/maintain this script
in future if desired.

Best regards,
Andreas Messer
-- 
gnuPG keyid: 8C2BAF51
fingerprint: 28EE 8438 E688 D992 3661 C753 90B3 BAAA 8C2B AF51
#!/bin/sh
### BEGIN INIT INFO
# Provides:  tomcat10
# Required-Start:$local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop:  0 1 6
# Short-Description: Tomcat 10
# Description:   The Tomcat 10 servlet engine runs Java Web Archives.
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC='Tomcat 10 servlet engine'
NAME=tomcat10
readonly DESC NAME

# exit cleanly if disabled or not installed
test -x /usr/libexec/tomcat10/tomcat-update-policy.sh || exit 0
test -x /usr/libexec/tomcat10/tomcat-start.sh || exit 0
test -x /usr/libexec/tomcat10/tomcat-locate-java.sh || exit 0

. /lib/init/vars.sh

test -t 0 && VERBOSE=yes

# set defaults for options
CATALINA_HOME=/usr/share/tomcat10
CATALINA_BASE=/var/lib/tomcat10
CATALINA_TMPDIR=/tmp/tomcat10-tmp
export CATALINA_HOME CATALINA_BASE CATALINA_TMPDIR

JAVA_OPTS=-Djava.awt.headless=true
JSP_COMPILER= # only used if nonempty
SECURITY_MANAGER=false
UMASK=022
export JAVA_HOME JAVA_OPTS JSP_COMPILER SECURITY_MANAGER UMASK

[ -r /etc/default/tomcat10 ] && . /etc/default/tomcat10

. /lib/lsb/init-functions

# somewhat LSB-compliant exit with failure
if test x"$1" = x"status"; then
exit_failure_msg() {
log_failure_msg "$@"
exit 4
}
else
exit_failure_msg() {
log_failure_msg "$@"
exit 1
}
fi


# figure out the JRE executable catalina.sh will use
# (we need it for start-stop-daemon --exec for reliability)

[ x"${JAVA_HOME}" = x ] && \
  JAVA_HOME=$(su tomcat -s /bin/sh -c ". 
/usr/libexec/tomcat10/tomcat-locate-java.sh; echo \${JAVA_HOME}")

[ x"${JAVA_HOME}" != x ] || exit_failure_msg "could not determine JRE"

JAVA="${JAVA_HOME}/bin/java"

[ -x "${JAVA}" ] ||  exit_failure_msg "could not find java executable ${JAVA}"


# prepare for actions
case $1 in
(start|stop|restart|force-reload)
# handled below
;;
(try-restart|status)
start-stop-daemon --status --quiet \
--pidfile /var/run/tomcat10.pid \
--exec "$JAVA" --user tomcat
rv=$?
# clean up stale pidfile if necessary
(test x"$rv" = x"1" && rm -f /var/run/tomcat10.pid || :)
# process status result
case $1 in
(try-restart)
test x"$rv" = x"0" || {
# service is not running, or status is unknown
log_success_msg "$NAME is not running"
exit 0
}
# service running, restart it
;;
(status)
case $rv in
(0)
log_success_msg "$NAME is running"
;;
(4)
log_failure_msg "could not access PID file for $NAME"
;;
(*)
log_failure_msg "$NAME is not running"
;;
esac
exit $rv
;;
esac
;;
(reload|*)
# not supported
echo >&2 "Usage: $0 
{start|stop|restart|try-restart|force-reload|status}"
exit 3
;;
esac

# handle stopping/starting
rv=0

case $1 in
(stop|restart|try-restart|force-reload)
test x"$VERBOSE" = x"no" || log_daemon_msg "Stopping $DESC" "$NAME"
start-stop-daemon --stop --quiet \
--retry=10 --oknodo --remove-pidfile \
--pidfile /var/run/tomcat10.pid \
--exec "$JAVA" --user tomcat
rv=$?
test x"$VERBOSE" = x"no" || log_end_msg $rv
;;
esac

test x"$rv" = x"0" || exit $rv

case $1 in
(start|restart|try-restart|force-reload)
# ensure the temporary directory exist and change to it
rm -rf "$CATALINA_TMPDIR"
mkdir "$CATALINA_TMPDIR" || \
  exit_failure_msg 'could not create JVM temporary directory'
chown -h tomcat "$CATALINA_TMPDIR"
cd "$CATALINA_TMPDIR"

# create log directory if not exists
[ -d /var/log/tomcat10 ] || mkdir -p /var/log/tomcat10

/usr/libexec/tomcat10/tomcat-update-policy.sh || \
exit_failure_msg 'could not regenerating catalina.policy file'
rm -f /var/run/tomcat10.pid
test x"$VERBOSE" = x"no" || log_daemon_msg "Starting $DESC" "$NAME"
start-stop-daemon --start --quiet \
--chuid