[yaws/epel7] Add yaws.service back for backward compatibility

Antoine Catton acatton at fedoraproject.org
Sun Dec 7 06:32:37 UTC 2014


commit 63b8b09b139b633e86d0251f185947fcf780581d
Author: Antoine Catton <devel at antoine.catton.fr>
Date:   Sat Dec 6 21:00:38 2014 -0700

    Add yaws.service back for backward compatibility

 yaws.service |   17 +++++++++++++++++
 yaws.spec    |    6 ++++++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/yaws.service b/yaws.service
new file mode 100644
index 0000000..5c0ff89
--- /dev/null
+++ b/yaws.service
@@ -0,0 +1,17 @@
+# REMOVEME: This file is only for backward compatibility
+# REMOVEME: It should be remove for releases after epel7
+[Unit]
+Description=The Yaws Web Server instance
+After=network.target
+
+[Service]
+User=root
+Type=notify
+Environment="HOME=/var/lib/yaws"
+Type=simple
+ExecStart=/usr/bin/yaws --erlarg -noinput --daemon --conf /etc/yaws/.conf
+ExecReload=/usr/bin/yaws --hup
+ExecStop=/usr/bin/yaws --stop
+
+[Install]
+WantedBy=multi-user.target
diff --git a/yaws.spec b/yaws.spec
index aa50c94..d678d82 100644
--- a/yaws.spec
+++ b/yaws.spec
@@ -15,6 +15,7 @@ URL:            http://yaws.hyber.org/
 Source0:        http://yaws.hyber.org/download/%{name}-%{version}.tar.gz
 Source1:        yaws.logrotate
 Source2:        yaws at .service
+Source3:        yaws.service
 Patch1:         yaws-1.98-fhs.patch
 Patch2:         yaws-1.98-conf.patch
 
@@ -107,6 +108,10 @@ install -p -m0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/yaws
 mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
 cp -p %{SOURCE2} $RPM_BUILD_ROOT/%{_unitdir}
 
+# Backward compatibility: keep "systemctl start yaws"
+# This should be removed in the future
+install -p -m0644 %{SOURCE3} $RPM_BUILD_ROOT/%{_unitdir}/yaws.service
+
 
 %post
 %systemd_post yaws at yaws.service
@@ -124,6 +129,7 @@ cp -p %{SOURCE2} $RPM_BUILD_ROOT/%{_unitdir}
 %defattr(-,root,root,-)
 %exclude %{_initrddir}/yaws
 %{_unitdir}/yaws at .service
+%{_unitdir}/yaws.service
 %dir %{_sysconfdir}/yaws
 %config(noreplace) %{_sysconfdir}/yaws/yaws.conf
 %config(noreplace) %{_sysconfdir}/logrotate.d/yaws


More information about the scm-commits mailing list