After playing around with syslog-ng on Solaris 10 today, here are some notes: * As mentioned from Kenneth G, libol / syslog-ng should compile fine on Solaris 10, just make sure --enable-full-dynamic" in your configure for syslog-ng. * You may also need to update your LD_LIBRARY_PATH and PATH (/usr/sfw & /opt/sfw ? ) * Service Management Facility ("svcs" "svcadm" "svccfg" commands) You can choose to run syslog-ng via the traditional /etc/init.d method on solaris 10 and then wrap that start and stop script with the solaris 10's smf facility, or the other option is to do everything via the SMF facility. I've attached two files to do the later. The example files assume your syslog-ng.conf is ln /etc/syslog-ng/ -> /usr/local/etc/syslog-ng/ and the binary is /usr/local/sbin/syslog-ng: 1) Compile and install libol, syslog-ng. 2) mkdir /usr/local/etc/syslog-ng; ln -s /usr/local/etc/syslog-ng /etc/syslog-ng 3) copy your syslog-ng.conf to /etc/syslog-ng/ 4) cp svc.method.syslog-ng /lib/svc/method/syslog-ng 5) cp svc.manifest.syslog-ng.xml /var/svc/manifest/system/syslog-ng.xml 6) `svccfg import /var/svc/manifest/system/syslog-ng.xml` Then to switch from standard syslog to syslog-ng: 1) svcadm disable system-log 2) svcadm enable syslog-ng To revert back to solaris 10's default syslog, and have it running on reboot: 1) `svcadm disable syslog-ng` 2) `svccfg delete syslog-ng` 3) `svcadm enable system-log` ---------- Forwarded message ---------- From: kenneth.gullberg@foreningssparbanken.se < kenneth.gullberg@foreningssparbanken.se> Date: May 26, 2005 5:11 AM Subject: SV: [syslog-ng] syslog-ng 1.6.8 has been released To: syslog-ng@lists.balabit.hu Hi, Here is a small suggestion for the INSTALL file in the next release for unexperienced admin's: Solaris 10 ---------- For successful compilation on Solaris 10 you need to use --enable-full-dynamic when you run configure. // Kenneth
Hello, Thanks for the excellent write-up.
After playing around with syslog-ng on Solaris 10 today, here are some notes: * As mentioned from Kenneth G, libol / syslog-ng should compile fine on Solaris 10, just make sure --enable-full-dynamic" in your configure for syslog-ng. * You may also need to update your LD_LIBRARY_PATH and PATH (/usr/sfw & /opt/sfw ? ) * Service Management Facility ("svcs" "svcadm" "svccfg" commands) You can choose to run syslog-ng via the traditional /etc/init.d method on solaris 10 and then wrap that start and stop script with the solaris 10's smf facility, or the other option is to do everything via the SMF facility. I've attached two files to do the later.
The example files assume your syslog-ng.conf is ln /etc/syslog-ng/ -> /usr/local/etc/syslog-ng/ and the binary is /usr/local/sbin/syslog-ng: 1) Compile and install libol, syslog-ng. 2) mkdir /usr/local/etc/syslog-ng; ln -s /usr/local/etc/syslog-ng /etc/syslog-ng
You don't really need the symlink, just submit the config file using --cfgfile upon invocation of syslog-ng.
3) copy your syslog-ng.conf to /etc/syslog-ng/ 4) cp svc.method.syslog-ng /lib/svc/method/syslog-ng 5) cp svc.manifest.syslog-ng.xml /var/svc/manifest/system/syslog-ng.xml 6) `svccfg import /var/svc/manifest/system/syslog-ng.xml`
Then to switch from standard syslog to syslog-ng: 1) svcadm disable system-log 2) svcadm enable syslog-ng
To revert back to solaris 10's default syslog, and have it running on reboot: 1) `svcadm disable syslog-ng` 2) `svccfg delete syslog-ng` 3) `svcadm enable system-log`
So why not make it a package then? You basically provided all the files and also the knowledge needed to create a package. The addition to the hybrid Makefile could be something along the lines of (schematically): ------------------------------------------------------------------ PKGDIR = /var/spool/pkg package: stamp_build @echo "\n\tYou can ignore the warnings from pkgmk\n" cd pkg; pkgmk -od ${PKGDIR} @pkgname=syslog-ng cd ${PKGDIR}; tar cf - $$pkgname | compress > $${pkgname}.tar.Z rm -rf $$pkgname stamp_build: configure cd distrib; make touch $@ config: configure configure: cd distrib; ./configure touch $@ clean: \rm -f stamp_* cd distrib; make distclean ------------------------------------------------------------------ In the pkg subdir of the syslog-ng tar ball we could put the following files: ## ## pkg/protoype ## i postinstall i preremove !search ../misc ../distrib/ ../distrib/doc d none /etc ? ? ? d none /usr ? ? ? d none /usr/local ? ? ? d none /usr/local/sbin ? ? ? d none /usr/share ? ? ? d none /usr/share/man ? ? ? # [a lot more entries] !default 0755 sbin sbin f none /usr/local/sbin/syslog-ng # [a lot more entries] ------------ ## ## pkg/preremove ## #!/bin/sh echo "Warning: syslog-ng will be removed" # here a kill of the syslog-ng process should be placed svcadm enable system-log ------------ ## ## pkg/postinstall ## # provided we have cp svc.method.syslog-ng in /lib/svc/method/syslog-ng # and svc.manifest.syslog-ng.xml in /var/svc/manifest/system/syslog-ng.xml svccfg import /var/svc/manifest/system/syslog-ng.xml svcadm disable system-log svcadm enable syslog-ng So syslog-ng would be a hybrid package. Best regards, Roberto Nibali, ratz -- ------------------------------------------------------------- addr://Rathausgasse 31, CH-5001 Aarau tel://++41 62 823 9355 http://www.terreactive.com fax://++41 62 823 9356 ------------------------------------------------------------- terreActive AG Wir sichern Ihren Erfolg -------------------------------------------------------------
Roberto-- Good work. A couple notes-- * If one changes the --cfgfile option, then the svc.method file should be updated as well (it checks for the config file)... * We use the convention /etc/syslog-ng/ -> /usr/local/etc here; If my memory serves correctly, I ran into a small issue between the builds (maybe it was sunfreeware and a compiled build?). In any event, the link was an easy workaround to make sure syslog-ng starts up (with a config file). * The other thing is, logrotation may need to be updated (logadm.conf) : /var/log/syslog -C 8 -P 'Sat May 28 08:10:00 2005' -a 'kill -HUP `cat /var/run/syslog.pid`' /var/adm/messages -C 4 -P 'Sat May 28 08:10:00 2005' -a 'kill -HUP `cat /var/run/syslog.pid`' to /var/log/syslog -C 8 -P 'Sat May 28 08:10:00 2005' -a '/usr/sbin/svcadm refresh syslog-ng`' /var/adm/messages -C 4 -P 'Sat May 28 08:10:00 2005' -a '/usr/sbin/svcadm refresh syslog-ng`' ----- I'm not sure why Sun doesn't use svcadm to -HUP syslog... It should be noted, that feature with smf (as Sun touts as automatic healing) is that if you `pkill -9 syslog-ng` smf will :respawn: a new syslog-ng process. On 6/2/05, Roberto Nibali <ratz@tac.ch> wrote:
Hello,
Thanks for the excellent write-up.
After playing around with syslog-ng on Solaris 10 today, here are some notes: * As mentioned from Kenneth G, libol / syslog-ng should compile fine on Solaris 10, just make sure --enable-full-dynamic" in your configure for syslog-ng. * You may also need to update your LD_LIBRARY_PATH and PATH (/usr/sfw & /opt/sfw ? ) * Service Management Facility ("svcs" "svcadm" "svccfg" commands) You can choose to run syslog-ng via the traditional /etc/init.d method on solaris 10 and then wrap that start and stop script with the solaris 10's smf facility, or the other option is to do everything via the SMF facility. I've attached two files to do the later.
The example files assume your syslog-ng.conf is ln /etc/syslog-ng/ -> /usr/local/etc/syslog-ng/ and the binary is /usr/local/sbin/syslog-ng: 1) Compile and install libol, syslog-ng. 2) mkdir /usr/local/etc/syslog-ng; ln -s /usr/local/etc/syslog-ng /etc/syslog-ng
You don't really need the symlink, just submit the config file using --cfgfile upon invocation of syslog-ng.
3) copy your syslog-ng.conf to /etc/syslog-ng/ 4) cp svc.method.syslog-ng /lib/svc/method/syslog-ng 5) cp svc.manifest.syslog-ng.xml /var/svc/manifest/system/syslog-ng.xml 6) `svccfg import /var/svc/manifest/system/syslog-ng.xml`
Then to switch from standard syslog to syslog-ng: 1) svcadm disable system-log 2) svcadm enable syslog-ng
To revert back to solaris 10's default syslog, and have it running on reboot: 1) `svcadm disable syslog-ng` 2) `svccfg delete syslog-ng` 3) `svcadm enable system-log`
So why not make it a package then? You basically provided all the files and also the knowledge needed to create a package. The addition to the hybrid Makefile could be something along the lines of (schematically):
------------------------------------------------------------------ PKGDIR = /var/spool/pkg
package: stamp_build @echo "\n\tYou can ignore the warnings from pkgmk\n" cd pkg; pkgmk -od ${PKGDIR} @pkgname=syslog-ng cd ${PKGDIR}; tar cf - $$pkgname | compress > $${pkgname}.tar.Z rm -rf $$pkgname
stamp_build: configure cd distrib; make touch $@
config: configure configure: cd distrib; ./configure touch $@
clean: \rm -f stamp_* cd distrib; make distclean ------------------------------------------------------------------
In the pkg subdir of the syslog-ng tar ball we could put the following files:
## ## pkg/protoype ## i postinstall i preremove
!search ../misc ../distrib/ ../distrib/doc
d none /etc ? ? ? d none /usr ? ? ? d none /usr/local ? ? ? d none /usr/local/sbin ? ? ? d none /usr/share ? ? ? d none /usr/share/man ? ? ? # [a lot more entries]
!default 0755 sbin sbin f none /usr/local/sbin/syslog-ng # [a lot more entries]
------------
## ## pkg/preremove ## #!/bin/sh
echo "Warning: syslog-ng will be removed" # here a kill of the syslog-ng process should be placed svcadm enable system-log
------------
## ## pkg/postinstall ## # provided we have cp svc.method.syslog-ng in /lib/svc/method/syslog-ng # and svc.manifest.syslog-ng.xml in /var/svc/manifest/system/syslog-ng.xml svccfg import /var/svc/manifest/system/syslog-ng.xml svcadm disable system-log svcadm enable syslog-ng
So syslog-ng would be a hybrid package.
Best regards, Roberto Nibali, ratz -- ------------------------------------------------------------- addr://Rathausgasse 31, CH-5001 Aarau tel://++41 62 823 9355 http://www.terreactive.com fax://++41 62 823 9356 ------------------------------------------------------------- terreActive AG Wir sichern Ihren Erfolg -------------------------------------------------------------
Hello Dave, I've just, for the sake of completeness and reduced redundancy, browsed through the http://www.sunfreeware.com/ site and noticed that Steve Christensen seems to be packaging syslog-ng for Solaris already. Steve, would you care to read through the two previous messages of this thread in the syslog-ng archive below, please? https://lists.balabit.hu/pipermail/syslog-ng/2005-June/007525.html Is there anything you could use to create a Solaris 10 package, including application handling through the SMF facility? I think if Bazsi does not mind, the additional files for Solaris could be added to the syslog-ng package.
A couple notes-- * If one changes the --cfgfile option, then the svc.method file should be updated as well (it checks for the config file)...
True.
* We use the convention /etc/syslog-ng/ -> /usr/local/etc here; If my memory serves correctly, I ran into a small issue between the builds (maybe it was sunfreeware and a compiled build?).
I think I know what you mean. The configure switch "--sysconfdir=" does not work as expected. We have the following line in our top level Makefile above syslog-ng (to switch from /etc/syslog-ng to /etc): echo "#undef PATH_SYSCONFDIR" >> src/src/config.h echo "#define PATH_SYSCONFDIR \"/etc/\"" >> src/src/config.h Since configure is platform-independent I reckon this issue remains for a Solaris compilation. I remember that recently someone sent a patch which however was rejected by the master himself.
In any event, the link was an easy workaround to make sure syslog-ng starts up (with a config file).
Agreed.
* The other thing is, logrotation may need to be updated (logadm.conf) : /var/log/syslog -C 8 -P 'Sat May 28 08:10:00 2005' -a 'kill -HUP `cat /var/run/syslog.pid`' /var/adm/messages -C 4 -P 'Sat May 28 08:10:00 2005' -a 'kill -HUP `cat /var/run/syslog.pid`' to /var/log/syslog -C 8 -P 'Sat May 28 08:10:00 2005' -a '/usr/sbin/svcadm refresh syslog-ng`' /var/adm/messages -C 4 -P 'Sat May 28 08:10:00 2005' -a '/usr/sbin/svcadm refresh syslog-ng`'
Right.
----- I'm not sure why Sun doesn't use svcadm to -HUP syslog...
<irony> Maybe they don't trust svcadm ;) Or the change request is still in the testing phase and will be ready for Solaris 11 with a proper change management mechanism for all Solaris customers. </sarcasm>
It should be noted, that feature with smf (as Sun touts as automatic healing) is that if you `pkill -9 syslog-ng` smf will :respawn: a new syslog-ng process.
Yes, such a watchdog feature (the word I prefer) should be part of any Unix/Linux OS. Debian has a similar thing, IIRC. It would technically also be dead easy to implement. All you have to do in 99% of the cases is to have a crontab entry which restarts the daemon every minute (yes, I'm very well aware of the implications of this approach, but for 99% of the cases this works wonders). A well written start script has proper application control and basically exits again if the daemon is running or, in case of application failure, respawns the daemon. I hope we get someone to update the package to include our findings in this thread. Personally I don't have the time to do this. Best regards, Roberto Nibali, ratz -- ------------------------------------------------------------- addr://Rathausgasse 31, CH-5001 Aarau tel://++41 62 823 9355 http://www.terreactive.com fax://++41 62 823 9356 ------------------------------------------------------------- terreActive AG Wir sichern Ihren Erfolg -------------------------------------------------------------
On Thu, Jun 02, 2005 at 08:15:32AM +0200, Roberto Nibali wrote:
So why not make it a package then? You basically provided all the files and also the knowledge needed to create a package. The addition to the hybrid Makefile could be something along the lines of (schematically):
Here's one I made while Solaris 10 was still in beta, works great on sol 8, 9 and 10. http://www.campin.net/download/NCsysng-1.6.7-1.pkg.gz A couple things come to mind where it's creator realizes it's not perfect: 1) the RC script(s) are embedded in the postinstall and postremove scripts, it doesn't preserve any local changes you made to it (doesn't matter on solaris 10 obviously, since the package uses the SMF). 2) it'll install a couple uneeded files on solaris 8 and 9 pertaining to the SMF facility in sol10. It doesn't hurt anything, but it's not pretty. I'm too lazy to fix it since I only used this package on solaris 10. I don't plan on maintaining an up to date package all the time, but I'll fix any errors anyone points out in the package and update the version if I'm in there fixing the package anyways. -- Nate BASIC - A programming language. Related to certain social diseases in that those who have it will not admit it in polite company. -Anon.
--On Wednesday, June 01, 2005 7:33 PM -0500 Dave Johnson <davejjohnson@gmail.com> wrote:
* You may also need to update your LD_LIBRARY_PATH and PATH (/usr/sfw & /opt/sfw ? )
No. No. No. Properly compile the application. If configure doesn't do it, set the environment variable LD_RUN_PATH before compiling the app. You should _never_ need to set LD_LIBRARY_PATH on Solaris for any properly compiled application. If you don't want to require a fixed install path, you can even set up relative run paths to look in /path/to/binary/exe/../../lib/ by adding '$ORIGIN/../lib' to the run path (although you'll have to mark that directory as trustworthy if the app is set[gu]id - see the crle(1) man page). -- Carson
participants (4)
-
Carson Gaspar
-
Dave Johnson
-
Nate Campi
-
Roberto Nibali