Skip to content

Commit

Permalink
Linux: Add systemd system sevice template unit
Browse files Browse the repository at this point in the history
Signed-off-by: Björn Bidar <[email protected]>
  • Loading branch information
Thaodan committed Oct 27, 2022
1 parent f462641 commit 0a29296
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions davmail.spec
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications/ src/desktop/
install -m 0775 src/init/davmail-wrapper $RPM_BUILD_ROOT%{_localstatedir}/lib/davmail/davmail
%if %systemd_support
install -D -m 644 src/init/davmail.service %{buildroot}%{_unitdir}/davmail.service
install -D -m 644 src/init/[email protected] %{buildroot}%{_unitdir}/[email protected]
install -D -m 644 src/init/davmail-user.service %{buildroot}%{_userunitdir}/davmail.service
install -D -m 644 src/init/daivmail.conf %{buildroot}%{_tmpfilesdir}/davmail.conf
%else
Expand Down Expand Up @@ -228,6 +229,7 @@ fi
- Add systemd unit for systemd --user instance
- Create initial log file with systemd-tmpfiles
- Harden systemd service
- Add systemd system sevice template unit

* Wed Jul 07 2021 Michal Suchanek <[email protected]>
- Tumbleweed no longer supports init.d services and fails build when installed
Expand Down
21 changes: 21 additions & 0 deletions src/init/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Unit]
Description=Davmail Exchange gateway for %i
Documentation=http://davmail.sourceforge.net/serversetup.html
Documentation=http://davmail.sourceforge.net/advanced.html
Documentation=http://davmail.sourceforge.net/sslsetup.html
After=network.target

[Service]
Type=simple
User=davmail
PermissionsStartOnly=true
AmbientCapabilities=CAP_NET_BIND_SERVICE
ExecStart=/usr/bin/davmail -server /etc/davmail/%i.properties
SuccessExitStatus=143
PrivateTmp=yes
ProtectSystem=full
ProtectHome=yes

[Install]
WantedBy=multi-user.target
DefaultInstance=davmail

0 comments on commit 0a29296

Please sign in to comment.