Use correct username for service
This commit is contained in:
parent
20507dae4a
commit
197d3da1ca
|
@ -3,7 +3,7 @@ Description=Icinga Director Job runner
|
|||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=icingaweb2
|
||||
User=apache
|
||||
ExecStart=/usr/bin/icingacli director jobs run --forever
|
||||
Restart=on-success
|
||||
|
||||
|
|
|
@ -25,6 +25,12 @@ BuildArch: noarch
|
|||
%global basedir %{_datadir}/icingaweb2/modules/%{module_name}
|
||||
%global service_name icinga-%{module_name}
|
||||
|
||||
%if "%{_vendor}" == "suse"
|
||||
%global service_user wwwrun
|
||||
%else # suse
|
||||
%global service_user apache
|
||||
%endif # suse
|
||||
|
||||
BuildRequires: systemd-devel
|
||||
Requires: systemd
|
||||
|
||||
|
@ -59,6 +65,9 @@ cp -r * %{buildroot}%{basedir}
|
|||
install -d %{buildroot}%{_unitdir}
|
||||
install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{service_name}.service
|
||||
|
||||
# Replace user in service unit
|
||||
sed -i -e 's~^User=.*~User=%{service_user}~' %{buildroot}%{_unitdir}/%{service_name}.service
|
||||
|
||||
%if "%{_vendor}" == "suse"
|
||||
install -d %{buildroot}%{_sbindir}
|
||||
ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{service_name}
|
||||
|
|
Loading…
Reference in New Issue