On 07/12/2009 14:34, Eugene Vilensky wrote:
Hi,
Is syslog-ng available for OpenSolaris, through IPS or otherwise? If
I were to build it, is there an "easy" metapackage for the build
system, maybe analogous to Red Hat's rpmbuild+dependencies or Debian's
"build-essential" metapackage?
I'm running syslog-ng-2.0.5, and it was essentially a no-brainer. Just
./configure CC=cc CFLAGS=-O
make
make install
> ./config.status --version
config.status
configured by ./configure, generated by GNU Autoconf 2.61,
with options "'CC=cc' 'CFLAGS=-O'"
>
I knocked up an SMF service for it. (I just copied the standard syslog
files and tweaked them.) XML and script attached.
Cheers,
Rob
--
E-Mail: rob.mcma...@warwick.ac.uk PHONE: +44 24 7652 3037
Rob McMahon, IT Services, Warwick University, Coventry, CV4 7AL, England
#!/sbin/sh
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "@(#)system-log 1.18 06/10/25 SMI"
. /lib/svc/share/smf_include.sh
if [ ! -f /etc/syslog-ng/syslog-ng.conf ]; then
echo "/etc/syslog-ng/syslog-ng.conf is missing. Exiting."
exit $SMF_EXIT_ERR_CONFIG
fi
if [ ! -x /usr/local/sbin/syslog-ng ]; then
echo "Executable /usr/local/sbin/syslog-ng not found. Exiting"
exit $SMF_EXIT_ERR_CONFIG
fi
if [ "${_INIT_ZONENAME:=`/sbin/zonename`}" = "global" ]; then
#
# Before syslogd starts, save any messages from
# previous crash dumps so that messages appear
# in chronological order.
#
/usr/bin/savecore -m
if [ -r /etc/dumpadm.conf ]; then
. /etc/dumpadm.conf
[ -n "$DUMPADM_DEVICE" -a "x$DUMPADM_DEVICE" != xswap ] && \
/usr/bin/savecore -m -f $DUMPADM_DEVICE
fi
fi
if [ ! -f /var/adm/messages ]; then
/usr/bin/cp /dev/null /var/adm/messages
/usr/bin/chmod 0644 /var/adm/messages
fi
/usr/local/sbin/syslog-ng -f /etc/syslog-ng/syslog-ng.conf >/dev/msglog 2>&1 &
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
Copyright 2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
ident "@(#)system-log.xml 1.9 06/08/01 SMI"
NOTE: This service manifest is not editable; its contents will
be overwritten by package or patch operations, including
operating system upgrade. Make customizations in a different
file.
-->
<service_bundle type='manifest' name='site:syslog-ng'>
<service
name='site/syslog-ng'
type='service'
version='1'>
<create_default_instance enabled='false' />
<single_instance/>
<dependency
name='milestone'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/milestone/sysconfig' />
</dependency>
<!--
syslogd(1M) can log to non-root local directories.
-->
<dependency
name='filesystem'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/local' />
</dependency>
<!--
syslogd(1M) can log to automounted files.
-->
<dependency
name='autofs'
grouping='optional_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/system/filesystem/autofs' />
</dependency>
<!--
syslogd(1M) needs nameservice resolution to log to remote hosts.
-->
<dependency
name='name-services'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/milestone/name-services' />
</dependency>
<dependent
name='syslog-ng_single-user'
grouping='optional_all'
restart_on='none'>
<service_fmri value='svc:/milestone/multi-user' />
</dependent>
<!--
The system-log start method includes a "savecore -m".
Use an appropriately long timeout value.
-->
<exec_method
type='method'
name='start'
exec='/usr/local/lib/svc/method/syslog-ng'
timeout_seconds='600' />
<exec_method
type='method'
name='stop'
exec=':kill'
timeout_seconds='60' />
<exec_method
type='method'
name='refresh'
exec=':kill -HUP'
timeout_seconds='60' />
<property_group name='general' type='framework'>
<!-- to start stop syslog daemon -->
<propval name='action_authorization' type='astring'
value='solaris.smf.manage.system-log' />
</property_group>
<stability value='Unstable' />
<template>
<common_name>
<loctext xml:lang='C'> system log
</loctext>
</common_name>
<documentation>
<manpage title='syslog-ng' section='8'
manpath='/usr/local/share/man' />
</documentation>
</template>
</service>
</service_bundle>
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org