vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello: Documentation on SpamAssassin states that the spamd daemon must be started before sendmail. How can I ensure it will be so at boot time if I start spamd (1) as legacy_run from a /etc/rc#.d script, or (2) as a SMF service with its manifest loaded in the database ? -- , /) // Guy Paulus (Sys Admin) (/ BATir Dept., CP-194/2 _/ ______ Universite Libre de Bruxelles ) ( (-----( 50 av. F. D. Roosevelt /INK\ \ \ B-1050 Brussels \___/ \ \ Phone: +32(2)650 3652 jgs _)_____) Fax: +32(2)650 2789 `------` |
| |||
| Guy Paulus <gpaulus@batir.ulb.ac.be> writes: >Documentation on SpamAssassin states that the spamd daemon must be >started before sendmail. How can I ensure it will be so at boot time >if I start spamd (1) as legacy_run from a /etc/rc#.d script, or (2) >as a SMF service with its manifest loaded in the database ? As an SMF service in S10 this is easy (declare that sendmail depends on spamd in spamd's .xml file) and in S9 just use an rc file numbered before sendmail. Using an rc file in S10 is not really an option for such constraints. Casper -- Expressed in this posting are my opinions. They are in no way related to opinions held by my employer, Sun Microsystems. Statements on Sun products included here are not gospel and may be fiction rather than truth. |
| |||
| On Wed, 12 Mar 2008, Casper H.S. Dik wrote: > As an SMF service in S10 this is easy (declare that sendmail depends on > spamd in spamd's .xml file) and in S9 just use an rc file numbered > before sendmail. Thanks for your information. I realize I forgot to mention that my OS is Solaris 10. Is there no need to introduce a dependency on spamd in sendmail's .xml file ? Regards, Guy -- , /) // Guy Paulus (Sys Admin) (/ BATir Dept., CP-194/2 _/ ______ Universite Libre de Bruxelles ) ( (-----( 50 av. F. D. Roosevelt /INK\ \ \ B-1050 Brussels \___/ \ \ Phone: +32(2)650 3652 jgs _)_____) Fax: +32(2)650 2789 `------` |
| |||
| Guy Paulus <gpaulus@batir.ulb.ac.be> wrote: > On Wed, 12 Mar 2008, Casper H.S. Dik wrote: > >> As an SMF service in S10 this is easy (declare that sendmail depends on >> spamd in spamd's .xml file) and in S9 just use an rc file numbered >> before sendmail. > > Thanks for your information. I realize I forgot to mention that my OS is > Solaris 10. Is there no need to introduce a dependency on spamd in > sendmail's .xml file ? You can either make it so, that the sendmail service lists SA as a /dependency/, or you can write the SA manifest so, that it lists sendmail as a /dependent/ service. http://www.sun.com/bigadmin/content/...sdev_intro.jsp might be of help. It says: | That is, dependent specifications are an easy way to have your | service run before a service delivered by Sun. As I often hesitate to modify stuff that's shipped by the OS, I'd hesitate to modify the sendmail service. Instead, I'd go the "dependent" route, especially as both ways accomplish the same result. Regards, Michael |
| ||||
| Guy Paulus wrote: > Thanks for your information. I realize I forgot to mention that my OS is > Solaris 10. Is there no need to introduce a dependency on spamd in > sendmail's .xml file ? No, you can put that into the xml file for spamd. As I just put spamd into SMF myself, here's what I used: -- The site-spamd file, to be put in /lib/svc/method/: #!/bin/sh # PATH=/bin:/usr/sbin export PATH SPAMDBIN=/usr/local/sa/bin/spamd SPAMDPID=/var/run/spamd.pid case $1 in 'start') $SPAMDBIN --daemonize --syslog-socket=inet --pidfile $SPAMDPID ;; 'restart') test -f $SPAMDPID && kill -HUP `cat $SPAMDPID` ;; 'stop') test -f $SPAMDPID && kill `cat $SPAMDPID` ;; esac To fully comply with the SMF standards, you might want to modify this file to source /lib/svc/share/smf_include.sh and use "exit $SMF_EXIT_OK". -- The spamd.xml file, to be put in /var/svc/manifest/site/: <?xml version="1.0"?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <service_bundle type='manifest' name='site:spamd'> <service name='site/spamd' type='service' version='1'> <create_default_instance enabled='true' /> <single_instance/> <dependency name='fs-local' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/system/filesystem/local' /> </dependency> <dependency name='network-service' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/network/service' /> </dependency> <dependency name='name-services' grouping='require_all' restart_on='refresh' type='service'> <service_fmri value='svc:/milestone/name-services' /> </dependency> <dependency name='identity' grouping='optional_all' restart_on='refresh' type='service'> <service_fmri value='svc:/system/identity:domain' /> </dependency> <dependency name='system-log' grouping='optional_all' restart_on='none' type='service'> <service_fmri value='svc:/system/system-log' /> </dependency> <dependency name='autofs' grouping='optional_all' restart_on='none' type='service'> <service_fmri value='svc:/system/filesystem/autofs' /> </dependency> <dependent name='spamd_sendmail' grouping='optional_all' restart_on='none'> <service_fmri value='svc:/network/smtp:sendmail' /> </dependent> <dependent name='spamd_multi-user' grouping='optional_all' restart_on='none'> <service_fmri value='svc:/milestone/multi-user' /> </dependent> <exec_method type='method' name='start' exec='/lib/svc/method/site-spamd start' timeout_seconds='60' /> <exec_method type='method' name='stop' exec='/lib/svc/method/site-spamd stop' timeout_seconds='60' /> <exec_method type='method' name='refresh' exec='/lib/svc/method/site-spamd restart' timeout_seconds='60' /> <stability value='Unstable' /> <template> <common_name> <loctext xml:lang='C'> spamd </loctext> </common_name> </template> </service> </service_bundle> After both files are in place, use: svccfg import /var/svc/manifest/site/spamd.xml to import the service into SMF. You can then use the usual commands to enable/disable the service: svcadm enable svc:/site/spamd:default svcadm disable svc:/site/spamd:default To check for dependencies/dependents, use: svcs -d svc:/site/spamd svcs -D svc:/site/spamd The latter should show sendmail and multi-user. Hope that helps, Martin. -- SysAdmin | Institute of Scientific Computing, University of Vienna PCA | Analyze, download and install patches for Solaris | http://www.par.univie.ac.at/solaris/pca/ |