Skip to content
Snippets Groups Projects
Commit 3a0ce44e authored by Markus Frosch's avatar Markus Frosch
Browse files

Use correct username for service

parent 2d4827d3
Branches master
No related tags found
No related merge requests found
Pipeline #22494 failed
...@@ -3,7 +3,7 @@ Description=Icinga Certificate Monitoring Module Jobs Runner ...@@ -3,7 +3,7 @@ Description=Icinga Certificate Monitoring Module Jobs Runner
[Service] [Service]
Type=simple Type=simple
User=icingaweb2 User=apache
ExecStart=/usr/bin/icingacli x509 jobs run ExecStart=/usr/bin/icingacli x509 jobs run
Restart=on-success Restart=on-success
......
...@@ -20,6 +20,12 @@ BuildArch: noarch ...@@ -20,6 +20,12 @@ BuildArch: noarch
%global basedir %{_datadir}/icingaweb2/modules/%{module_name} %global basedir %{_datadir}/icingaweb2/modules/%{module_name}
%global service_name icinga-%{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 BuildRequires: systemd-devel
Requires: systemd Requires: systemd
...@@ -58,6 +64,9 @@ cp -r * %{buildroot}%{basedir} ...@@ -58,6 +64,9 @@ cp -r * %{buildroot}%{basedir}
install -d %{buildroot}%{_unitdir} install -d %{buildroot}%{_unitdir}
install -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{service_name}.service 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" %if "%{_vendor}" == "suse"
install -d %{buildroot}%{_sbindir} install -d %{buildroot}%{_sbindir}
ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{service_name} ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{service_name}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment