]> git.pld-linux.org Git - packages/nginx.git/commitdiff
Set up the 'nginx.service' systemd unit alias
authorJacek Konieczny <j.konieczny@eggsoft.pl>
Mon, 14 Oct 2013 10:22:36 +0000 (12:22 +0200)
committerJacek Konieczny <jajcus@jajcus.net>
Mon, 14 Oct 2013 10:22:36 +0000 (12:22 +0200)
This makes 'service nginx status' and similar calls useful,
while keeping the standard/light/perl/mail service separation.

This alias will be set up when nginx-standard is installed, but may be
manually changed to point to any of the other variants.

nginx.spec

index 12abec6f6d734ddbf43d2f50dbfeec5149002de1..be338edb173717ffccb04d68e97106a8d5b61835 100644 (file)
@@ -380,7 +380,7 @@ install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
        $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
        $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
        $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
-       $RPM_BUILD_ROOT%{systemdunitdir}
+       $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
 
 install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
 install conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
@@ -397,6 +397,7 @@ install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
 install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
 install %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
+ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
 
 %if %{with light}
 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
@@ -451,6 +452,9 @@ done
 %systemd_post %{name}-standard.service
 %service %{name}-standard restart
 echo 'NOTE: daemon is now using "/etc/nginx/nginx-standard.conf" as config.'
+if ! [ -L /etc/systemd/system/nginx.service ] ; then
+       ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
+fi
 
 %post light
 for a in access.log error.log; do
@@ -574,6 +578,7 @@ fi
 %attr(750,nginx,logs) /var/log/%{name}
 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
+%ghost /etc/systemd/system/nginx.service
 
 %files standard
 %defattr(644,root,root,755)
This page took 0.047668 seconds and 4 git commands to generate.