FreeBSD Bugzilla – Attachment 223000 Details for
Bug 253567
sysutils/anacron: does not start after resume
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
All patches combined
patches-combined.diff (text/plain), 6.20 KB, created by
Derik van Zuetphen
on 2021-03-05 12:12:28 UTC
(
hide
)
Description:
All patches combined
Filename:
MIME Type:
Creator:
Derik van Zuetphen
Created:
2021-03-05 12:12:28 UTC
Size:
6.20 KB
patch
obsolete
>diff --git a/Makefile b/Makefile >index 64ec761..93c3afc 100644 >--- a/Makefile >+++ b/Makefile >@@ -3,7 +3,7 @@ > > PORTNAME= anacron > PORTVERSION= 2.3 >-PORTREVISION= 6 >+PORTREVISION= 7 > CATEGORIES= sysutils > MASTER_SITES= SF > >@@ -14,20 +14,22 @@ LICENSE= GPLv2+ > LICENSE_FILE= ${WRKSRC}/COPYING > > USES= gmake >-USE_RC_SUBR= anacron >+USE_RC_SUBR= ${PORTNAME} > SUB_FILES= pkg-message >+PLIST_SUB= PORTNAME=${PORTNAME} >+SUB_LIST+= PORTNAME=${PORTNAME} COMMENT="${COMMENT}" > > post-patch: >-.for f in Makefile anacron.8 anacrontab.5 >- @${REINPLACE_CMD} -e 's|\(/etc/anacrontab\)|${PREFIX}\1|' ${WRKSRC}/${f} >+.for f in Makefile ${PORTNAME}.8 ${PORTNAME}tab.5 >+ @${REINPLACE_CMD} -e 's|\(/etc/${PORTNAME}tab\)|${PREFIX}\1|' ${WRKSRC}/${f} > .endfor > @${REINPLACE_CMD} -e 's|^CFLAGS = .*||' ${WRKSRC}/Makefile > > do-install: >- ${INSTALL_PROGRAM} ${WRKSRC}/anacron ${STAGEDIR}${PREFIX}/sbin >- ${INSTALL_MAN} ${WRKSRC}/anacron.8 ${STAGEDIR}${MAN8PREFIX}/man/man8 >- ${INSTALL_MAN} ${WRKSRC}/anacrontab.5 ${STAGEDIR}${MAN5PREFIX}/man/man5 >- ${INSTALL_DATA} ${FILESDIR}/anacrontab.sample ${STAGEDIR}${PREFIX}/etc >- @${MKDIR} ${STAGEDIR}/var/spool/anacron >+ ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/sbin >+ ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${STAGEDIR}${MAN8PREFIX}/man/man8 >+ ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}tab.5 ${STAGEDIR}${MAN5PREFIX}/man/man5 >+ ${INSTALL_DATA} ${FILESDIR}/${PORTNAME}tab.sample ${STAGEDIR}${PREFIX}/etc >+ @${MKDIR} ${STAGEDIR}/var/spool/${PORTNAME} > > .include <bsd.port.mk> >diff --git a/files/anacron.in b/files/anacron.in >index e963fce..a62e1ed 100644 >--- a/files/anacron.in >+++ b/files/anacron.in >@@ -1,24 +1,39 @@ > #!/bin/sh > # >-# $FreeBSD: head/sysutils/anacron/files/anacron.in 361519 2014-07-11 09:52:59Z madpilot $ >+# $FreeBSD$ > # > >-# PROVIDE: anacron >+# PROVIDE: %%PORTNAME%% > # REQUIRE: LOGIN >+# KEYWORD: resume > > # >-# Add the following line to /etc/rc.conf to enable anacron: >+# Execute one of the following commands as root to enable %%PORTNAME%%: > # >-# anacron_enable="YES" >+# service %%PORTNAME%% enable >+# sysrc %%PORTNAME%%_enable=YES > # > > . /etc/rc.subr > >-name=anacron >-rcvar=anacron_enable >+name=%%PORTNAME%% >+command="%%PREFIX%%/sbin/%%PORTNAME%%" >+desc="%%COMMENT%%" >+extra_commands=resume >+rcvar=%%PORTNAME%%_enable >+required_vars=syslogd_enable > > load_rc_config $name >-: ${anacron_enable:=NO} >-command="%%PREFIX%%/sbin/anacron" >+: ${%%PORTNAME%%_enable:=NO} > >-run_rc_command "$1" >+if [ $# -gt 0 -a $1 = "resume" ]; then >+ arg=start >+ if checkyesno $rcvar; then >+ info "starting ${name} after resume" >+ fi >+else >+ arg=$1 >+fi >+debug "$name: \$1 = $1, arg = $arg" >+ >+run_rc_command "$arg" >diff --git a/files/patch-log.c b/files/patch-log.c >new file mode 100644 >index 0000000..320a83d >--- /dev/null >+++ b/files/patch-log.c >@@ -0,0 +1,10 @@ >+--- log.c.orig 2000-06-22 22:55:13 UTC >++++ log.c >+@@ -37,6 +37,7 @@ >+ #include <unistd.h> >+ #include <syslog.h> >+ #include <stdio.h> >++#include <stdlib.h> >+ #include <stdarg.h> >+ #include <errno.h> >+ #include <signal.h> >diff --git a/files/patch-main.c b/files/patch-main.c >new file mode 100644 >index 0000000..12dafca >--- /dev/null >+++ b/files/patch-main.c >@@ -0,0 +1,10 @@ >+--- main.c.orig 2000-06-22 22:58:07 UTC >++++ main.c >+@@ -24,6 +24,7 @@ >+ >+ #include <time.h> >+ #include <stdio.h> >++#include <stdlib.h> >+ #include <unistd.h> >+ #include <signal.h> >+ #include <fcntl.h> >diff --git a/files/patch-matchrx.c b/files/patch-matchrx.c >index a8a5d45..ffba9b6 100644 >--- a/files/patch-matchrx.c >+++ b/files/patch-matchrx.c >@@ -1,6 +1,6 @@ > --- matchrx.c.orig 2000-06-20 23:12:18 UTC > +++ matchrx.c >-@@ -23,6 +23,7 @@ >+@@ -23,9 +23,11 @@ > > > #include <stdio.h> >@@ -8,3 +8,7 @@ > #include <regex.h> > #include <stdarg.h> > #include <stdlib.h> >++#include <string.h> >+ #include "matchrx.h" >+ >+ int >diff --git a/files/patch-runjob.c b/files/patch-runjob.c >index a984d32..781ea16 100644 >--- a/files/patch-runjob.c >+++ b/files/patch-runjob.c >@@ -9,8 +9,6 @@ > - int fd, i; > + int fd; > + char name[] = "/tmp/anacron.XXXXXX"; >-+ >-+ fd = mkstemp(name); > > - i = 0; > - name = NULL; >@@ -25,6 +23,8 @@ > - /* I'm not sure we actually need to be so persistent here */ > - } while (fd == -1 && errno == EEXIST && i < max_retries); > - >++ fd = mkstemp(name); >++ > if (fd == -1) die_e("Can't open temporary file"); > if (unlink(name)) die_e("Can't unlink temporary file"); > - free(name); >@@ -32,3 +32,12 @@ > fcntl(fd, F_SETFD, 1); /* set close-on-exec flag */ > return fd; > } >+@@ -84,7 +72,7 @@ username() >+ } >+ >+ static void >+-xputenv(const char *s) >++xputenv(char *s) >+ { >+ if (putenv(s)) die_e("Can't set the environment"); >+ } >diff --git a/files/pkg-message.in b/files/pkg-message.in >index 77c5d61..64d2be3 100644 >--- a/files/pkg-message.in >+++ b/files/pkg-message.in >@@ -2,12 +2,17 @@ > { type: install > message: <<EOM > Configuration hints: >-- Edit %%PREFIX%%/etc/anacrontab >+- Edit %%PREFIX%%/etc/%%PORTNAME%%tab > - Deactivate the 'periodic' commands in /etc/crontab >-- Add a call to anacron to /etc/crontab, like >- 0 0 * * * root %%PREFIX%%/sbin/anacron >-- Add anacron_enable="YES" to /etc/rc.conf >-- Read anacron(8) and anacrontab(5) >+- Add a call to %%PORTNAME%% to /etc/crontab, like >+ 0 0 * * * root %%PREFIX%%/sbin/%%PORTNAME%% >+- Add %%PORTNAME%%_enable="YES" to /etc/rc.conf >+ or execute one of the following commands as root: >+ service %%PORTNAME%% enable >+ sysrc %%PORTNAME%%_enable=YES >+- Read %%PORTNAME%%(8) and %%PORTNAME%%tab(5) >+- To avoid overlapping periodic(8) jobs, you may want to serialize jobs: >+ sysrc %%PORTNAME%%_flags+=" -s" > EOM > } > ] >diff --git a/pkg-plist b/pkg-plist >index 7b449b2..d289dfd 100644 >--- a/pkg-plist >+++ b/pkg-plist >@@ -1,5 +1,6 @@ >-sbin/anacron >-@sample etc/anacrontab.sample >-@unexec rmdir /var/spool/anacron 2>/dev/null || echo "If you are permanently removing this port, you should do a 'rm -rf /var/spool/anacron'." >-man/man8/anacron.8.gz >-man/man5/anacrontab.5.gz >+sbin/%%PORTNAME%% >+@sample etc/%%PORTNAME%%tab.sample >+@postexec mkdir -p /var/spool/%%PORTNAME%% 2>/dev/null >+@postunexec rmdir /var/spool/%%PORTNAME%% 2>/dev/null || echo "If you are permanently removing this port, you should do a 'rm -rf /var/spool/%%PORTNAME%%'." >+man/man8/%%PORTNAME%%.8.gz >+man/man5/%%PORTNAME%%tab.5.gz
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 253567
:
222499
|
222500
|
222501
|
222554
| 223000