On Thu, 10 Feb 2005 22:14, Ted Mittelstaedt wrote:
> Ian Moore wrote:
> > On Wed, 9 Feb 2005 17:21, Ted Mittelstaedt wrote:
> >> I would probably install src/usr.sbin/ and recompile cron to use
> >> the -f flag.  The flags are settible in cron/config.h in the source,
> >> FreeBSD uses
> >>
> >> #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t"             /*-*/
> >>
> >> just change this to
> >>
> >> #define MAILARGS "%s -FCronDaemon [EMAIL PROTECTED] -odi -oem -oi
> >> -t" /*-*/
> >>
> >> Ted
> >
> > Thanks, I'll give that a go.
> > BTW, using C{E} instead if C{E}root plus the MASQUERADE_AS
> > macro doesn't seem
> > to work.  I didn't try the MASQUERADE_ENVELOPE macro with it though.
> > Actually, even sending mail as my own local user on the system
> > ends up with
> > the hostname added in. Perhaps I'm doing something wrong.
> > Anyway, from what you've both said, rebuilding cron sounds
> > like a better
> > solution. Once I've modified the source, do I just do a make install
> > from the /usr/src/usr.sbin/cron directory?
>
> It would be better to mv the existing cron binary to cron.backup, then
> copy the cron binary from the build directory.  No point in changing
> anything else, the binary is the only thing that changes.

Hi,
Sorry, I'm still having trouble with this - my changes don't seem to 
have had any effect, cron is still sending mail as 
[EMAIL PROTECTED] (Cron Daemon)
I think I've done something wrong!

What I did was:

#cd /usr/src/usr.sbin/cron/cron
#ee config.h:
and I changed the line
  #define MAILARGS "%s -FCronDaemon -odi -oem -oi -t"              /*-*/
  to
  #define MAILARGS "%s [EMAIL PROTECTED] -odi -oem -oi -t"  /*-*/

(I assume the # at the beginning is correct?)

then I did:
/usr/src/usr.sbin/cron/cron# cd ..
/usr/src/usr.sbin/cron# make
===> lib
Warning: Object directory not changed from original 
/usr/src/usr.sbin/cron/lib
cc -O -pipe  -I/usr/src/usr.sbin/cron/lib/../cron -DLOGIN_CAP  -c entry.c
cc -O -pipe  -I/usr/src/usr.sbin/cron/lib/../cron -DLOGIN_CAP  -c env.c
cc -O -pipe  -I/usr/src/usr.sbin/cron/lib/../cron -DLOGIN_CAP  -c misc.c
building static cron library
ranlib libcron.a
===> cron
Warning: Object directory not changed from original 
/usr/src/usr.sbin/cron/cron
cc -O -pipe  -DLOGIN_CAP  -c cron.c
cc -O -pipe  -DLOGIN_CAP  -c database.c
cc -O -pipe  -DLOGIN_CAP  -c do_command.c
cc -O -pipe  -DLOGIN_CAP  -c job.c
cc -O -pipe  -DLOGIN_CAP  -c user.c
cc -O -pipe  -DLOGIN_CAP  -c popen.c
cc -O -pipe  -DLOGIN_CAP   -o cron cron.o database.o do_command.o job.o 
user.o popen.o /usr/src/usr.sbin/cron/cron/../lib/libcron.a -lutil
gzip -cn cron.8 > cron.8.gz
===> crontab
Warning: Object directory not changed from original 
/usr/src/usr.sbin/cron/crontab
cc -O -pipe  -I/usr/src/usr.sbin/cron/crontab/../cron  -c crontab.c
cc -O -pipe  -I/usr/src/usr.sbin/cron/crontab/../cron   -o crontab 
crontab.o /usr/src/usr.sbin/cron/crontab/../lib/libcron.a -lutil
gzip -cn crontab.1 > crontab.1.gz
gzip -cn crontab.5 > crontab.5.gz

(Are the warnings are harmless?)
Then:
# /etc/rc.d/cron stop
# cp /usr/src/usr.sbin/cron/cron/cron /usr/sbin
# chmod 555 /usr/sbin/cron
# /etc/rc.d/cron start

Cheers,
-- 
Ian

GPG Key: http://home.swiftdsl.com.au/~imoore/no-spam.asc

Attachment: pgpGkcNWxl2Ag.pgp
Description: PGP signature

Reply via email to