From b0d0853d370fe33ff30787323ae938391e9eb63b Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 02 2019 21:18:50 +0000 Subject: import rhnsd-5.0.13-10.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7d15b0d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/rhnsd-5.0.13.tar.gz diff --git a/.rhnsd.metadata b/.rhnsd.metadata new file mode 100644 index 0000000..bf4759c --- /dev/null +++ b/.rhnsd.metadata @@ -0,0 +1 @@ +a98fdea2bd5817073a3023e590e704bb62cac487 SOURCES/rhnsd-5.0.13.tar.gz diff --git a/SOURCES/rhnsd-5.0.13-1-to-rhnsd-5.0.13-2-el7.patch b/SOURCES/rhnsd-5.0.13-1-to-rhnsd-5.0.13-2-el7.patch new file mode 100644 index 0000000..750606f --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-1-to-rhnsd-5.0.13-2-el7.patch @@ -0,0 +1,87 @@ +diff --git a/Makefile.rhnsd b/Makefile.rhnsd +index 080f907..4d51b8e 100644 +--- a/Makefile.rhnsd ++++ b/Makefile.rhnsd +@@ -46,7 +46,7 @@ install:: all $(DIRS) + $(INSTALL_DATA) $(RHNSD).sysconfig $(CONFIG_DIR)/$(RHNSD) + + $(RHNSD): $(RHNSD).o +- $(CC) -o $@ $< ++ $(CC) $(CFLAGS) -o $@ $< + %.o : %.c + $(CC) -DVERSION=\"$(VERSION)\" -fPIC $(CFLAGS) -c -o $@ $< + +diff --git a/rhnsd.init b/rhnsd.init +index ac5fe89..ee3e811 100644 +--- a/rhnsd.init ++++ b/rhnsd.init +@@ -37,15 +37,6 @@ RHNSD=/usr/sbin/rhnsd + + # Sanity checks. + [ -x $RHNSD ] || exit 6 +-RHN_UP2DATE_FILE="/etc/sysconfig/rhn/up2date" +-[ -f $RHN_UP2DATE_FILE ] || exit 6 +-if [ -r $RHN_UP2DATE_FILE ]; then +- RHN_SYSTEMID_FILE=`awk -F '=[[:space:]]*' '/^[[:space:]]*systemIdPath[[:space:]]*=/ {print $2}' $RHN_UP2DATE_FILE` +- [ -f $RHN_SYSTEMID_FILE ] || exit 6 +-elif [ "$1" != "status" ]; then +- echo "Insufficient privilege. Cannot open file $RHN_UP2DATE_FILE for reading." +- exit 4 +-fi + + # Source function library. + . /etc/rc.d/init.d/functions +diff --git a/rhnsd.init.SUSE b/rhnsd.init.SUSE +index d310523..d96e764 100644 +--- a/rhnsd.init.SUSE ++++ b/rhnsd.init.SUSE +@@ -38,15 +38,6 @@ RHNSD_PIDFILE=/var/run/rhnsd.pid + + # Sanity checks. + [ -x $RHNSD ] || exit 6 +-RHN_UP2DATE_FILE="/etc/sysconfig/rhn/up2date" +-[ -f $RHN_UP2DATE_FILE ] || exit 6 +-if [ -r $RHN_UP2DATE_FILE ]; then +- RHN_SYSTEMID_FILE=`awk -F '=[[:space:]]*' '/^[[:space:]]*systemIdPath[[:space:]]*=/ {print $2}' $RHN_UP2DATE_FILE` +- [ -f $RHN_SYSTEMID_FILE ] || exit 6 +-elif [ "$1" != "status" ]; then +- echo "Insufficient privilege. Cannot open file $RHN_UP2DATE_FILE for reading." +- exit 4 +-fi + + # Source function library. + . /etc/rc.status +diff --git a/rhnsd.spec b/rhnsd.spec +index f39abb6..89bde9d 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: 1%{?dist} ++Release: 2%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -46,7 +46,7 @@ your machine, and runs any actions. + %setup -q + + %build +-make -f Makefile.rhnsd %{?_smp_mflags} CFLAGS="%{optflags}" ++make -f Makefile.rhnsd %{?_smp_mflags} CFLAGS="-pie -fPIE -Wl,-z,relro,-z,now %{optflags}" + + %install + rm -rf $RPM_BUILD_ROOT +@@ -138,6 +138,11 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog ++* 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) ++- Resolves: #1092518 - PIE+RELRO for rhnsd (mkollar@redhat.com) ++ + * Mon Jun 17 2013 Michael Mraka 5.0.13-1 + - removed old CVS/SVN version ids + 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-4-el7-to-rhnsd-5.0.13-5-el7.patch b/SOURCES/rhnsd-5.0.13-4-el7-to-rhnsd-5.0.13-5-el7.patch new file mode 100644 index 0000000..6d9c75f --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-4-el7-to-rhnsd-5.0.13-5-el7.patch @@ -0,0 +1,35 @@ +diff --git a/rhnsd.spec b/rhnsd.spec +index e925d39..ee6085f 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: 4%{?dist} ++Release: 5%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -138,10 +138,18 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog +-* Thu Jun 25 2015 Grant Gainey 5.0.13-4 ++* Thu Jun 25 2015 Grant Gainey 5.0.13-5 + - Bump release to get past weirdness in brew-tags (ggainey@redhat.com) +- +-* Wed Jun 24 2015 Grant Gainey 5.0.13-2 ++- Related: #1138939 - up2date and systemid files are managed by rhnsd itself, ++ no need to break init script if they do not exist (jdobes@redhat.com) ++- Related: #1092518 - PIE+RELRO for rhnsd (mkollar@redhat.com) ++- Revert changes in order to clean up tagging issues with brew ++ (ggainey@redhat.com) ++- Automatic commit of package [rhnsd] minor release [5.0.13-4-el7]. ++ (ggainey@redhat.com) ++- Bump release to get past weirdness in brew-tags (ggainey@redhat.com) ++- Automatic commit of package [rhnsd] minor release [5.0.13-2-el7]. ++ (ggainey@redhat.com) + - 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) + - Resolves: #1092518 - PIE+RELRO for rhnsd (mkollar@redhat.com) 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/SOURCES/rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-8-el7.patch b/SOURCES/rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-8-el7.patch new file mode 100644 index 0000000..054fe84 --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-8-el7.patch @@ -0,0 +1,75 @@ +diff --git a/rhnsd.c b/rhnsd.c +index ad2100d..896b433 100644 +--- a/rhnsd.c ++++ b/rhnsd.c +@@ -176,7 +176,6 @@ int main (int argc, char **argv) + + if (setsid() < 0) + exit(EXIT_FAILURE); +- umask(0); + + chdir ("/"); + +@@ -310,8 +309,12 @@ static int write_pid (const char *file) + FILE *fp; + + fp = fopen (file, "w"); +- if (fp == NULL) +- return -1; ++ if (fp == NULL) { ++ return -1; ++ } else if (chmod (file, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) != 0) { ++ fclose(fp); ++ return -1; ++ } + + fprintf (fp, "%d\n", getpid ()); + if (fflush (fp) || ferror (fp)) { +@@ -397,6 +400,10 @@ static int rhn_do_action(void) + + /* close the read end of the pipe */ + close(fds[0]); ++ ++ /* close syslog file descriptor */ ++ closelog(); ++ + /* redirect stdout */ + if (fds[1] != STDOUT_FILENO) { + dup2(fds[1], STDOUT_FILENO); +@@ -406,6 +413,9 @@ static int rhn_do_action(void) + /* make sure this child has a stderr */ + dup2(STDOUT_FILENO, STDERR_FILENO); + ++ /* open a new syslog connection for the child */ ++ openlog("rhnsd", LOG_CONS | LOG_ODELAY | LOG_PID, LOG_DAEMON); ++ + /* syslog for safekeeping */ + syslog(LOG_NOTICE, "running program %s with PID %d", RHN_CHECK, getpid()); + +diff --git a/rhnsd.spec b/rhnsd.spec +index 333a555..42ad138 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: 7%{?dist} ++Release: 8%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -138,6 +138,13 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog ++* Wed Sep 20 2017 Tomas Kasparek 5.0.13-8 ++- Resolves: #1480306 - change permissions for rhnsd.pid (grinrag@gmail.com) ++- Resolves: #1489989 - umask(0) does not reset to default umask ++ (tkasparek@redhat.com) ++- Resolves: #1475039 - close and reopen syslog when redirecting child output ++ (martin.matuska@axelspringer.de) ++ + * Mon Mar 06 2017 Gennadii Altukhov 5.0.13-7 + - Resolves: #1409562 - fix BZ IDs in spec file (galt@redhat.com) + diff --git a/SOURCES/rhnsd-5.0.13-8-el7-to-rhnsd-5.0.13-9-el7.patch b/SOURCES/rhnsd-5.0.13-8-el7-to-rhnsd-5.0.13-9-el7.patch new file mode 100644 index 0000000..7cc729d --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-8-el7-to-rhnsd-5.0.13-9-el7.patch @@ -0,0 +1,131 @@ +diff --git a/rhnsd.c b/rhnsd.c +index 896b433..6190c0a 100644 +--- a/rhnsd.c ++++ b/rhnsd.c +@@ -49,9 +49,6 @@ 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[] = + { +@@ -148,34 +145,16 @@ int main (int argc, char **argv) + if (!foreground) { + int i; + +- pid_t pid; +- pid = fork(); +- if (pid < 0) +- exit (EXIT_FAILURE); +- +- if (pid > 0) +- exit(EXIT_SUCCESS); +- ++ if (fork ()) ++ exit (0); + + for (i = 0; i < getdtablesize(); i++) + close (i); + +- /* 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); ++ if (fork ()) ++ exit (0); + +- if (setsid() < 0) +- exit(EXIT_FAILURE); ++ setsid(); + + chdir ("/"); + +@@ -273,13 +252,11 @@ 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. */ +@@ -417,11 +394,10 @@ static int rhn_do_action(void) + openlog("rhnsd", LOG_CONS | LOG_ODELAY | LOG_PID, LOG_DAEMON); + + /* syslog for safekeeping */ +- syslog(LOG_NOTICE, "running program %s with PID %d", RHN_CHECK, getpid()); ++ syslog(LOG_DEBUG, "running program %s", RHN_CHECK); + + unset_signal_handlers (); + /* exec binary helper */ +- rhn_check_pid = getpid(); + args[0] = RHN_CHECK; + execv(RHN_CHECK, args); + +@@ -431,7 +407,6 @@ 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 dead8bf..ee3e811 100644 +--- a/rhnsd.init ++++ b/rhnsd.init +@@ -53,7 +53,7 @@ start() { + + stop() { + echo -n $"Stopping Spacewalk Daemon: " +- killproc rhnsd -TERM ++ killproc rhnsd + RETVAL=$? + echo + if [ $RETVAL -eq 0 ]; then +diff --git a/rhnsd.spec b/rhnsd.spec +index 42ad138..2a192f6 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: 8%{?dist} ++Release: 9%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -138,6 +138,12 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog ++* Mon Oct 09 2017 Tomas Kasparek 5.0.13-9 ++- Related: #1499793 - revert previous reboot loop changes ++ (tkasparek@redhat.com) ++- Resolves: #1499793 - Revert "1260527 RHEL7 rhnsd reload doesn't work" ++ (tkasparek@redhat.com) ++ + * Wed Sep 20 2017 Tomas Kasparek 5.0.13-8 + - Resolves: #1480306 - change permissions for rhnsd.pid (grinrag@gmail.com) + - Resolves: #1489989 - umask(0) does not reset to default umask diff --git a/SOURCES/rhnsd-5.0.13-9-el7-to-rhnsd-5.0.13-10-el7.patch b/SOURCES/rhnsd-5.0.13-9-el7-to-rhnsd-5.0.13-10-el7.patch new file mode 100644 index 0000000..d2ac8a5 --- /dev/null +++ b/SOURCES/rhnsd-5.0.13-9-el7-to-rhnsd-5.0.13-10-el7.patch @@ -0,0 +1,30 @@ +diff --git a/rhnsd.spec b/rhnsd.spec +index 2a192f6..8f2e5ae 100644 +--- a/rhnsd.spec ++++ b/rhnsd.spec +@@ -1,11 +1,11 @@ + Summary: Spacewalk query daemon + License: GPLv2 + Group: System Environment/Base +-Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz +-URL: https://fedorahosted.org/spacewalk ++Source0: https://github.com/spacewalkproject/spacewalk/archive/%{name}-%{version}.tar.gz ++URL: https://github.com/spacewalkproject/spacewalk + Name: rhnsd + Version: 5.0.13 +-Release: 9%{?dist} ++Release: 10%{?dist} + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + + BuildRequires: gettext +@@ -138,6 +138,10 @@ rm -fr $RPM_BUILD_ROOT + %doc LICENSE + + %changelog ++* Thu Oct 19 2017 Tomas Kasparek 5.0.13-10 ++- Resolves: #1503955 - upstream project has migrated to github ++ (tkasparek@redhat.com) ++ + * Mon Oct 09 2017 Tomas Kasparek 5.0.13-9 + - Related: #1499793 - revert previous reboot loop changes + (tkasparek@redhat.com) diff --git a/SPECS/rhnsd.spec b/SPECS/rhnsd.spec new file mode 100644 index 0000000..12c9a60 --- /dev/null +++ b/SPECS/rhnsd.spec @@ -0,0 +1,287 @@ +Summary: Spacewalk query daemon +License: GPLv2 +Group: System Environment/Base +Source0: https://github.com/spacewalkproject/spacewalk/archive/%{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-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 +Patch5: rhnsd-5.0.13-7-el7-to-rhnsd-5.0.13-8-el7.patch +Patch6: rhnsd-5.0.13-8-el7-to-rhnsd-5.0.13-9-el7.patch +Patch7: rhnsd-5.0.13-9-el7-to-rhnsd-5.0.13-10-el7.patch +URL: https://github.com/spacewalkproject/spacewalk +Name: rhnsd +Version: 5.0.13 +Release: 10%{?dist} +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildRequires: gettext + +Requires: rhn-check >= 0.0.8 +%if 0%{?suse_version} >= 1210 +BuildRequires: systemd +%{?systemd_requires} +%endif +%if 0%{?suse_version} +Requires(post): aaa_base +Requires(preun): aaa_base +BuildRequires: sysconfig +%else +%if 0%{?fedora} +Requires(post): chkconfig +Requires(preun): chkconfig +Requires(post): systemd-sysv +Requires(preun): systemd-sysv +Requires(post): systemd-units +Requires(preun): systemd-units +BuildRequires: systemd-units +%else +Requires(post): chkconfig +Requires(preun): chkconfig +# This is for /sbin/service +Requires(preun): initscripts +Requires(postun): initscripts +%endif +%endif + +%description +The Red Hat Update Agent that automatically queries the Red Hat +Network servers and determines which packages need to be updated on +your machine, and runs any actions. + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 + +%build +make -f Makefile.rhnsd %{?_smp_mflags} CFLAGS="-pie -fPIE -Wl,-z,relro,-z,now %{optflags}" + +%install +rm -rf $RPM_BUILD_ROOT +make -f Makefile.rhnsd install VERSION=%{version}-%{release} PREFIX=$RPM_BUILD_ROOT MANPATH=%{_mandir} INIT_DIR=$RPM_BUILD_ROOT/%{_initrddir} + +%if 0%{?suse_version} && 0%{?suse_version} < 1210 +install -m 0755 rhnsd.init.SUSE $RPM_BUILD_ROOT/%{_initrddir}/rhnsd +%endif +%if 0%{?fedora} || 0%{?suse_version} >= 1210 +rm $RPM_BUILD_ROOT/%{_initrddir}/rhnsd +mkdir -p $RPM_BUILD_ROOT/%{_unitdir} +install -m 0644 rhnsd.service $RPM_BUILD_ROOT/%{_unitdir}/ +%endif + +%find_lang %{name} + +%{!?systemd_post: %global systemd_post() if [ $1 -eq 1 ] ; then /usr/bin/systemctl enable %%{?*} >/dev/null 2>&1 || : ; fi; } +%{!?systemd_preun: %global systemd_preun() if [ $1 -eq 0 ] ; then /usr/bin/systemctl --no-reload disable %%{?*} > /dev/null 2>&1 || : ; /usr/bin/systemctl stop %%{?*} > /dev/null 2>&1 || : ; fi; } +%{!?systemd_postun_with_restart: %global systemd_postun_with_restart() /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : ; if [ $1 -ge 1 ] ; then /usr/bin/systemctl try-restart %%{?*} >/dev/null 2>&1 || : ; fi; } + + +%if 0%{?suse_version} >= 1210 +%pre +%service_add_pre rhnsd.service +%endif + +%post +%if 0%{?suse_version} >= 1210 +%service_add_post rhnsd.service +%else +if [ -f /etc/init.d/rhnsd ]; then + /sbin/chkconfig --add rhnsd +fi +if [ -f %{_unitdir}/rhnsd.service ]; then + %systemd_post rhnsd.service + if [ "$1" = "2" ]; then + # upgrade from old init.d + if [ -L /etc/rc2.d/S97rhnsd ]; then + /usr/bin/systemctl enable rhnsd.service >/dev/null 2>&1 + fi + rm -f /etc/rc?.d/[SK]??rhnsd + fi +fi +%endif + +%preun +%if 0%{?suse_version} >= 1210 +%service_del_preun rhnsd.service +%else +if [ $1 = 0 ] ; then + %if 0%{?fedora} + %systemd_preun rhnsd.service + %else + service rhnsd stop >/dev/null 2>&1 + %endif + if [ -f /etc/init.d/rhnsd ]; then + /sbin/chkconfig --del rhnsd + fi +fi +%endif + +%postun +%if 0%{?suse_version} >= 1210 +%service_del_postun rhnsd.service +%else +if [ "$1" -ge "1" ]; then + %if 0%{?fedora} + %systemd_postun_with_restart rhnsd.service + %else + service rhnsd condrestart >/dev/null 2>&1 || : + %endif +fi +%endif + +%clean +rm -fr $RPM_BUILD_ROOT + + +%files -f %{name}.lang +%dir %{_sysconfdir}/sysconfig/rhn +%config(noreplace) %{_sysconfdir}/sysconfig/rhn/rhnsd +%{_sbindir}/rhnsd +%if 0%{?fedora} || 0%{?suse_version} >= 1210 +%{_unitdir}/rhnsd.service +%else +%{_initrddir}/rhnsd +%endif +%{_mandir}/man8/rhnsd.8* +%doc LICENSE + +%changelog +* Thu Oct 19 2017 Tomas Kasparek 5.0.13-10 +- Resolves: #1503955 - upstream project has migrated to github + (tkasparek@redhat.com) + +* Mon Oct 09 2017 Tomas Kasparek 5.0.13-9 +- Related: #1499793 - revert previous reboot loop changes + (tkasparek@redhat.com) +- Resolves: #1499793 - Revert "1260527 RHEL7 rhnsd reload doesn't work" + (tkasparek@redhat.com) + +* Wed Sep 20 2017 Tomas Kasparek 5.0.13-8 +- Resolves: #1480306 - change permissions for rhnsd.pid (grinrag@gmail.com) +- Resolves: #1489989 - umask(0) does not reset to default umask + (tkasparek@redhat.com) +- Resolves: #1475039 - close and reopen syslog when redirecting child output + (martin.matuska@axelspringer.de) + +* 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, + no need to break init script if they do not exist (jdobes@redhat.com) +- Related: #1092518 - PIE+RELRO for rhnsd (mkollar@redhat.com) +- Revert changes in order to clean up tagging issues with brew + (ggainey@redhat.com) +- Automatic commit of package [rhnsd] minor release [5.0.13-4-el7]. + (ggainey@redhat.com) +- Bump release to get past weirdness in brew-tags (ggainey@redhat.com) +- Automatic commit of package [rhnsd] minor release [5.0.13-2-el7]. + (ggainey@redhat.com) +- 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) +- Resolves: #1092518 - PIE+RELRO for rhnsd (mkollar@redhat.com) + +* Mon Jun 17 2013 Michael Mraka 5.0.13-1 +- removed old CVS/SVN version ids + +* Mon Jun 17 2013 Tomas Kasparek 5.0.12-1 +- rebranding few more strings in client stuff + +* Tue May 21 2013 Tomas Kasparek 5.0.11-1 +- branding clean-up of rhel client stuff + +* Thu Apr 25 2013 Michael Mraka 5.0.10-1 +- let rhnsd.service be enabled after installation +- Purging %%changelog entries preceding Spacewalk 1.0, in active packages. + +* Fri Feb 15 2013 Milan Zazrivec 5.0.9-1 +- Update .po and .pot files for rhnsd. +- New translations from Transifex for rhnsd. +- Download translations from Transifex for rhnsd. + +* Fri Nov 30 2012 Jan Pazdziora 5.0.8-1 +- Revert "876328 - updating rhel client tools translations" + +* Mon Nov 19 2012 Jan Pazdziora 5.0.7-1 +- Only run chkconfig if we are in the SysV world. +- rhnsd needs to be marked as forking. +- When talking to systemctl, we need to say .service. + +* Fri Nov 16 2012 Jan Pazdziora 5.0.6-1 +- 876328 - updating rhel client tools translations + +* Sun Nov 11 2012 Michael Calmer 5.0.5-1 +- use systemd on openSUSE >= 12.1 +- do not start rhnsd in runlevel 2 which has no network +- no use of /var/lock/subsys/ anymore + +* Tue Oct 30 2012 Jan Pazdziora 5.0.4-1 +- Update .po and .pot files for rhnsd. +- New translations from Transifex for rhnsd. +- Download translations from Transifex for rhnsd. + +* Mon Jul 30 2012 Michael Mraka 5.0.3-1 +- there's no elsif macro + +* Wed Jul 25 2012 Michael Mraka 5.0.2-1 +- make sure _unitdir is defined + +* Wed Jul 25 2012 Michael Mraka 5.0.1-1 +- implement rhnsd.service for systemd + +* Tue Feb 28 2012 Jan Pazdziora 4.9.15-1 +- Update .po and .pot files for rhnsd. +- Download translations from Transifex for rhnsd. + +* Wed Dec 21 2011 Milan Zazrivec 4.9.14-1 +- updated translations + +* Fri Jul 29 2011 Tomas Lestach 4.9.13-1 +- 679054 - fix random interval part (tlestach@redhat.com) + +* Tue Jul 19 2011 Jan Pazdziora 4.9.12-1 +- Merging Transifex changes for rhnsd. +- New translations from Transifex for rhnsd. +- Download translations from Transifex for rhnsd. + +* Tue Jul 19 2011 Jan Pazdziora 4.9.11-1 +- update .po and .pot files for rhnsd + +* Fri Apr 15 2011 Jan Pazdziora 4.9.10-1 +- changes to build rhnsd on SUSE (mc@suse.de) + +* Fri Feb 18 2011 Jan Pazdziora 4.9.9-1 +- l10n: Updates to Estonian (et) translation (mareklaane@fedoraproject.org) + +* Thu Jan 20 2011 Tomas Lestach 4.9.8-1 +- updating Copyright years for year 2011 (tlestach@redhat.com) +- update .po and .pot files for rhnsd (tlestach@redhat.com) + +* Tue Nov 02 2010 Jan Pazdziora 4.9.7-1 +- Update copyright years in the rest of the repo. +- update .po and .pot files for rhnsd + +* Thu Aug 12 2010 Milan Zazrivec 4.9.6-1 +- update .po and .pot files for rhnsd (msuchy@redhat.com) + +* Thu Jul 01 2010 Miroslav Suchý 4.9.4-1 +- l10n: Updates to Czech (cs) translation (msuchy@fedoraproject.org) +- cleanup - removing translation file, which does not match any language code + (msuchy@redhat.com) +- update po files for rhnsd (msuchy@redhat.com) +- generate new pot file for rhnsd (msuchy@redhat.com) +- l10n: Updates to Polish (pl) translation (raven@fedoraproject.org) +