Since you appear to have both kinds of init files (sysV and systemd), you may want to doublecheck which init system is actually running. I'm pretty sure you can figure it out by running "dpkg -S /sbin/init" (this tells you which package owns that file). It will probably say systemd-sysv, in which case you'll want to follow Shawn's instruction. If it says upstart, then you'll most likely need to edit /etc/init.d/spamassassin instead.
On Wed, 7 Dec 2016, Shawn Bakhtiar wrote:
Yeah... it's missing the "after" directive in the [unit] section, which would have systemD wait until the other services (targets) are up. But also as Marc mentioned not sure why you would use Monit since systemD (for all it's issues) does monitor daemons and makes sure to spawn them again if they die for any reason. although according to the Monit wiki you can run it with systemD (https://mmonit.com/wiki/Monit/Systemd), just not sure what the advantages are. You should have something like this: [unit] ... After=syslog.target network.target ... You can add any target to after directive in [unit] to make sure it's up before SA starts. On Dec 6, 2016, at 8:39 PM, Michael Heuberger <michael.heuber...@binarykitchen.com> wrote: Thanks Shawn Here the contents on my server: michael.heuberger@binarykitchen /l/s/system ❯❯❯ cat spamassassin.service [Unit] Description=Perl-based spam filter using text analysis [Service] Type=forking PIDFile=/var/run/spamassassin.pid EnvironmentFile=-/etc/default/spamassassin ExecStart=/usr/sbin/spamd -d --pidfile=/var/run/spamassassin.pid $OPTIONS ExecReload=/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target Does this seem to be outdated and wrong? - Michael On 7/12/16 09:29, Shawn Bakhtiar wrote: With Ubuntu 16.10 you should be using systemd. you can enable dependencies (after directive) which can make sure that all the services you need are started prior to (in the case of SA) the service you want. Check your systemD service configuration file: /usr/lib/systemd/system/spamassassin.service (or wherever your systemD config files are stored on Ubuntu. The content should be something like: [Unit] Description=Spamassassin daemon After=syslog.target network.target Wants=sa-update.timer [Service] EnvironmentFile=-/etc/sysconfig/spamassassin ExecStart=/usr/bin/spamd $SPAMDOPTIONS StandardOutput=null StandardError=null Restart=always [Install] WantedBy=multi-user.target Notice that systemd waits for syslog and network to complete before it launches spamassassin. Checkout this document if you have not and are still using upstart. https://wiki.ubuntu.com/SystemdForUpstartUsers On Dec 6, 2016, at 9:40 AM, sha...@shanew.net wrote: I recently set up an email server on Ubuntu 14.10 and kept being frustrated that on boot various filter software and related milters were regularly starting after sendmail, sometimes by as much as five minutes. We don't reboot that server very often, so it took a while to test various fixes, but in the end I added the following lines to the INIT INFO section of various milters (it's really only the first one that matters for startup): # X-Start-Before: sendmail # X-Stop-After: sendmail If postfix uses an /etc/init.d script like sendmail does on 14.10, check to see what the "Provides:" part of the INIT INFO is (probably postfix), and add an X-Start-Before line with tha value to the spamassassin init script. Or, if you just want to make sure that SA starts before monit, use whatever the "Provides:" is set to in the monit init script. If you have a mixture of SysV (regular) and upstart script, things get more complicated (unless 16.10 introduces functionality to make dependencies interoperable that doesn't exist in 14.10). On Tue, 6 Dec 2016, Michael Heuberger wrote: Hi David I dont know. Not sure how I can find this out whether it does some DNS/network stuff. In my other response to John you can see that it takes about 5.69 sec to start spamassassin. And no idea how to configure a SA startup dependency on the network being up. And shouldn't that come along with the package when installed via apt-get? - Michael On 6/12/16 11:47, David B Funk wrote: Could it be some kind if interaction with other system services startup? (in particular this feels like a network timeout issue). One of the things SA does during its startup process is check to see if DNS/network stuff is available. If the system hasn't yet brought up the network stack when SA starts, it may hang waiting for the network to stabilize. On a running system, if you stop/restart SA do you see the same delay or is it only on a cold start of the system? Is it possible to configure a SA starup dependency on the network being up? -- Public key #7BBC68D9 at | Shane Williams http://pgp.mit.edu/ | System Admin - UT CompSci =----------------------------------+------------------------------- All syllogisms contain three lines | sha...@shanew.net Therefore this is not a syllogism | www.ischool.utexas.edu/~shanew
-- Public key #7BBC68D9 at | Shane Williams http://pgp.mit.edu/ | System Admin - UT CompSci =----------------------------------+------------------------------- All syllogisms contain three lines | sha...@shanew.net Therefore this is not a syllogism | www.ischool.utexas.edu/~shanew