Package: imapproxy
Version: 1.2.8~svn20161210-2
Severity: grave
Quack,
The server does not start. Trying to restart it does not change
anything. Here is the systemd status:
----------------------------------------------------------------------------
# systemctl status imapproxy
● imapproxy.service - IMAP proxy
Loaded: loaded (/lib/systemd/system/imapproxy.service; static; vendor
preset: enabled)
Active: inactive (dead)
Docs: man:imapproxyd(8)
Jul 12 14:32:49 Orfeo in.imapproxyd[18803]: main(): Internal admin
commands are disabled
Jul 12 14:32:49 Orfeo in.imapproxyd[18803]: main(): Allocating 3072 IMAP
connection structures.
Jul 12 14:32:49 Orfeo in.imapproxyd[18803]: main(): Enabling openssl
library.
Jul 12 14:32:49 Orfeo in.imapproxyd[18803]: Initialising 1
pthread_mutexes
Jul 12 14:32:49 Orfeo in.imapproxyd[18803]: ServerInit(): Using
'/var/log/imapproxy_protocol.log' for global protocol logging file.
Jul 12 14:32:49 Orfeo in.imapproxyd[18803]: ServerInit(): proxying to
IMAP server 'localhost'.
Jul 12 14:32:49 Orfeo in.imapproxyd[18803]: ServerInit(): Proxying to
IMAP port 143
Jul 12 14:32:49 Orfeo in.imapproxyd[18803]: ParseBannerAndCapability:
Attempting to parse capability string: * OK [CAPABILITY IMAP4rev1
LITERAL+ SA
Jul 12 14:32:49 Orfeo in.imapproxyd[18803]: [238B blob data]
Jul 12 14:32:49 Orfeo systemd[1]: Started IMAP proxy.
----------------------------------------------------------------------------
The service is marked as "static", which is wrong in this case IIUC.
Interestingly:
----------------------------------------------------------------------------
# systemctl enable imapproxy
Synchronizing state of imapproxy.service with SysV service script with
/lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable imapproxy
The unit files have no installation config (WantedBy, RequiredBy, Also,
Alias
settings in the [Install] section, and DefaultInstance for template
units).
This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another
unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which
has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path,
timer,
D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
instance name specified.
----------------------------------------------------------------------------
There is indeed not [Install] section. If I add one with
"WantedBy=multi-user.target" I can enable the service but still it does
not start properly.
But if I use the init script directly it starts fine (and the service
works fine too, so the config is all right):
----------------------------------------------------------------------------
# /etc/init.d/imapproxy start
Starting imapproxy (via systemctl): imapproxy.service.
# /etc/init.d/imapproxy status
● imapproxy.service - IMAP proxy
Loaded: loaded (/lib/systemd/system/imapproxy.service; enabled;
vendor preset: enabled)
Active: active (running) since Wed 2017-07-12 14:40:25 CEST; 2min 37s
ago
Docs: man:imapproxyd(8)
Process: 19772 ExecStart=/usr/sbin/imapproxyd -f /etc/imapproxy.conf
(code=exited, status=0/SUCCESS)
Process: 19766 ExecStartPre=/usr/share/imapproxy/prepare-chroot
(code=exited, status=0/SUCCESS)
Main PID: 19776 (imapproxyd)
Tasks: 2 (limit: 4915)
Memory: 1.6M
CPU: 19ms
CGroup: /system.slice/imapproxy.service
└─19776 /usr/sbin/imapproxyd -f /etc/imapproxy.conf
Jul 12 14:40:25 Orfeo in.imapproxyd[19772]: ServerInit(): proxying to
IMAP server 'localhost'.
Jul 12 14:40:25 Orfeo in.imapproxyd[19772]: ServerInit(): Proxying to
IMAP port 143
Jul 12 14:40:25 Orfeo in.imapproxyd[19772]: ParseBannerAndCapability:
Attempting to parse capability string: * OK [CAPABILITY IMAP4rev1 …cot
ready.
Jul 12 14:40:25 Orfeo in.imapproxyd[19772]: [238B blob data]
Jul 12 14:40:25 Orfeo systemd[1]: Started IMAP proxy.
Jul 12 14:40:25 Orfeo in.imapproxyd[19776]: BecomeNonRoot(): Process
will run as uid 65534 (nobody) and gid 65534 (nogroup).
Jul 12 14:40:25 Orfeo in.imapproxyd[19776]: BecomeNonRoot(): Process
chrooted in /var/lib/imapproxy/chroot
Jul 12 14:40:25 Orfeo in.imapproxyd[19776]: BecomeNonRoot(): enabled
no_new_privs
Jul 12 14:40:25 Orfeo in.imapproxyd[19776]: main(): Launched ICC recycle
thread with id 140509281154816
Jul 12 14:40:25 Orfeo in.imapproxyd[19776]: main(): imapproxy version
1.2.8 [SVN] normal server startup.
Hint: Some lines were ellipsized, use -l to show in full.
----------------------------------------------------------------------------
In the end, with the following patch it works fine:
----------------------------------------------------------------------------
--- imapproxy.service.orig 2017-07-12 14:57:35.000000000 +0200
+++ /lib/systemd/system/imapproxy.service 2017-07-12
14:50:15.000000000 +0200
@@ -8,3 +8,8 @@
Type=forking
ExecStartPre=/usr/share/imapproxy/prepare-chroot
ExecStart=/usr/sbin/imapproxyd -f /etc/imapproxy.conf
+PIDFile=/run/imapproxy.pid
+
+[Install]
+WantedBy=multi-user.target
+
----------------------------------------------------------------------------
Regards.
--
Marc Dequènes