reopen 356067 tags + patch severity 356067 minor retitle 356067 Can't disable startup of daemon and startup fails when package is removed stop
Hi, On Thu, May 18, 2006, Philipp Meier wrote: > Not fixing for now. The majority of use cases for jetty will be the use > as standalone servlet engine and webserver. I considered a package-split > some time ago but I decided the effort would not be worth it. If you're "not fixing for now", then don't tag it wontfix, tag it help. A package split isn't required, I propose a NO_START flag, or whatever you prefer as a name for the flag. Please consider the attached patch which also fixes the following bug when the package is removed and not purged: bee# /etc/init.d/jetty start Starting Jetty servlet engine: mesg: /dev/pts/0: Operation not permitted -su: /usr/lib/j2sdk1.4-sun/bin/java -Xmx256m -Djava.awt.headless=true -Djava.io.tmpdir="/var/cache/jetty" -Djava.library.path=/usr/lib -DSTART=/etc/jetty/start.config -Djetty.home=/usr/share/jetty -jar /usr/share/jetty/lib/start.jar /etc/jetty/jetty.xml >> /var/log/jetty/out.log 2>&1 & echo $!: No such file or directory > With update-rc.d the startup of jetty can be controled like any other > daemon. And still, on my system: /etc/default/apache2: NO_START=1 /etc/default/bittorrent: START_BTTRACK=0 /etc/default/bluetooth: HIDD_ENABLED=0, DUND_ENABLED=0, PAND_ENABLED=0 /etc/default/bootlogd: BOOTLOGD_ENABLE=No /etc/default/dbus: ENABLED=1 /etc/default/distcc: STARTDISTCC="false" /etc/default/fetchmail: START_DAEMON=no /etc/default/hddtemp: RUN_DAEMON="false" /etc/default/irda-utils: ENABLE="true" ... (and this is only for options that I could read in the default file, when there the package ships a default file...) It's really convenient, please consider it. Cheers, -- Loïc Minier <[EMAIL PROTECTED]> "You can gtk_main_run, but you can't gtk_widget_hide." --danw, 19-jul-04
--- jetty-5.1.5rc1/debian/changelog +++ jetty-5.1.5rc1/debian/changelog @@ -1,3 +1,11 @@ +jetty (5.1.5rc1-6.1) unstable; urgency=low + + * Fix init script to permit removal without purge and offer a new NO_START + option in /etc/default/jetty. (Closes: #356067) + [debian/jetty.init] + + -- Loic Minier <[EMAIL PROTECTED]> Thu, 18 May 2006 13:48:31 +0200 + jetty (5.1.5rc1-6) unstable; urgency=low * Fix location of jasper since upgrade to tomcat5. Closes: #333010. --- jetty-5.1.5rc1/debian/jetty.init +++ jetty-5.1.5rc1/debian/jetty.init @@ -8,9 +8,14 @@ NAME=jetty DESC="Jetty servlet engine" JETTY_HOME=/usr/share/$NAME +START_JAR="$JETTY_HOME/lib/start.jar" + # The following variables can be overwritten in /etc/default/jetty +# Whether to start jetty (as a daemon) or not +NO_START=0 + # Run Jetty as this user ID (default: jetty) # Set this to an empty string to prevent Jetty from starting automatically JETTY_USER=jetty @@ -43,6 +48,20 @@ . /etc/default/jetty fi +# Check whether jetty is still installed (it might not be if this package was +# removed and not purged) +if [ -r "$START_JAR" ]; then + HAVE_JETTY=1 +else + exit 0 +fi + +# Check whether startup has been disabled +if [ "$NO_START" != "0" -a "$1" != "stop" ]; then + [ "$VERBOSE" != "no" ] && echo "Not starting jetty - edit /etc/default/jetty and change NO_START to be 0 (or comment it out)."; + exit 0; +fi + if [ -z "$JETTY_USER" ]; then echo "Not starting/stopping $DESC as configured (JETTY_USER is" echo "empty in /etc/default/jetty)." @@ -85,7 +104,7 @@ fi -ARGUMENTS="$JAVA_OPTIONS -DSTART=$START_CONFIG -Djetty.home=$JETTY_HOME -jar /usr/share/jetty/lib/start.jar /etc/jetty/jetty.xml" +ARGUMENTS="$JAVA_OPTIONS -DSTART=$START_CONFIG -Djetty.home=$JETTY_HOME -jar $START_JAR /etc/jetty/jetty.xml" ################################################## # Do the action