diff --git a/ipmitool/bldipmi.pl b/ipmitool/bldipmi.pl index 55f0e02..ef160c5 100755 --- a/ipmitool/bldipmi.pl +++ b/ipmitool/bldipmi.pl @@ -93,7 +93,7 @@ if (! grep /libcrypto.so/, @output) { exit 1; } -my $objrpm = "$blddir/RPMS/$arch/ipmitool-xcat-$version-2.$arch.rpm"; +my $objrpm = "$blddir/RPMS/$arch/ipmitool-xcat-$version-3.$arch.rpm"; my $dstdir = "/tmp/build/$os/$arch"; # check the build result diff --git a/ipmitool/debian/changelog b/ipmitool/debian/changelog index 2eff127..2911dc6 100644 --- a/ipmitool/debian/changelog +++ b/ipmitool/debian/changelog @@ -1,3 +1,8 @@ +ipmitool-xcat (1.8.15-3) unstable; urgency=low + * Handle HUP and TERM signal + + -- chenglch Wed, 10 Aug 2016 11:18:00 +0100 + ipmitool-xcat (1.8.15-2) unstable; urgency=low * To close sol session after no more data get from server side diff --git a/ipmitool/debian/patches/ipmitool-1.8.15-signal.patch b/ipmitool/debian/patches/ipmitool-1.8.15-signal.patch new file mode 120000 index 0000000..5c54f51 --- /dev/null +++ b/ipmitool/debian/patches/ipmitool-1.8.15-signal.patch @@ -0,0 +1 @@ +../../ipmitool-1.8.15-signal.patch \ No newline at end of file diff --git a/ipmitool/debian/patches/ipmitool-1.8.15-solactivate.patch b/ipmitool/debian/patches/ipmitool-1.8.15-solactivate.patch new file mode 120000 index 0000000..89ea0c5 --- /dev/null +++ b/ipmitool/debian/patches/ipmitool-1.8.15-solactivate.patch @@ -0,0 +1 @@ +../../ipmitool-1.8.15-solactivate.patch \ No newline at end of file diff --git a/ipmitool/debian/patches/series b/ipmitool/debian/patches/series index 5b7dd68..5651c61 100644 --- a/ipmitool/debian/patches/series +++ b/ipmitool/debian/patches/series @@ -1,3 +1,4 @@ ipmitool-1.8.15-saneretry.patch ipmitool-1.8.15-rflash.patch ipmitool-1.8.15-solactivate.patch +ipmitool-1.8.15-signal.patch diff --git a/ipmitool/ipmitool-1.8.15-signal.patch b/ipmitool/ipmitool-1.8.15-signal.patch new file mode 100644 index 0000000..d4ce4de --- /dev/null +++ b/ipmitool/ipmitool-1.8.15-signal.patch @@ -0,0 +1,54 @@ +diff -uNr ipmitool-1.8.15/include/ipmitool/ipmi_sol.h ipmitool-1.8.15-signal/include/ipmitool/ipmi_sol.h +--- ipmitool-1.8.15/include/ipmitool/ipmi_sol.h 2014-03-28 08:36:21.000000000 -0400 ++++ ipmitool-1.8.15-signal/include/ipmitool/ipmi_sol.h 2016-08-09 22:35:14.030029120 -0400 +@@ -103,6 +103,6 @@ + int ipmi_get_sol_info(struct ipmi_intf * intf, + uint8_t channel, + struct sol_config_parameters * params); +- ++void leave_raw_mode(void); + + #endif /* IPMI_SOL_H */ +diff -uNr ipmitool-1.8.15/lib/ipmi_main.c ipmitool-1.8.15-signal/lib/ipmi_main.c +--- ipmitool-1.8.15/lib/ipmi_main.c 2014-08-11 13:37:37.000000000 -0400 ++++ ipmitool-1.8.15-signal/lib/ipmi_main.c 2016-08-10 01:13:38.350442782 -0400 +@@ -258,20 +258,22 @@ + if (cmdlist != NULL) + ipmi_cmd_print(cmdlist); + } +-/* ipmi_catch_sigint - Handle the interrupt signal (Ctrl-C), close the +- * interface, and exit ipmitool with error (-1) ++/* ipmi_catch_sig - Handle the interrupt signal (Ctrl-C),TERM signal, ++ * and HUP signal. Close the interface, and exit ++ * ipmitool with error (-1) + * +- * This insures that the IOL session gets freed +- * for other callers. ++ * This insures that the IOL session gets freed ++ * for other callers. + * + * returns -1 + */ +-void ipmi_catch_sigint() ++void ipmi_catch_sig(const int sig) + { + if (ipmi_main_intf != NULL) { +- printf("\nSIGN INT: Close Interface %s\n",ipmi_main_intf->desc); ++ printf("\nSIGN %s: Close Interface %s\n",strsignal(sig), ipmi_main_intf->desc); + ipmi_main_intf->close(ipmi_main_intf); + } ++ leave_raw_mode(); + exit(-1); + } + +@@ -391,7 +393,9 @@ + /* save program name */ + progname = strrchr(argv[0], '/'); + progname = ((progname == NULL) ? argv[0] : progname+1); +- signal(SIGINT, ipmi_catch_sigint); ++ signal(SIGINT, ipmi_catch_sig); ++ signal(SIGTERM, ipmi_catch_sig); ++ signal(SIGHUP, ipmi_catch_sig); + + while ((argflag = getopt(argc, (char **)argv, OPTION_STRING)) != -1) + { diff --git a/ipmitool/ipmitool.spec b/ipmitool/ipmitool.spec index 9013744..f938992 100644 --- a/ipmitool/ipmitool.spec +++ b/ipmitool/ipmitool.spec @@ -1,7 +1,7 @@ Name: ipmitool-xcat Summary: ipmitool - Utility for IPMI control Version: 1.8.15 -Release: 2 +Release: 3 License: BSD Group: Utilities Packager: IBM Corp. @@ -9,6 +9,7 @@ Source: ipmitool-%{version}.tar.gz Patch: ipmitool-%{version}-saneretry.patch Patch2: ipmitool-%{version}-rflash.patch Patch3: ipmitool-%{version}-solactivate.patch +Patch4: ipmitool-%{version}-signal.patch Buildroot: /var/tmp/ipmitool-root %description @@ -35,6 +36,7 @@ fi %patch -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build ./configure --with-kerneldir \