tag 735871 patch thanks I've added a patch for this here: http://sources.progress-linux.org/gitweb/?p=releases/baureo/packages/molly-guard.git
patch is also attached. -- Address: Daniel Baumann, Donnerbuehlweg 3, CH-3012 Bern Email: daniel.baum...@progress-technologies.net Internet: http://people.progress-technologies.net/~daniel.baumann/
commit b02ffc2 Author: Daniel Baumann <daniel.baum...@progress-linux.org> Date: Sat Jan 18 06:45:18 2014 +0100 Adding support for coldreboot from kexec-tools (Closes: #735871). diff --git a/debian/control b/debian/control index de4dd41..a0c98f6 100644 --- a/debian/control +++ b/debian/control @@ -17,11 +17,12 @@ Package: molly-guard Architecture: all Pre-Depends: dpkg-lzip Depends: procps, ${misc:Depends} -Enhances: sysvinit, upstart, openssh-server +Enhances: sysvinit, upstart, openssh-server, kexec-tools Description: protects machines from accidental shutdowns/reboots The package installs a shell script that overrides the existing - shutdown/reboot/halt/poweroff commands and first runs a set of scripts, which - all have to exit successfully, before molly-guard invokes the real command. + shutdown/reboot/halt/poweroff/coldreboot commands and first runs a set of + scripts, which all have to exit successfully, before molly-guard invokes the + real command. . One of the scripts checks for existing SSH sessions. If any of the four commands are called interactively over an SSH session, the shell script diff --git a/debian/molly-guard.lintian-overrides b/debian/molly-guard.lintian-overrides index c228cb5..4786945 100644 --- a/debian/molly-guard.lintian-overrides +++ b/debian/molly-guard.lintian-overrides @@ -2,4 +2,5 @@ molly-guard binary: binary-without-manpage shutdown molly-guard binary: binary-without-manpage reboot molly-guard binary: binary-without-manpage halt molly-guard binary: binary-without-manpage poweroff +molly-guard binary: binary-without-manpage coldreboot molly-guard binary: depends-on-essential-package-without-using-version depends: sysvinit diff --git a/debian/patches/0002-kexec.patch b/debian/patches/0002-kexec.patch new file mode 100644 index 0000000..cdd7720 --- /dev/null +++ b/debian/patches/0002-kexec.patch @@ -0,0 +1,71 @@ +Author: Daniel Baumann <daniel.baum...@progress-linux.org> +Description: Adding support for coldreboot from kexec-tools (Closes: #735871). + +diff -Naurp molly-guard.orig/Makefile molly-guard/Makefile +--- molly-guard.orig/Makefile ++++ molly-guard/Makefile +@@ -34,6 +34,7 @@ install: shutdown molly-guard.8.gz + ln -s ../share/molly-guard/shutdown $(DST)/sbin/halt + ln -s ../share/molly-guard/shutdown $(DST)/sbin/reboot + ln -s ../share/molly-guard/shutdown $(DST)/sbin/shutdown ++ ln -s ../share/molly-guard/shutdown $(DST)/sbin/coldreboot + + mkdir -m755 --parent $(ETCDIR) + install -m644 -oroot -oroot rc $(ETCDIR) +diff -Naurp molly-guard.orig/molly-guard.xml molly-guard/molly-guard.xml +--- molly-guard.orig/molly-guard.xml ++++ molly-guard/molly-guard.xml +@@ -116,6 +116,18 @@ and docbook-xsl in your Build-Depends co + -- <replaceable>script_options</replaceable> + </arg> + </cmdsynopsis> ++ <cmdsynopsis> ++ <command>coldreboot</command> ++ <arg choice="opt"> ++ -<option>hV</option> ++ </arg> ++ <arg choice="opt"> ++ <option>--molly-guard-do-nothing</option> ++ </arg> ++ <arg choice="opt"> ++ -- <replaceable>script_options</replaceable> ++ </arg> ++ </cmdsynopsis> + </refsynopsisdiv> + + <refsect1> +@@ -124,8 +136,9 @@ and docbook-xsl in your Build-Depends co + <para> &dhcommand; attempts to prevent you from accidentally shutting down + or rebooting machines. It does this by injecting a couple of checks + before the existing commands: <command>halt</command>, +- <command>reboot</command>, <command>shutdown</command>, and +- <command>poweroff</command>. This happens via scripts with the same ++ <command>reboot</command>, <command>shutdown</command>, ++ <command>poweroff</command>, and <command>coldreboot</command>. ++ This happens via scripts with the same + names in <filename>/usr/sbin</filename>, so it only works if you have + <filename>/usr/sbin</filename> before <filename>/sbin</filename> in your + <envar>PATH</envar>!</para> +@@ -256,6 +269,10 @@ and docbook-xsl in your Build-Depends co + <refentrytitle>poweroff</refentrytitle> + <manvolnum>8</manvolnum> + </citerefentry>. ++ <citerefentry> ++ <refentrytitle>coldreboot</refentrytitle> ++ <manvolnum>8</manvolnum> ++ </citerefentry>. + </para> + </refsect1> + +diff -Naurp molly-guard.orig/shutdown.in molly-guard/shutdown.in +--- molly-guard.orig/shutdown.in ++++ molly-guard/shutdown.in +@@ -16,7 +16,7 @@ CMD="${0##*/}" + EXEC="/sbin/$CMD" + + case "$CMD" in +- halt|reboot|shutdown|poweroff) ++ halt|reboot|shutdown|poweroff|coldreboot) + if [ ! -f $EXEC ]; then + echo "E: not a regular file: $EXEC" >&2 + exit 4 diff --git a/debian/patches/series b/debian/patches/series index 8a15a7f..589aac9 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ 0001-fqdn.patch +0002-kexec.patch