[rpld: 4/4] Add systemd service
Paul Komkoff
stingray at fedoraproject.org
Thu Jun 2 19:26:55 UTC 2011
commit df9d0b7911d2343ee2c1bbbcedfcb984ace6e9d0
Author: Paul P. Komkoff Jr <i at stingr.net>
Date: Thu Jun 2 23:24:28 2011 +0400
Add systemd service
rpld.init | 7 +++----
rpld.service | 10 ++++++++++
rpld.spec | 9 ++++++++-
rpld.sysconfig | 2 +-
4 files changed, 22 insertions(+), 6 deletions(-)
---
diff --git a/rpld.init b/rpld.init
index c3626f0..772854c 100644
--- a/rpld.init
+++ b/rpld.init
@@ -15,11 +15,10 @@
# Get network config
. /etc/sysconfig/network
+RPLDOPTS=
+
# Get service config
[ -f /etc/sysconfig/rpld ] && . /etc/sysconfig/rpld
-if [ "${INTERFACE}" != "" ]; then
- OPTS=" -i $INTERFACE"
-fi
# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 1
@@ -31,7 +30,7 @@ lockfile="/var/lock/subsys/rpld"
start() {
echo -n $"Starting $prog: "
- daemon --pidfile $pidfile $prog $OPTS
+ daemon --pidfile $pidfile $prog $RPLDOPTS
RETVAL=$?
echo
if [ $RETVAL -eq 0 ]; then
diff --git a/rpld.service b/rpld.service
new file mode 100644
index 0000000..61d48f4
--- /dev/null
+++ b/rpld.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=RPL/RIPL remote boot server
+Requires=network.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+EnvironmentFile=/etc/sysconfig/rpld
+ExecStart=/usr/sbin/rpld -f $RPLDOPTS
diff --git a/rpld.spec b/rpld.spec
index eab8e80..2c2e3bb 100644
--- a/rpld.spec
+++ b/rpld.spec
@@ -1,6 +1,6 @@
Name: rpld
Version: 1.8
-Release: 0.8.beta1%{?dist}
+Release: 0.9.beta1%{?dist}
Summary: RPL/RIPL remote boot daemon
Group: System Environment/Daemons
# No version specified.
@@ -9,6 +9,7 @@ URL: http://gimel.esc.cam.ac.uk/james/rpld/index.html
Source0: http://gimel.esc.cam.ac.uk/james/rpld/src/rpld-1.8-beta-1.tar.gz
Source1: %{name}.init
Source2: %{name}.sysconfig
+Source3: %{name}.service
Patch0: rpld_1.8beta1-6.diff.gz
Patch1: rpld-1.8-makefile.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@@ -47,6 +48,8 @@ install -d $RPM_BUILD_ROOT%{_initrddir}
install -m 0755 %SOURCE1 $RPM_BUILD_ROOT%{_initrddir}/%{name}
install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
install -m 0644 %SOURCE2 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
+install -d $RPM_BUILD_ROOT%/lib/systemd/system
+install -m 0644 %SOURCE3 $RPM_BUILD_ROOT%/lib/systemd/system/%{name}.service
%clean
rm -rf $RPM_BUILD_ROOT
@@ -58,8 +61,12 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man[^3]/*
%{_initrddir}/%{name}
%{_sysconfdir}/sysconfig/%{name}
+/lib/systemd/system/%{name}.service
%changelog
+* Thu Jun 2 2011 Paul P. Komkoff Jr <i at stingr.net> - 1.8-0.9.beta1
+- add systemd service file
+
* Thu Jun 2 2011 Paul P. Komkoff Jr <i at stingr.net> - 1.8-0.8.beta1
- add initscript
diff --git a/rpld.sysconfig b/rpld.sysconfig
index 1de7d76..a0687b0 100644
--- a/rpld.sysconfig
+++ b/rpld.sysconfig
@@ -1,4 +1,4 @@
# Config file for rpld initscript
#
# Uncomment the following line to specify the interface.
-# INTERFACE="em1"
+# RPLDOPTS="-I em1"
More information about the scm-commits
mailing list