How To
Contact Us
SourceForge Resources

Installing Logrotate on Solaris 9

Before Installing

Installing GNU gettext

GNU gettext is needed by the popt library for proper installation. If you are having trouble installing, use the --disable-nls option when you configure, and it will work properly with the popt library for use with logrotate.

[prompt]$ ./configure
[prompt]$ gmake
[prompt]$ su
[prompt]# gmake install

Installing popt library

The popt library is neccesary for installing logrotate correctly on Solaris 9.

[prompt]$ gunzip vf popt-1.6.2.tar.gz
[prompt]$ tar xvf popt-1.6.2.tar
[prompt]$ cd popt-1.6.2

  • At this point, make sure that in the file configure, the line pointing to xgettext is pointing to the right location of xgettext on your computer.

    /usr/local/bin/xgettext --version 2>&1 | grep 'GNU gettext' >/dev/null 2>&1 || { echo "configure: error:
    *** GNU gettext is required. The latest version
    *** is always available from" 1>&2; exit 1; }

[prompt]$ ./configure
[prompt]$ gmake
[prompt]$ su
[prompt]# gmake install
[prompt]# exit

Installing logrotate

Once gettext and popt are properly installed on your system, you are ready to begin the installation of logrotate.

[prompt]$ gunzip vf logrotate-3.3.tar.gz
[prompt]$ tar xvf logrotate-3.3.tar
[prompt]$ cd logrotate-3.3
[prompt]$ gmake

    cc -E -Wall -D_GNU_SOURCE -DVERSION=\"3.5.2\" -g -M logrotate.c log.c config.c basenames.c >.depend
    /bin/sh: cc: Command is not found. Make: *** [ depend ] Error 1

    To fix, use gmake CC=gcc instead of just gmake.

    gcc -Wall -D_GNU_SOURCE -DVERSION=\" 3.5.2\" -g -c logrotate.c -o logrotate.o
    logrotate.c:6: getopt.h: There is no file or a directory.

    To fix, comment out the #include getopt.h in the files config.c and logrotate.c.

    (snip) gcc -g logrotate.o log.o config.o basenames.o -lpopt -o logrotate
    undefined symbol isblank is first referenced in file config.c

    To fix, insert the following code into the config.c file. This will give a definition for the isblank function, since it isn't defined on your system.

    #ifndef isblank
    #define isblank(c)((c) == ' ' || (c) == '\t')

[prompt]$ gcc -g logrotate.o log.o config.o basenames.o -lpopt -o logrotate -R/opt/sfw/lib

  • This command needs to be run so that the library can be found at runntime by logrotate. The -R/opt/sfw/lib points to the directory where is located. Check to make sure your's is the same.

[prompt]$ su
[prompt]# gmake install
[prompt]# mkdir -p /etc/logrotate.d
[prompt]# cp ./examples/logrotate-default /etc/logrotate.conf
[prompt]# exit
[prompt]$ logrotate /etc/logrotate.conf

    error: error creating state file /var/lib/logrotate.status: No such file or directory

    To fix, do the following:

    [prompt]# mkdir -p /var/lib
    [prompt]# touch /var/lib/logrotate.status

    Then add the following line to the top of the file /var/lib/logrotate.status:

    logrotate state -- version 1

Now logrotate should run properly on your Solaris 9 system.

See Project Contacts for further assistance.
SAIC : An Employee-Owned Company
Advanced Technologies and Solutions Group
7120 Columbia Gateway Dr
Columbia, MD 21046
Site Hosted By: Logo