From ff39a13a071260150619c19fa5ba55d6d46a7ae2 Mon Sep 17 00:00:00 2001 From: Colin Smith Date: Wed, 22 Jun 2005 19:20:15 +0000 Subject: Update spamd to use new rcfile and service facilities. (needs testing) --- packages/spamd.xml | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'packages') diff --git a/packages/spamd.xml b/packages/spamd.xml index b755abab..8a326a76 100644 --- a/packages/spamd.xml +++ b/packages/spamd.xml @@ -5,19 +5,22 @@ - SpamD - + spamd
Services
spamd.xml
+ + spamd + spamd.sh + - SpamD Settings + spamd Settings /pkg.php?xml=spamd.xml - SpamD Whitelist + spamd Whitelist /pkg.php?xml=spamd_whitelist.xml @@ -136,11 +139,9 @@ fwrite($fd, $spamd['ip'] . "\n"); } fclose($fd); - update_output_window("Starting spamd..."); - mwexec_bg("/usr/local/etc/rc.d/spamd.sh start"); - update_output_window("done.\n"); conf_mount_ro(); config_unlock(); + restart_service("spamd"); } @@ -153,16 +154,17 @@ system("touch /var/mail/whitelist.txt 2>/dev/null"); system("/usr/libexec/spamd-setup 2>/dev/null &"); system("/usr/libexec/spamlogd 2>/dev/null &"); - $fd = fopen("/usr/local/etc/rc.d/spamd.sh","w"); - fwrite($fd, "#!/bin/sh\n\n"); - fwrite($fd, "# PACKAGE: STunnel\n"); - fwrite($fd, "# EXECUTABLE: stunnel\n"); - fwrite($fd, "/usr/bin/killall spamd-setup 2>/dev/null\n"); - fwrite($fd, "/usr/local/sbin/spamd-setup &\n"); - fwrite($fd, "/usr/local/libexec/spamlogd &\n"); - fclose($fd); - chmod("/usr/local/etc/rc.d/spamd.sh", 0755); - mwexec("/usr/local/etc/rc.d/spamd.sh"); + $start = "/usr/local/sbin/spamd-setup &\n" . + "/usr/local/libexec/spamlogd &"; + $stop = "/usr/bin/killall spamd-setup\n" . + "/usr/bin/killall spamlogd"; + write_rcfile(array( + "file" => "spamd.sh", + "start" => $start, + "stop" => $stop + ) + ); + start_service("spamd"); unlink_if_exists("/usr/local/pkg/spamd.sh"); -- cgit v1.2.3