-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rpm/deb packaging in systemd files + rename lsc and lsc-oneshot s…
…ervices and corresponding default files (#50)
- Loading branch information
David Coutadeur
committed
Jan 12, 2024
1 parent
527a318
commit 6b9afd7
Showing
12 changed files
with
65 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
8 | ||
11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,21 @@ | |
dh $@ | ||
|
||
override_dh_compress: | ||
|
||
override_dh_testdir: | ||
## systemd | ||
cp -f lib/systemd/system/lsc-async.service debian/ | ||
cp -f lib/systemd/system/[email protected] debian/ | ||
cp -f lib/systemd/system/lsc-sync.service debian/ | ||
cp -f lib/systemd/system/lsc-sync.timer debian/ | ||
cp -f lib/systemd/system/[email protected] debian/ | ||
cp -f etc/default/lsc-async debian/lsc-async.default | ||
cp -f etc/default/lsc-sync debian/lsc-sync.default | ||
dh_testdir | ||
|
||
override_dh_installsystemd: | ||
dh_installsystemd --no-start --no-enable --no-stop-on-upgrade --name=lsc-async | ||
dh_installsystemd --no-start --no-enable --no-stop-on-upgrade --name=lsc-async@ | ||
dh_installsystemd --no-start --no-enable --no-stop-on-upgrade --name=lsc-sync | ||
dh_installsystemd --no-start --no-enable --no-stop-on-upgrade --name=lsc-sync@ | ||
dh_installsystemd --name=lsc-sync.timer |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,11 @@ URL: https://lsc-project.org | |
Source: %{lsc_name}-core-%{lsc_version}-dist.zip | ||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) | ||
|
||
%if 0%{?fedora}%{?el9} | ||
BuildRequires: systemd-rpm-macros | ||
%else | ||
BuildRequires: systemd | ||
%endif | ||
Requires(pre): coreutils | ||
Requires: which | ||
|
||
|
@@ -69,6 +74,8 @@ mkdir -p %{buildroot}/etc/default | |
mkdir -p %{buildroot}/usr/share/doc/lsc/bin | ||
mkdir -p %{buildroot}%{lsc_logdir} | ||
mkdir -p %{buildroot}/var/lib/lsc/nagios | ||
mkdir -p %{buildroot}%{_unitdir} | ||
mkdir -p %{buildroot}%{_sysconfdir}/default | ||
|
||
# Copy files | ||
## bin | ||
|
@@ -92,6 +99,14 @@ cp -a etc/cron.d/lsc.cron %{buildroot}/etc/cron.d/lsc | |
## init | ||
cp -a etc/init.d/lsc %{buildroot}/etc/init.d/lsc | ||
cp -a etc/default/lsc %{buildroot}/etc/default/lsc | ||
## systemd | ||
cp -a etc/default/lsc-async %{buildroot}%{_sysconfdir}/default/lsc-async | ||
cp -a etc/default/lsc-sync %{buildroot}%{_sysconfdir}/default/lsc-sync | ||
install -p -m 0644 lib/systemd/system/lsc-async.service %{buildroot}%{_unitdir}/ | ||
install -p -m 0644 lib/systemd/system/[email protected] %{buildroot}%{_unitdir}/ | ||
install -p -m 0644 lib/systemd/system/lsc-sync.service %{buildroot}%{_unitdir}/ | ||
install -p -m 0644 lib/systemd/system/[email protected] %{buildroot}%{_unitdir}/ | ||
install -p -m 0644 lib/systemd/system/lsc-sync.timer %{buildroot}%{_unitdir}/ | ||
## nagios | ||
cp -a bin/check_lsc* %{buildroot}/var/lib/lsc/nagios | ||
|
||
|
@@ -108,23 +123,17 @@ sed -i 's:^LIB_DIR.*:LIB_DIR="/usr/%{_lib}/lsc":' %{buildroot}/usr/bin/lsc %{bui | |
sed -i 's:^LOG_DIR.*:LOG_DIR="%{lsc_logdir}":' %{buildroot}/usr/bin/lsc %{buildroot}/usr/bin/lsc-agent %{buildroot}/usr/bin/hsqldb | ||
sed -i 's:^VAR_DIR.*:VAR_DIR="/var/lsc":' %{buildroot}/usr/bin/hsqldb | ||
## init | ||
sed -i 's:^LSC_BIN.*:LSC_BIN="/usr/bin/lsc":' %{buildroot}/etc/default/lsc | ||
sed -i 's:^LSC_CFG_DIR.*:LSC_CFG_DIR="/etc/lsc":' %{buildroot}/etc/default/lsc | ||
sed -i 's:^LSC_USER.*:LSC_USER="lsc":' %{buildroot}/etc/default/lsc | ||
sed -i 's:^LSC_GROUP.*:LSC_GROUP="lsc":' %{buildroot}/etc/default/lsc | ||
sed -i 's:^LSC_PID_FILE.*:LSC_PID_FILE="/var/run/lsc.pid":' %{buildroot}/etc/default/lsc | ||
sed -i 's:^LSC_BIN.*:LSC_BIN="/usr/bin/lsc":' %{buildroot}%{_sysconfdir}/default/lsc %{buildroot}%{_sysconfdir}/default/lsc-async %{buildroot}%{_sysconfdir}/default/lsc-sync | ||
sed -i 's:^LSC_CFG_DIR.*:LSC_CFG_DIR="/etc/lsc":' %{buildroot}%{_sysconfdir}/default/lsc %{buildroot}%{_sysconfdir}/default/lsc-async %{buildroot}%{_sysconfdir}/default/lsc-sync | ||
sed -i 's:^LSC_USER.*:LSC_USER="lsc":' %{buildroot}%{_sysconfdir}/default/lsc %{buildroot}%{_sysconfdir}/default/lsc-async %{buildroot}%{_sysconfdir}/default/lsc-sync | ||
sed -i 's:^LSC_GROUP.*:LSC_GROUP="lsc":' %{buildroot}%{_sysconfdir}/default/lsc %{buildroot}%{_sysconfdir}/default/lsc-async %{buildroot}%{_sysconfdir}/default/lsc-sync | ||
sed -i 's:^LSC_PID_FILE.*:LSC_PID_FILE="/var/run/lsc.pid":' %{buildroot}%{_sysconfdir}/default/lsc %{buildroot}%{_sysconfdir}/default/lsc-async %{buildroot}%{_sysconfdir}/default/lsc-sync | ||
|
||
This comment has been minimized.
Sorry, something went wrong. |
||
%post | ||
#================================================= | ||
# Post Installation | ||
#================================================= | ||
|
||
# Do this at first install | ||
if [ $1 -eq 1 ] | ||
then | ||
# Set lsc as service | ||
/sbin/chkconfig --add lsc | ||
fi | ||
%systemd_post lsc-async.service | ||
%systemd_post [email protected] | ||
%systemd_post lsc-sync.service | ||
%systemd_post [email protected] | ||
|
||
# Always do this | ||
# Create user and group if needed | ||
|
@@ -137,6 +146,12 @@ getent passwd %{lsc_user} > /dev/null 2>&1 || useradd --system --gid %{lsc_group | |
ln -sf /usr/%{_lib}/lsc/ /usr/share/doc/lsc/%{_lib} | ||
ln -sf /usr/bin/lsc /usr/share/doc/lsc/bin/ | ||
|
||
%preun | ||
%systemd_preun lsc-async.service | ||
%systemd_preun [email protected] | ||
%systemd_preun lsc-sync.service | ||
%systemd_preun [email protected] | ||
|
||
%postun | ||
#================================================= | ||
# Post uninstallation | ||
|
@@ -167,9 +182,16 @@ rm -rf %{buildroot} | |
%config(noreplace) /etc/lsc/ | ||
%config(noreplace) /etc/cron.d/lsc | ||
%config(noreplace) /etc/default/lsc | ||
%config(noreplace) /etc/default/lsc-sync | ||
%config(noreplace) /etc/default/lsc-async | ||
/usr/bin/lsc | ||
/usr/bin/lsc-agent | ||
/usr/bin/hsqldb | ||
%{_unitdir}/lsc-async.service | ||
%{_unitdir}/[email protected] | ||
%{_unitdir}/lsc-sync.service | ||
%{_unitdir}/[email protected] | ||
%{_unitdir}/lsc-sync.timer | ||
/etc/init.d/lsc | ||
This comment has been minimized.
Sorry, something went wrong.
xavierba
Contributor
|
||
/usr/%{_lib}/lsc/ | ||
/usr/share/doc/lsc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,11 +149,11 @@ | |
<fileSet> | ||
<directory>src/install/lib/systemd/system</directory> | ||
<includes> | ||
<include>lsc.service</include> | ||
<include>[email protected]</include> | ||
<include>lsc-oneshot.service</include> | ||
<include>lsc-oneshot@.service</include> | ||
<include>lsc-oneshot.timer</include> | ||
<include>lsc-async.service</include> | ||
<include>lsc-async@.service</include> | ||
<include>lsc-sync.service</include> | ||
<include>lsc-sync@.service</include> | ||
<include>lsc-sync.timer</include> | ||
</includes> | ||
<outputDirectory>lib/systemd/system</outputDirectory> | ||
<fileMode>0644</fileMode> | ||
|
@@ -165,8 +165,8 @@ | |
<directory>src/install/etc/default</directory> | ||
<includes> | ||
<include>lsc</include> | ||
<include>lsc-examplesynctask</include> | ||
<include>lsc-exampleasynctask</include> | ||
<include>lsc-sync</include> | ||
<include>lsc-async</include> | ||
</includes> | ||
<outputDirectory>etc/default</outputDirectory> | ||
<fileMode>0644</fileMode> | ||
|
Can you please split long lines ?