mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-11-29 18:37:41 +08:00
调整acl 支持systemd的master.service,请check下
This commit is contained in:
parent
f496ab0202
commit
8fdcf2d139
@ -210,3 +210,10 @@ frame_release:centos7.2:
|
||||
"docker-registry.qiyi.virtual/acl/centos-builder:7.2"
|
||||
}
|
||||
<<: *FRAME_RELEASE
|
||||
|
||||
frame_release:centos8.2:
|
||||
variables: {
|
||||
BUILDIMAGES:
|
||||
"docker-registry.qiyi.virtual/acl/centos-builder:8.2"
|
||||
}
|
||||
<<: *FRAME_RELEASE
|
||||
|
4
dist/master/init.d/master
vendored
4
dist/master/init.d/master
vendored
@ -29,8 +29,8 @@ LOG_PATH=$HOME_PATH/var/log/acl_master
|
||||
lockfile=/var/lock/subsys/acl_master
|
||||
|
||||
# Source function library.
|
||||
# don't use systemd --zsx
|
||||
SYSTEMCTL_SKIP_REDIRECT=1
|
||||
# use systemd
|
||||
# SYSTEMCTL_SKIP_REDIRECT=1
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
# A function to find the pid of a program. Looks *only* at the pidfile
|
||||
|
2
dist/master/setup.sh
vendored
2
dist/master/setup.sh
vendored
@ -146,6 +146,7 @@ CONF_PATH=$PREFIX_PATH$INSTALL_PATH/conf
|
||||
SERVICE_PATH=$PREFIX_PATH$INSTALL_PATH/conf/service
|
||||
LIBEXEC_PATH=$PREFIX_PATH$INSTALL_PATH/libexec
|
||||
INIT_PATH=$PREFIX_PATH/etc/init.d/
|
||||
SYSTEMD_INIT_PATH=$PREFIX_PATH/usr/lib/systemd/system/
|
||||
SH_PATH=$PREFIX_PATH$INSTALL_PATH/sh
|
||||
VAR_PATH=$PREFIX_PATH$INSTALL_PATH/var
|
||||
|
||||
@ -187,6 +188,7 @@ copy_all_file()
|
||||
install_file a+x,go-wrx conf/service $SERVICE_PATH
|
||||
# install_file a+x,go-wrx conf/service/samples $SERVICE_PATH/samples
|
||||
install_file a+x,go-wrx init.d/ $INIT_PATH
|
||||
install_file a-x,go-wx system/ $SYSTEMD_INIT_PATH
|
||||
}
|
||||
|
||||
guess_os
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Summary: acl master framework
|
||||
Name: acl-master
|
||||
Version: 3.5.3
|
||||
Version: 3.5.4
|
||||
Release: %{release_id}
|
||||
Group: System Environment/Tools
|
||||
License: IBM
|
||||
@ -32,23 +32,37 @@ make install_master DESTDIR=$RPM_BUILD_ROOT
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%post
|
||||
/sbin/chkconfig --add master
|
||||
if [ "$1" == "1" ]; then
|
||||
echo "starting acl_master ..."
|
||||
service master start > /dev/null 2>&1 ||:
|
||||
%if 0%{?el7:1} || 0%{?el8:1}
|
||||
systemctl enable master.service > /dev/null 2>&1 || :
|
||||
systemctl start master.service > /dev/null 2>&1 || :
|
||||
%else
|
||||
/sbin/chkconfig --add master
|
||||
service master start > /dev/null 2>&1 ||:
|
||||
%endif
|
||||
fi
|
||||
|
||||
%preun
|
||||
if [ "$1" == "0" ]; then
|
||||
service master stop >/dev/null 2>&1 ||:
|
||||
/sbin/chkconfig --del master
|
||||
%if 0%{?el7:1} || 0%{?el8:1}
|
||||
systemctl stop master.service > /dev/null 2>&1 || :
|
||||
systemctl disable master.service > /dev/null 2>&1 || :
|
||||
%else
|
||||
service master stop >/dev/null 2>&1 ||:
|
||||
/sbin/chkconfig --del master
|
||||
%endif
|
||||
fi
|
||||
|
||||
%postun
|
||||
if [ "$1" -ge "1" ]; then
|
||||
# TODO: upgrade should be support
|
||||
echo "prepare restarting acl_master ..."
|
||||
service master masterrestart > /dev/null 2>&1 ||:
|
||||
%if 0%{?el7:1} || 0%{?el8:1}
|
||||
systemctl restart master.service > /dev/null 2>&1 || :
|
||||
%else
|
||||
service master masterrestart > /dev/null 2>&1 ||:
|
||||
%endif
|
||||
fi
|
||||
|
||||
%files
|
||||
@ -61,8 +75,13 @@ fi
|
||||
/opt/soft/acl-master/sh
|
||||
/opt/soft/acl-master/var
|
||||
/etc/init.d/master
|
||||
%if 0%{?el7:1} || 0%{?el8:1}
|
||||
/usr/lib/systemd/system/master.service
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Mon Jun 13 2022 shuxin.zheng@qq.com 3.5.4-0-20220613.18
|
||||
- feature: acl_master support master.service
|
||||
|
||||
* Wed Jun 01 2022 shuxin.zheng@qq.com 3.5.3-0-20220601.20
|
||||
- feature: acl_master can manage service not written by acl libs
|
||||
|
Loading…
Reference in New Issue
Block a user