Your message dated Thu, 06 Aug 2020 16:12:34 +0000
with message-id <e1k3ivo-000hos...@fasolo.debian.org>
and subject line Bug#966206: Removed package(s) from unstable
has caused the Debian Bug report #651004,
regarding metainit: Move common shell script code to 
/lib/init/std-sysvinitscript? 
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
651004: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=651004
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: metainit
Version: 0.0.5
Severity: wishlist

Hi.  Thanks to your blog post, I just had a closer look at metainit, and
it occured to me that it would be cleaner if the generated init.d
scripts sourced a common file for the common code.  Here is a draft
patch implementing this, while also fixing a bug in the handling of the
post-stop hook.

The generated script still lack reload and status support.  I guess both
should be added eventually.

diff -Nru metainit-0.0.5/debian/metainit.install 
metainit-0.0.5+nmu1/debian/metainit.install
--- metainit-0.0.5/debian/metainit.install      2007-06-16 17:01:58.000000000 
+0200
+++ metainit-0.0.5+nmu1/debian/metainit.install 2011-12-05 00:18:26.000000000 
+0100
@@ -2,4 +2,5 @@
 translators    /usr/share/metainit/
 update-metainit        /usr/sbin
 lib/*          /usr/share/perl5
+std-sysvinitscript /lib/init
 
diff -Nru metainit-0.0.5/std-sysvinitscript 
metainit-0.0.5+nmu1/std-sysvinitscript
--- metainit-0.0.5/std-sysvinitscript   1970-01-01 01:00:00.000000000 +0100
+++ metainit-0.0.5+nmu1/std-sysvinitscript      2011-12-05 00:12:23.000000000 
+0100
@@ -0,0 +1,76 @@
+# Exit if the package is not installed
+[ -x "$DAEMON" ] || exit 5
+
+# Load the VERBOSE setting and other rcS variables
+. /lib/init/vars.sh
+
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
+#
+# Function that starts the daemon/service
+#
+do_start()
+{
+       prestart_hook
+       start-stop-daemon --start --oknodo --background --quiet --make-pidfile 
--pidfile $PIDFILE --exec $DAEMON -- \
+               $DAEMON_ARGS || return 1
+}
+
+#
+# Function that stops the daemon/service
+#
+do_stop()
+{
+       start-stop-daemon --stop --oknodo --quiet --retry=TERM/30/KILL/5 
--pidfile $PIDFILE --name $BASENAME
+       RETVAL="$?"
+
+       rm -f $PIDFILE
+
+       poststop_hook
+       return "$RETVAL"
+}
+
+#
+# Function that sends a SIGHUP to the daemon/service
+#
+do_reload() {
+       start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name 
$NAME
+       return 0
+}
+
+case "$1" in
+  start)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
+       do_start
+    log_end_msg $?
+       ;;
+  stop)
+       [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
+       do_stop
+    log_end_msg $?
+       ;;
+  restart|force-reload)
+       #
+       # If the "reload" option is implemented then remove the
+       # 'force-reload' alias
+       #
+       log_daemon_msg "Restarting $DESC" "$NAME"
+       do_stop
+       case "$?" in
+         0)
+               do_start
+        log_end_msg "$?"
+               ;;
+         *)
+               # Failed to stop
+               log_end_msg 1
+               ;;
+       esac
+       ;;
+  *)
+       echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
+       exit 3
+       ;;
+esac
diff -Nru metainit-0.0.5/utils/create-sysvinit-file 
metainit-0.0.5+nmu1/utils/create-sysvinit-file
--- metainit-0.0.5/utils/create-sysvinit-file   2007-06-21 21:20:45.000000000 
+0200
+++ metainit-0.0.5+nmu1/utils/create-sysvinit-file      2011-12-05 
00:16:14.000000000 +0100
@@ -72,112 +72,26 @@
 EOF
 ;
 
-# ... and the rest of the initscript, that is identical for all
-# metainit-created scripts.
-print << 'EOF'
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 5
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
-. /lib/lsb/init-functions
-
-#
-# Function that starts the daemon/service
-#
-do_start()
-{
-EOF
-;
-
 if($initparams{"Prestart-Hook"}) {
+    print "prestart_hook() {\n";
     print "\t" . join("\n\t",split("\n",$initparams{"Prestart-Hook"}));
-    print "\n";
-}
-
-print << 'EOF'
-       start-stop-daemon --start --oknodo --background --quiet --make-pidfile 
--pidfile $PIDFILE --exec $DAEMON -- \
-               $DAEMON_ARGS || return 1
+    print "}\n";
+} else {
+    print "prestart_hook() { }\n";
 }
 
-#
-# Function that stops the daemon/service
-#
-do_stop()
-{
-       start-stop-daemon --stop --oknodo --quiet --retry=TERM/30/KILL/5 
--pidfile $PIDFILE --name $BASENAME
-       RETVAL="$?"
-
-       rm -f $PIDFILE
-
-       return $RETVAL
-EOF
-;
-
 if($initparams{"Poststop-Hook"}) {
+    print "poststop_hook() {\n";
     print "\t" . join("\n\t",split("\n",$initparams{"Poststop-Hook"}));
-    print "\n";
-}
-
-print << 'EOF';
-       return "$RETVAL"
-}
-
-#
-# Function that sends a SIGHUP to the daemon/service
-#
-do_reload() {
-       start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name 
$NAME
-       return 0
+    print "}\n";
+} else {
+    print "poststop_hook() { }\n";
 }
 
-case "$1" in
-  start)
-       [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
-       do_start
-    log_end_msg $?
-       ;;
-  stop)
-       [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
-       do_stop
-    log_end_msg $?
-       ;;
-  #reload|force-reload)
-       #
-       # If do_reload() is not implemented then leave this commented out
-       # and leave 'force-reload' as an alias for 'restart'.
-       #
-       #log_daemon_msg "Reloading $DESC" "$NAME"
-       #do_reload
-       #log_end_msg $?
-       #;;
-  restart|force-reload)
-       #
-       # If the "reload" option is implemented then remove the
-       # 'force-reload' alias
-       #
-       log_daemon_msg "Restarting $DESC" "$NAME"
-       do_stop
-       case "$?" in
-         0)
-               do_start
-        log_end_msg "$?"
-               ;;
-         *)
-               # Failed to stop
-               log_end_msg 1
-               ;;
-       esac
-       ;;
-  *)
-       #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
-       echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
-       exit 3
-       ;;
-esac
+print << 'EOF'
+# ... and the rest of the initscript, that is identical for all
+# metainit-created scripts.
+. /lib/init/std-sysvinitscript
 EOF
 
 if ($output) {
-- 
Happy hacking
Petter Reinholdtsen



--- End Message ---
--- Begin Message ---
Version: 0.0.5+rm

Dear submitter,

as the package metainit has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/966206

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmas...@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Sean Whitton (the ftpmaster behind the curtain)

--- End Message ---

Reply via email to