Operating System - HP-UX
1753877 Members
7613 Online
108809 Solutions
New Discussion

Compiling and running logrotate 3.7.1

 
Jeff_Traigle
Honored Contributor

Compiling and running logrotate 3.7.1

I installed the following from the HP-UX Porting and Archive site on an HP-UX 11.11 system:

gcc-4.2.3
libgcc-4.2.3
make-3.81
patch-2.5.9 (used only to apply the 3.7.1-5 diff)
popt-1.7
zlib-1.2.3
libiconv-1.13
gettext-0.17

I also have HPLX installed from the Linux to hp-ux 11.0/11i porting kit media.

The compile seemed to go fairly smoothly and generated a binary.

# gmake
gcc -E -Wall -D_GNU_SOURCE -DHP-UX -DVERSION=\"3.7.1\" -O2 -I/usr/local -M logrotate.c log.c config.c basenames.c > .depend
gcc -Wall -D_GNU_SOURCE -DHP-UX -DVERSION=\"3.7.1\" -O2 -I/usr/local -c -o logrotate.o logrotate.c
: warning: missing whitespace after the macro name
logrotate.c: In function 'mailLog':
logrotate.c:206: warning: 'uncompressChild' may be used uninitialized in this function
gcc -Wall -D_GNU_SOURCE -DHP-UX -DVERSION=\"3.7.1\" -O2 -I/usr/local -c -o log.o log.c
: warning: missing whitespace after the macro name
gcc -Wall -D_GNU_SOURCE -DHP-UX -DVERSION=\"3.7.1\" -O2 -I/usr/local -c -o config.o config.c
: warning: missing whitespace after the macro name
config.c: In function 'isolateValue':
config.c:66: warning: array subscript has type 'char'
config.c: In function 'readPath':
config.c:88: warning: array subscript has type 'char'
config.c: In function 'readAddress':
config.c:118: warning: array subscript has type 'char'
config.c: In function 'readConfigFile':
config.c:460: warning: array subscript has type 'char'
config.c:462: warning: array subscript has type 'char'
config.c:531: warning: array subscript has type 'char'
config.c:591: warning: array subscript has type 'char'
config.c:737: warning: array subscript has type 'char'
config.c:746: warning: array subscript has type 'char'
config.c:759: warning: array subscript has type 'char'
gcc -Wall -D_GNU_SOURCE -DHP-UX -DVERSION=\"3.7.1\" -O2 -I/usr/local -c -o basenames.o basenames.c
: warning: missing whitespace after the macro name
gcc logrotate.o log.o config.o basenames.o -lpopt -lhplx -L/usr/local/hplx/lib -L/usr/local -o logrotate

However, when I try to execute the command, it fails:

# /opt/logrotate/sbin/logrotate /etc/logrotate.conf
error: /etc/logrotate.conf:25 duplicate log entry for

If I try to run it without the conf file specified, it dumps core instead of displaying the proper syntax.

# /opt/logrotate/sbin/logrotate
logrotate 3.7.1 - Copyright (C) 1995-2001 Red Hat, Inc.
This may be freely redistributed under the terms of the GNU Public License

/usr/lib/dld.sl: Unresolved symbol: libintl_dgettext (code) from /usr/local/lib/libpopt.sl
Abort(coredump)

The logrotate.conf is pretty much the example that comes with the source code, with only the path of the wtmp and utmp files changed for HP-UX:

---------------------------------------------
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/adm/wtmp {
missingok
monthly
create 0664 adm adm
rotate 1
}

/var/adm/btmp {
missingok
monthly
create 0600 root other
rotate 1
}

# system-specific logs may be configured here
---------------------------------------------

It looks like it's failing to parse the conf file appropriately so doesn't know what files are configured to be rotated. Anyone else attempted this and know what the issue might be?
--
Jeff Traigle
1 REPLY 1
Steven E. Protter
Exalted Contributor

Re: Compiling and running logrotate 3.7.1

Shalom,

As the app has remained static and HP-UX has improved, more and more problems have come up.

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1283881

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=945765

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1304549

Somewhere in there may be code changes you need to make to the app to get it to work right.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com