Roberto--<br>
<br>
Good work.<br>
<br>
A couple notes--<br>
* If one changes the --cfgfile option, then the svc.method<br>
file should be updated as well (it checks for the config file)...<br>
<br>
* We use the convention /etc/syslog-ng/ -> /usr/local/etc here;<br>
If my memory serves correctly, I ran into a small issue between<br>
the builds (maybe it was sunfreeware and a compiled build?). <br>
In any event, the link was an easy workaround to make sure<br>
syslog-ng starts up (with a config file).<br>
<br>
* The other thing is, logrotation may need to be updated (logadm.conf) :<br>
/var/log/syslog -C 8 -P 'Sat May 28 08:10:00 2005' -a 'kill -HUP `cat /var/run/syslog.pid`'<br>
/var/adm/messages -C 4 -P 'Sat May 28 08:10:00 2005' -a 'kill -HUP `cat /var/run/syslog.pid`'<br>
to<br>
/var/log/syslog -C 8 -P 'Sat May 28 08:10:00 2005' -a '/usr/sbin/svcadm refresh syslog-ng`'<br>
/var/adm/messages -C 4 -P 'Sat May 28 08:10:00 2005' -a '/usr/sbin/svcadm refresh syslog-ng`'<br>
-----<br>
I'm not sure why Sun doesn't use svcadm to -HUP syslog...<br>
<br>
It should be noted, that feature with smf (as Sun touts as automatic healing) is that if you <br>
`pkill -9 syslog-ng` smf will :respawn: a new syslog-ng process. <br>
<br><div><span class="gmail_quote">On 6/2/05, <b class="gmail_sendername">Roberto Nibali</b> <<a href="mailto:ratz@tac.ch">ratz@tac.ch</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>Thanks for the excellent write-up.<br><br>> After playing around with syslog-ng on Solaris 10 today, here are some<br>> notes:<br>> * As mentioned from Kenneth G, libol / syslog-ng should compile fine on
<br>> Solaris 10, just make<br>> sure --enable-full-dynamic" in your configure for syslog-ng.<br>> * You may also need to update your LD_LIBRARY_PATH and PATH (/usr/sfw &<br>> /opt/sfw ? )<br>> * Service Management Facility ("svcs" "svcadm" "svccfg" commands)
<br>> You can choose to run syslog-ng via the traditional /etc/init.d method<br>> on solaris 10 and then wrap that start<br>> and stop script with the solaris 10's smf facility, or the other option<br>> is to do everything via the SMF facility.
<br>> I've attached two files to do the later.<br>><br>> The example files assume your syslog-ng.conf is ln /etc/syslog-ng/ -><br>> /usr/local/etc/syslog-ng/<br>> and the binary is /usr/local/sbin/syslog-ng:
<br>> 1) Compile and install libol, syslog-ng.<br>> 2) mkdir /usr/local/etc/syslog-ng; ln -s /usr/local/etc/syslog-ng<br>> /etc/syslog-ng<br><br>You don't really need the symlink, just submit the config file using --cfgfile
<br>upon invocation of syslog-ng.<br><br>> 3) copy your syslog-ng.conf to /etc/syslog-ng/<br>> 4) cp svc.method.syslog-ng /lib/svc/method/syslog-ng<br>> 5) cp svc.manifest.syslog-ng.xml /var/svc/manifest/system/syslog-
ng.xml<br>> 6) `svccfg import /var/svc/manifest/system/syslog-ng.xml`<br>><br>> Then to switch from standard syslog to syslog-ng:<br>> 1) svcadm disable system-log<br>> 2) svcadm enable syslog-ng<br>><br>
> To revert back to solaris 10's default syslog, and have it running on<br>> reboot:<br>> 1) `svcadm disable syslog-ng`<br>> 2) `svccfg delete syslog-ng`<br>> 3) `svcadm enable system-log`<br><br>So why not make it a package then? You basically provided all the files and also
<br>the knowledge needed to create a package. The addition to the hybrid Makefile<br>could be something along the lines of (schematically):<br><br>------------------------------------------------------------------<br>PKGDIR = /var/spool/pkg
<br><br>package: stamp_build<br> @echo "\n\tYou can ignore the warnings from pkgmk\n"<br> cd pkg; pkgmk -od ${PKGDIR}<br> @pkgname=syslog-ng<br> cd ${PKGDIR}; tar cf - $$pkgname | compress > $${pkgname}.tar.Z
<br> rm -rf $$pkgname<br><br>stamp_build: configure<br> cd distrib; make<br> touch $@<br><br>config: configure<br>configure:<br> cd distrib; ./configure<br> touch $@<br><br>clean:<br>
\rm -f stamp_*<br> cd distrib; make distclean<br>------------------------------------------------------------------<br><br>In the pkg subdir of the syslog-ng tar ball we could put the following files:<br><br>
##<br>## pkg/protoype<br>##<br>i postinstall<br>i preremove<br><br>!search ../misc ../distrib/ ../distrib/doc<br><br>d none /etc ? ? ?<br>d none /usr ? ? ?<br>d none /usr/local ? ? ?<br>d none /usr/local/sbin ? ? ?<br>d none /usr/share ? ? ?
<br>d none /usr/share/man ? ? ?<br># [a lot more entries]<br><br><br>!default 0755 sbin sbin<br>f none /usr/local/sbin/syslog-ng<br># [a lot more entries]<br><br><br>------------<br><br>##<br>## pkg/preremove<br>##<br>#!/bin/sh
<br><br>echo "Warning: syslog-ng will be removed"<br># here a kill of the syslog-ng process should be placed<br>svcadm enable system-log<br><br>------------<br><br>##<br>## pkg/postinstall<br>##<br># provided we have cp
svc.method.syslog-ng in /lib/svc/method/syslog-ng<br># and svc.manifest.syslog-ng.xml in /var/svc/manifest/system/syslog-ng.xml<br>svccfg import /var/svc/manifest/system/syslog-ng.xml<br>svcadm disable system-log<br>svcadm enable syslog-ng
<br><br>So syslog-ng would be a hybrid package.<br><br>Best regards,<br>Roberto Nibali, ratz<br>--<br>-------------------------------------------------------------<br><a href="addr://Rathausgasse">addr://Rathausgasse</a> 31, CH-5001 Aarau tel://++41 62 823 9355
<br><a href="http://www.terreactive.com">http://www.terreactive.com</a> fax://++41 62 823 9356<br>-------------------------------------------------------------<br>terreActive
AG
Wir sichern Ihren Erfolg<br>-------------------------------------------------------------<br></blockquote></div><br>