Refactor patches for dnsmasq package.
Use dnsmasq-config package to add init script to system folder Remove dnsmasq-spec-add-init-script.patch. Merge spec change part in dnsmasq-spec-add-init-script.patch and src patch adding in patch-tftp-to-close-sockets-immediately.patch to spec-include-TiS-patch.patch. Deployment test and script check pass. Story: 2003768 Task: 27583 Change-Id: I4d5b78fed03961056585b8c09dc483fac3b55728 Signed-off-by: zhipengl <zhipengs.liu@intel.com>
This commit is contained in:
parent
0b09b3c482
commit
233922f892
2
dnsmasq-config/centos/build_srpm.data
Normal file
2
dnsmasq-config/centos/build_srpm.data
Normal file
@ -0,0 +1,2 @@
|
||||
SRC_DIR="files"
|
||||
TIS_PATCH_VER=1
|
30
dnsmasq-config/centos/dnsmasq-config.spec
Normal file
30
dnsmasq-config/centos/dnsmasq-config.spec
Normal file
@ -0,0 +1,30 @@
|
||||
Summary: dnsmasq-config
|
||||
Name: dnsmasq-config
|
||||
Version: 1.0
|
||||
Release: %{tis_patch_ver}%{?_tis_dist}
|
||||
License: Apache-2.0
|
||||
Group: base
|
||||
Packager: StarlingX
|
||||
URL: unknown
|
||||
BuildArch: noarch
|
||||
Source: %name-%version.tar.gz
|
||||
|
||||
Requires: dnsmasq
|
||||
Summary: package StarlingX configuration files of dnsmasq to system folder.
|
||||
|
||||
%description
|
||||
package StarlingX configuration files of dnsmasq to system folder.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/init.d
|
||||
install -m 755 init %{buildroot}%{_sysconfdir}/init.d/dnsmasq
|
||||
|
||||
%post
|
||||
|
||||
%files
|
||||
%{_sysconfdir}/init.d/dnsmasq
|
59
dnsmasq-config/files/init
Normal file
59
dnsmasq-config/files/init
Normal file
@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
if [ -f /etc/centos-release ]; then
|
||||
DAEMON=/usr/sbin/dnsmasq
|
||||
else
|
||||
DAEMON=/usr/bin/dnsmasq
|
||||
fi
|
||||
NAME=dnsmasq
|
||||
DESC="DNS forwarder and DHCP server"
|
||||
PIDFILE="/var/run/dnsmasq.pid"
|
||||
|
||||
test -f $DAEMON || exit 0
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "starting $DESC: $NAME... "
|
||||
test -d /var/lib/misc/ || mkdir /var/lib/misc/
|
||||
start-stop-daemon -S -x $DAEMON --pidfile $PIDFILE -- $ARGS
|
||||
echo "done."
|
||||
echo -n "Refresh hosts cache"
|
||||
nscd -i hosts
|
||||
echo "done."
|
||||
;;
|
||||
stop)
|
||||
echo -n "stopping $DESC: $NAME... "
|
||||
start-stop-daemon -K -x $DAEMON --pidfile $PIDFILE
|
||||
rm -f $PIDFILE
|
||||
echo "done."
|
||||
;;
|
||||
status)
|
||||
echo -n "dnsmasq "
|
||||
start-stop-daemon -q -K -t -x $DAEMON --pidfile $PIDFILE
|
||||
RET=$?
|
||||
if [ "$RET" = "0" ]; then
|
||||
PID=`cat $PIDFILE`
|
||||
echo "($PID) is running"
|
||||
else
|
||||
echo "is not running"
|
||||
# For lsb compliance return 3 if process not running
|
||||
exit 3
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
echo "restarting $DESC: $NAME... "
|
||||
$0 stop
|
||||
$0 start
|
||||
echo "done."
|
||||
;;
|
||||
reload)
|
||||
echo -n "reloading $DESC: $NAME... "
|
||||
killall -HUP $(basename ${DAEMON})
|
||||
echo "done."
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|restart|reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
x
Reference in New Issue
Block a user