Rotation of Access and Error Logs for Sun Java System Web Server 6

Below is what I think is the best way to rotate the log files.

1. Create the following files:

bash-3.00# vi \
/opt/iplanet/servers/https-admserv/config/scheduler.conf
<Object name=iplanet instance #1/_rotatelg0>
Command "/opt/iplanet/servers/iplanet instance #1/rotate"
User root
Time 0:00
Days Sun Mon Tue Wed Thu Fri Sat
</Object>
<Object name=iplanet instance #2/_rotatelg0>
Command "/opt/iplanet/servers/iplanet instance #2/rotate"
User root
Time 0:00
Days Sun Mon Tue Wed Thu Fri Sat
</Object>
bash-3.00# vi /opt/iplanet/servers/https-admserv/config/
schedulerd.conf
ConfFile /opt/iplanet/servers/https-admserv/config/scheduler.conf
Dir /tmp
Status on

2. Create a startup/shutdown script:

bash-3.00$ vi /etc/init.d/schedulerd
#!/sbin/sh
#
#
# To restart, start, or stop the iPlanet schedulerd
# control daemon from command line
#
# Work Around for Bug ID: 6528670
# Initially scripted by acervera
# Date: 09/26/2007

SERVER_ROOT=/opt/iplanet/servers
ADMSERV_ROOT=$SERVER_ROOT/https-admserv/config
PID_FILE=$SERVER_ROOT/https-admserv/logs/scheduler.pid
export SERVER_ROOT ADMSERV_ROOT PID_FILE

case "$1" in
'start')
cd $SERVER_ROOT/bin/https/bin
./schedulerd -d $SERVER_ROOT
;;

'stop')
kill -9 -`cat $PID_FILE`
rm $PID_FILE
;;

*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0

3. For the Solaris 10 OS, complete the following substeps. For the Solaris 9 or 8 OS, use step 4 instead.

a. Create a schedulerd.xml file:

bash-3.00$ mkdir -p /var/svc/manifest/application/iplanet
bash-3.00$ vi /var/svc/manifest/application/iplanet/schedulerd.xml
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM
"/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
Copyright 2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
ident "@(#)webmin.xml 1.1 04/11/11 SMI"

Service manifest for iPlanet schedulerd service.
-->

<service_bundle type='manifest' name='schedulerd'>

<service
name='application/iplanet/schedulerd'
type='service'
version='1'>

<create_default_instance enabled='false' />

<single_instance/>

<dependency
name='filesystem'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>

<dependency
name='network'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/network/initial' />
</dependency>

<exec_method
type='method'
name='start'
exec='/etc/init.d/schedulerd start'
timeout_seconds='30' >
</exec_method>

<exec_method
type='method'
name='stop'
exec='/etc/init.d/schedulerd stop'
timeout_seconds='60' />

<stability value='Unstable' />

<template>
<common_name>
<loctext xml:lang='C'>
iPlanet schedulerd
</loctext>
</common_name>
</template>
</service>

</service_bundle>

b. Import the schedulerd.xml data into the repository:

bash-3.00# svccfg -v import \
/var/svc/manifest/application/iplanet/schedulerd.xml
svccfg: Taking "initial" snapshot for
svc:/application/iplanet/schedulerd:default.
svccfg: Taking "last-import" snapshot
for svc:/application/iplanet/schedulerd:default.
svccfg: Refreshed svc:/application/iplanet/schedulerd:default.
svccfg: Successful import.

c. Enable the Sun Java System Web Server schedulerd control daemon so that it always runs at boot time:

bash-3.00# svcadm enable \
svc:/application/iplanet/schedulerd:default

4. On the Solaris 9 or 8 OS, complete the following substeps:

a. Create soft links for /etc/init.d/schedulerd to stop the scheduler at shutdown and start it at boot time.

bash-3.00# ln -s /etc/init.d/schedulerd /etc/rc3.d/S80schedulerd
bash-3.00# ln -s /etc/init.d/schedulerd /etc/rcS.d/K05schedulerd
bash-3.00# ln -s /etc/init.d/schedulerd /etc/rc2.d/K05schedulerd
bash-3.00# ln -s /etc/init.d/schedulerd /etc/rc1.d/K05schedulerd
bash-3.00# ln -s /etc/init.d/schedulerd /etc/rc0.d/S05schedulerd

b. Start the Sun Java System Web Server schedulerd control daemon:

bash-3.00# /etc/init.d/schedulerd start

Editor's Note: "iplanet" in the code above refers to the previous name of the Web Server, formerly known as Sun ONE or iPlanet Web Server.