diff --git a/SOURCES/rhnsd-5.0.13-2-el7-to-rhnsd-5.0.13-3-el7.patch b/SOURCES/rhnsd-5.0.13-2-el7-to-rhnsd-5.0.13-3-el7.patch deleted file mode 100644 index 9940eb4..0000000 --- a/SOURCES/rhnsd-5.0.13-2-el7-to-rhnsd-5.0.13-3-el7.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/rhnsd.spec b/rhnsd.spec -index 89bde9d..9a3cf87 100644 ---- a/rhnsd.spec -+++ b/rhnsd.spec -@@ -5,7 +5,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar. - URL: https://fedorahosted.org/spacewalk - Name: rhnsd - Version: 5.0.13 --Release: 2%{?dist} -+Release: 3%{?dist} - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - - BuildRequires: gettext -@@ -138,6 +138,9 @@ rm -fr $RPM_BUILD_ROOT - %doc LICENSE - - %changelog -+* Wed Jun 24 2015 Grant Gainey 5.0.13-3 -+- -+ - * Wed Jun 24 2015 Grant Gainey 5.0.13-2 - - Resolves: #1138939 - up2date and systemid files are managed by rhnsd itself, - no need to break init script if they do not exist (jdobes@redhat.com) diff --git a/SOURCES/rhnsd-5.0.13-2-el7-to-rhnsd-5.0.13-4-el7.patch b/SOURCES/rhnsd-5.0.13-2-el7-to-rhnsd-5.0.13-4-el7.patch new file mode 100644 index 0000000..8e745e9 --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-2-el7-to-rhnsd-5.0.13-4-el7.patch @@ -0,0 +1,23 @@ +diff --git a/rhnsd.spec b/rhnsd.spec +index 89bde9d..e925d39 100644 +--- a/rhnsd.spec ++++ b/rhnsd.spec +@@ -5,7 +5,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar. + URL: https://fedorahosted.org/spacewalk + Name: rhnsd + Version: 5.0.13 +-Release: 2%{?dist} ++Release: 4%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -138,6 +138,9 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog ++* Thu Jun 25 2015 Grant Gainey 5.0.13-4 ++- Bump release to get past weirdness in brew-tags (ggainey@redhat.com) ++ + * Wed Jun 24 2015 Grant Gainey 5.0.13-2 + - Resolves: #1138939 - up2date and systemid files are managed by rhnsd itself, + no need to break init script if they do not exist (jdobes@redhat.com) diff --git a/SOURCES/rhnsd-5.0.13-3-el7-to-rhnsd-5.0.13-4-el7.patch b/SOURCES/rhnsd-5.0.13-3-el7-to-rhnsd-5.0.13-4-el7.patch deleted file mode 100644 index cde83c3..0000000 --- a/SOURCES/rhnsd-5.0.13-3-el7-to-rhnsd-5.0.13-4-el7.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/rhnsd.spec b/rhnsd.spec -index 9a3cf87..e925d39 100644 ---- a/rhnsd.spec -+++ b/rhnsd.spec -@@ -5,7 +5,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar. - URL: https://fedorahosted.org/spacewalk - Name: rhnsd - Version: 5.0.13 --Release: 3%{?dist} -+Release: 4%{?dist} - BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - - BuildRequires: gettext -@@ -138,8 +138,8 @@ rm -fr $RPM_BUILD_ROOT - %doc LICENSE - - %changelog --* Wed Jun 24 2015 Grant Gainey 5.0.13-3 --- -+* Thu Jun 25 2015 Grant Gainey 5.0.13-4 -+- Bump release to get past weirdness in brew-tags (ggainey@redhat.com) - - * Wed Jun 24 2015 Grant Gainey 5.0.13-2 - - Resolves: #1138939 - up2date and systemid files are managed by rhnsd itself, diff --git a/SOURCES/rhnsd-5.0.13-5-el7-to-rhnsd-5.0.13-6-el7.patch b/SOURCES/rhnsd-5.0.13-5-el7-to-rhnsd-5.0.13-6-el7.patch new file mode 100644 index 0000000..c2feec1 --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-5-el7-to-rhnsd-5.0.13-6-el7.patch @@ -0,0 +1,130 @@ +diff --git a/rhnsd.c b/rhnsd.c +index 5f0711d..ad2100d 100644 +--- a/rhnsd.c ++++ b/rhnsd.c +@@ -49,6 +49,9 @@ static int write_pid (const char *file); + static void print_version (FILE *stream, struct argp_state *state); + void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version; + ++/* Current rhn_check pid */ ++pid_t rhn_check_pid; ++ + /* Definitions of arguments for argp functions. */ + static const struct argp_option options[] = + { +@@ -145,16 +148,35 @@ int main (int argc, char **argv) + if (!foreground) { + int i; + +- if (fork ()) +- exit (0); ++ pid_t pid; ++ pid = fork(); ++ if (pid < 0) ++ exit (EXIT_FAILURE); ++ ++ if (pid > 0) ++ exit(EXIT_SUCCESS); ++ + + for (i = 0; i < getdtablesize(); i++) + close (i); + +- if (fork ()) +- exit (0); ++ /* read from /dev/null */ ++ int devnull = open("/dev/null", O_RDONLY); ++ if ((devnull >= 0) && (devnull != STDIN_FILENO)) { ++ dup2(devnull, STDIN_FILENO); ++ close(devnull); ++ } ++ ++ pid = fork(); ++ if (pid < 0) ++ exit (EXIT_FAILURE); ++ ++ if (pid > 0) ++ exit(EXIT_SUCCESS); + +- setsid(); ++ if (setsid() < 0) ++ exit(EXIT_FAILURE); ++ umask(0); + + chdir ("/"); + +@@ -252,11 +274,13 @@ Written by %s.\n\ + static void termination_handler (int signum) + { + syslog(LOG_NOTICE, "Exiting"); +- ++ /* Send SIGTERM to current running rhn_check ++ * and wait for it to exit. */ ++ kill(rhn_check_pid, SIGTERM); ++ wait(NULL); + /* Clean up pid file. */ + unlink (_PATH_RHNDPID); +- +- exit (EXIT_SUCCESS); ++ exit(EXIT_SUCCESS); + } + + /* Returns 1 if the process in pid file FILE is running, 0 if not. */ +@@ -383,10 +407,11 @@ static int rhn_do_action(void) + dup2(STDOUT_FILENO, STDERR_FILENO); + + /* syslog for safekeeping */ +- syslog(LOG_DEBUG, "running program %s", RHN_CHECK); ++ syslog(LOG_NOTICE, "running program %s with PID %d", RHN_CHECK, getpid()); + + unset_signal_handlers (); + /* exec binary helper */ ++ rhn_check_pid = getpid(); + args[0] = RHN_CHECK; + execv(RHN_CHECK, args); + +@@ -396,6 +421,7 @@ static int rhn_do_action(void) + strerror(errno)); + exit(errno); + } else if (child > 0) { ++ set_signal_handlers(); + int ret = 1; + char *buf, buffer[10]; + int bufsize = 0; +diff --git a/rhnsd.init b/rhnsd.init +index ee3e811..dead8bf 100644 +--- a/rhnsd.init ++++ b/rhnsd.init +@@ -53,7 +53,7 @@ start() { + + stop() { + echo -n $"Stopping Spacewalk Daemon: " +- killproc rhnsd ++ killproc rhnsd -TERM + RETVAL=$? + echo + if [ $RETVAL -eq 0 ]; then +diff --git a/rhnsd.spec b/rhnsd.spec +index ee6085f..f893a8d 100644 +--- a/rhnsd.spec ++++ b/rhnsd.spec +@@ -5,7 +5,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar. + URL: https://fedorahosted.org/spacewalk + Name: rhnsd + Version: 5.0.13 +-Release: 5%{?dist} ++Release: 6%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -138,6 +138,10 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog ++* Mon Mar 06 2017 Gennadii Altukhov 5.0.13-6 ++- 1260527 RHEL7 rhnsd reload doesn't work (jdostal@redhat.com) ++- 1260527,1409570 - Reboot loop - rhn_check, rhnsd (jdostal@redhat.com) ++ + * Thu Jun 25 2015 Grant Gainey 5.0.13-5 + - Bump release to get past weirdness in brew-tags (ggainey@redhat.com) + - Related: #1138939 - up2date and systemid files are managed by rhnsd itself, diff --git a/SOURCES/rhnsd-5.0.13-6-el7-to-rhnsd-5.0.13-7-el7.patch b/SOURCES/rhnsd-5.0.13-6-el7-to-rhnsd-5.0.13-7-el7.patch new file mode 100644 index 0000000..9642a45 --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-6-el7-to-rhnsd-5.0.13-7-el7.patch @@ -0,0 +1,28 @@ +diff --git a/rhnsd.spec b/rhnsd.spec +index f893a8d..333a555 100644 +--- a/rhnsd.spec ++++ b/rhnsd.spec +@@ -5,7 +5,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar. + URL: https://fedorahosted.org/spacewalk + Name: rhnsd + Version: 5.0.13 +-Release: 6%{?dist} ++Release: 7%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -138,9 +138,12 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog ++* Mon Mar 06 2017 Gennadii Altukhov 5.0.13-7 ++- Resolves: #1409562 - fix BZ IDs in spec file (galt@redhat.com) ++ + * Mon Mar 06 2017 Gennadii Altukhov 5.0.13-6 +-- 1260527 RHEL7 rhnsd reload doesn't work (jdostal@redhat.com) +-- 1260527,1409570 - Reboot loop - rhn_check, rhnsd (jdostal@redhat.com) ++- 1409562 - RHEL7 rhnsd reload doesn't work (jdostal@redhat.com) ++- 1409562 - Reboot loop - rhn_check, rhnsd (jdostal@redhat.com) + + * Thu Jun 25 2015 Grant Gainey 5.0.13-5 + - Bump release to get past weirdness in brew-tags (ggainey@redhat.com) diff --git a/SPECS/rhnsd.spec b/SPECS/rhnsd.spec index a635f2f..ead6c78 100644 --- a/SPECS/rhnsd.spec +++ b/SPECS/rhnsd.spec @@ -3,13 +3,14 @@ License: GPLv2 Group: System Environment/Base Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz Patch0: rhnsd-5.0.13-1-to-rhnsd-5.0.13-2-el7.patch -Patch1: rhnsd-5.0.13-2-el7-to-rhnsd-5.0.13-3-el7.patch -Patch2: rhnsd-5.0.13-3-el7-to-rhnsd-5.0.13-4-el7.patch -Patch3: rhnsd-5.0.13-4-el7-to-rhnsd-5.0.13-5-el7.patch +Patch1: rhnsd-5.0.13-2-el7-to-rhnsd-5.0.13-4-el7.patch +Patch2: rhnsd-5.0.13-4-el7-to-rhnsd-5.0.13-5-el7.patch +Patch3: rhnsd-5.0.13-5-el7-to-rhnsd-5.0.13-6-el7.patch +Patch4: rhnsd-5.0.13-6-el7-to-rhnsd-5.0.13-7-el7.patch URL: https://fedorahosted.org/spacewalk Name: rhnsd Version: 5.0.13 -Release: 5%{?dist} +Release: 7%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gettext @@ -52,6 +53,7 @@ your machine, and runs any actions. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %build make -f Makefile.rhnsd %{?_smp_mflags} CFLAGS="-pie -fPIE -Wl,-z,relro,-z,now %{optflags}" @@ -146,6 +148,13 @@ rm -fr $RPM_BUILD_ROOT %doc LICENSE %changelog +* Mon Mar 06 2017 Gennadii Altukhov 5.0.13-7 +- Resolves: #1409562 - fix BZ IDs in spec file (galt@redhat.com) + +* Mon Mar 06 2017 Gennadii Altukhov 5.0.13-6 +- 1409562 - RHEL7 rhnsd reload doesn't work (jdostal@redhat.com) +- 1409562 - Reboot loop - rhn_check, rhnsd (jdostal@redhat.com) + * Thu Jun 25 2015 Grant Gainey 5.0.13-5 - Bump release to get past weirdness in brew-tags (ggainey@redhat.com) - Related: #1138939 - up2date and systemid files are managed by rhnsd itself,