[Pkg-giraffe-maintainers] Bug#947040: kopano-core: PIDFILE in /etc/init.d/kopano-* does not match /etc/kopano/*.cfg

David Gabriel david.gabriel at dest-unreachable.net
Sun Jan 26 14:28:38 GMT 2020


Hi, 

Since the bug ist still present in the latest release, I have written a  
replacement systemd unit for kopano server which fixes the problem. Notsure this
will get included since the future maintenance of kopano seems
questionable regarding to the latest statements here? Anyways, this may
help out someone so I'll leave the systemd unit here for future reference.


The environment variables could be split out in a separate environment file 
("/etc/default/kopano-server" perhaps?) and included via "EnvironmentFile=" 
too I guess. 

The "CAP_NET_BIND_SERVICE" is necessary because kopano-server binds port 236. 

Unit file: 
/etc/systemd/system/kopano-server.service 

############################################################################### 
[Unit] 
Description=Kopano Server 
Before=kopano-dagent.service kopano-gateway.service kopano-ical.service kopano-
monitor.service kopano-search.service kopano-spamd.serv
ice kopano-spooler.service 
After=network.target postfix.service 

[Service] 
Type=forking 
AmbientCapabilities=CAP_NET_BIND_SERVICE 
Environment=SERVER_CONFIG="/etc/kopano/server.cfg" 
Environment=SERVER_OPTS="" 
Environment=KOPANO_USERSCRIPT_LOCALE="C" 
ExecStart=/usr/sbin/kopano-server -c ${SERVER_CONFIG} 
ExecReload=/bin/kill -s HUP $MAINPID 
ExecStop=/bin/kill -s TERM $MAINPID 
PIDFile=/run/kopano/server.pid 
TimeoutStopSec=60 
Restart=always 
User=kopano 
Group=kopano 
RuntimeDirectory=kopano 
RuntimeDirectoryMode=2755 

PrivateTmp=yes 
PrivateDevices=yes 
ProtectHome=yes 
ReadOnlyDirectories=/ 
ReadWriteDirectories=-/var/lib/kopano 
ReadWriteDirectories=-/var/log/kopano 
ReadWriteDirectories=-/run/kopano 
NoNewPrivileges=true 
ProtectSystem=full 

[Install] 
WantedBy=multi-user.target 
############################################################################### 

fyi there is more broken stuff in the kopano packages; you can check this how-
to 
for more fixes: https://wiki.dest-unreachable.net/x/SgBEAg 

greez, 
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-giraffe-maintainers/attachments/20200126/e45d4b21/attachment.html>


More information about the Pkg-giraffe-maintainers mailing list