Try to make this handled by systemd

private/hcvcastro/forking
Tor Lillqvist 2015-06-01 19:53:29 +03:00
parent bbf844f8da
commit 7848cca80c
3 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,13 @@
[Unit]
Description=LibreOffice On-Line WebSocket Daemon
After=network.target
[Service]
EnvironmentFile=-/etc/sysconfig/loolwsd
ExecStart=/usr/bin/loolwsd --systemplate=/opt/lool/systemplate --lotemplate=/opt/libreofficedev5.1 --childroot=/opt/lool/child-roots --numprespawns=$LOOLWSD_NUMPRESPAWNS
User=lool
KillMode=process
Restart=always
[Install]
WantedBy=multi-user.target

View File

@ -22,11 +22,14 @@ Vendor: Collabora
Summary: LibreOffice On-Line WebSocket Daemon
License: MPL
Source0: loolwsd-@PACKAGE_VERSION@.tar.gz
BuildRequires: libcap-progs libcap-devel libpng-devel poco-devel >= 1.6.0
Source1: loolwsd.service
Source2: sysconfig.loolwsd
BuildRequires: libcap-progs libcap-devel libpng-devel poco-devel >= 1.6.0 systemd-rpm-macros
# This works for now only with the TDF nightly builds of 5.0 or 5.1, I
# think. But the TDF packages include the version number in their
# names. How clever is that? So we need to specify one.
Requires: libcap libcap-progs libpng libPocoFoundation30 >= 1.6.0 libPocoNet30 >= 1.6.0 libreofficedev5.1 libreofficedev5.1-en-US libreofficedev5.1-ure lodevbasis5.1-core lodevbasis5.1-writer lodevbasis5.1-impress lodevbasis5.1-graphicfilter lodevbasis5.1-en-US lodevbasis5.1-calc lodevbasis5.1-en-US-res lodevbasis5.1-en-US-calc lodevbasis5.1-ooofonts lodevbasis5.1-images lodevbasis5.1-filter-data lodevbasis5.1-draw lodevbasis5.1-base lodevbasis5.1-en-US-writer lodevbasis5.1-en-US-math lodevbasis5.1-en-US-base Mesa-libEGL1 Mesa-libGL1 Mesa-libglapi0 cups-libs dbus-1-glib fontconfig libbz2-1 libcairo2 libdrm2 libexpat1 libfreetype6 libgbm1 libgio-2_0-0 libglib-2_0-0 libgmodule-2_0-0 libgobject-2_0-0 libgthread-2_0-0 liblzma5 libpcre1 libpixman-1-0 libpng16-16 libuuid1 libxml2-2 %{?systemd_requires}
PreReq: %{fillup_prereq}
%define owner lool
%define group lool
@ -46,13 +49,21 @@ env BUILDING_FROM_RPMBUILD=yes make check
%install
env BUILDING_FROM_RPMBUILD=yes make install DESTDIR=%{buildroot}
%__install -D -m 444 %{SOURCE1} %{buildroot}%{_unitdir}/loolwsd.service
install -d -m 755 %{buildroot}/var/adm/fillup-templates
install -D -m 644 %{SOURCE2} %{buildroot}/var/adm/fillup-templates
%files
/usr/bin/loolwsd
/usr/bin/loolwsd-systemplate-setup
%{_unitdir}/loolwsd.service
/var/adm/fillup-templates/sysconfig.loolwsd
%doc README
%pre
%service_add_pre loolwsd.service
%post
setcap cap_fowner,cap_sys_chroot=ep /usr/bin/loolwsd
@ -73,6 +84,16 @@ chown %{owner} ${loolparent}/lool/child-roots
su %{owner} -c "loolwsd-systemplate-setup ${loolparent}/lool/systemplate ${loroot} >/dev/null"
%service_add_post loolwsd.service
%{fillup_only -n loolwsd}
%preun
%service_del_preun loolwsd.service
%postun
%service_del_postun loolwsd.service
%changelog
* Tue May 19 2015 Tor Lillqvist
- Initial RPM release

View File

@ -0,0 +1,9 @@
## Path: Network/Remote access/LOOLWSD
## Description: LibreOffice On-Line WebSocket Daemon settings
## Type: string
## Default: ""
## ServiceRestart: loolwsd
#
# Number of child processes to pre-spawn initially
#
LOOLWSD_NUMPRESPAWNS="5"