Commit 1333e548 authored by Patrick J Cherry's avatar Patrick J Cherry
Browse files

merge

parent 952bfc4b
......@@ -10,7 +10,7 @@ XS-Ruby-Versions: all
Package: symbiosis-email
Architecture: all
Pre-Depends: dpkg (>= 1.15.7.2)
Depends: symbiosis-common (>= 2014:0113), exim4-daemon-heavy, dovecot-sieve, dovecot-managesieved, dovecot-imapd, dovecot-pop3d, adduser, make, clamav-daemon, clamav-freshclam, spamassassin, ruby, ruby-eventmachine, ${misc:Depends}
Depends: symbiosis-common (>= 2014:0113), exim4-daemon-heavy, dovecot-sieve, dovecot-managesieved, dovecot-imapd, dovecot-pop3d, adduser, make, clamav-daemon, clamav-freshclam, spamassassin, ruby, ruby-eventmachine, ruby-daemons, ${misc:Depends}
Recommends: symbiosis-webmail
Replaces: bytemark-vhost-email, symbiosis-monit (<< 2011:1206), symbiosis-test
Breaks: symbiosis-monit (<< 2011:1206)
......
......@@ -86,7 +86,7 @@ fi
#
# Restart all deamons
#
for i in spamassassin clamav-daemon exim4 dovecot; do
for i in spamassassin clamav-daemon exim4 dovecot symbiosis-email-dict-proxy; do
# spamassassin + clamav-daemon might not be installed. Wrap the invokation.
service $i restart || true
done
......
[Unit]
Description=Symbiosis: dovecot dict proxy
Description=Symbiosis: email dict proxy
[Service]
Type=simple
ExecStart=/usr/sbin/symbiosis-email-dict-proxy
ExecStart=/usr/sbin/symbiosis-email-dict-proxy --foreground
Restart=always
[Install]
Alias=symbiosis-email-dict-proxy
WantedBy=multi-user.target
......@@ -30,12 +30,14 @@ manual = help = false
opts = GetoptLong.new(
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
[ '--manual', '-m', GetoptLong::NO_ARGUMENT ],
[ '--foreground', '-f', GetoptLong::NO_ARGUMENT ],
[ '--prefix', '-p', GetoptLong::OPTIONAL_ARGUMENT ],
[ '--socket', '-s', GetoptLong::OPTIONAL_ARGUMENT ]
)
prefix = "/srv"
socket_path = "/run/dovecot/symbiosis-email-dict-proxy"
foreground = false
opts.each do |opt,arg|
case opt
......@@ -47,6 +49,8 @@ opts.each do |opt,arg|
prefix = arg
when '--socket'
socket_path = arg
when '--foreground'
foreground = true
end
end
......@@ -54,6 +58,7 @@ end
# Require these bits here, so we can generate the manpage without needing extra
# build-deps.
#
require 'daemons'
require 'eventmachine'
require 'syslog'
require 'symbiosis/utils'
......@@ -69,6 +74,11 @@ syslog = Syslog.open( File.basename($0), Syslog::LOG_NDELAY && Syslog::LOG_PERRO
Symbiosis::Email::DictHandler.prefix = prefix
Symbiosis::Email::DictHandler.syslog = syslog
#
# Make sure the parent directory is in place.
#
Symbiosis::Utils.mkdir_p(File.dirname(socket_path))
dovecot_user = Etc.getpwnam("dovecot")
systemd_socket = nil
......@@ -83,6 +93,13 @@ systemd_socket = nil
# syslog.info "Got socket #{SD_LISTEN_FDS_START + 0} from systemd"
# end
Daemons.daemonize({
:app_name => "symbiosis-email-dict-proxy",
:ontop => foreground,
:dir_mode => :system,
:log_output => false
})
EventMachine.run do
begin
if systemd_socket
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment