X-Git-Url: http://git.onelab.eu/?p=sliceimage.git;a=blobdiff_plain;f=lxc-sliceimage.spec;h=d7af545d839e9aa413991d083857532d044f8400;hp=a723e66c073997719cf12ab3e24d8283b010f2a7;hb=HEAD;hpb=dc42ef1a0dbcbc994a3dc7c31b939c5339396744 diff --git a/lxc-sliceimage.spec b/lxc-sliceimage.spec index a723e66..d7af545 100644 --- a/lxc-sliceimage.spec +++ b/lxc-sliceimage.spec @@ -1,6 +1,6 @@ %define name lxc-sliceimage %define version 5.1 -%define taglevel 4 +%define taglevel 12 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}} @@ -19,6 +19,7 @@ Group: Applications/System BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Requires: btrfs-progs Requires: nodemanager-lxc >= 5.2-3 +Requires: systemd BuildArch: noarch %description @@ -31,7 +32,8 @@ A simple package to deploy reference images for lxc %install rm -rf $RPM_BUILD_ROOT -install -D -m 755 initscripts/lxc-sliceimage ${RPM_BUILD_ROOT}/%{_initrddir}/lxc-sliceimage +install -D -m 755 bin/lxc-sliceimage ${RPM_BUILD_ROOT}/%{_bindir}/lxc-sliceimage +install -D -m 644 systemd/lxc-sliceimage.service ${RPM_BUILD_ROOT}/usr/lib/systemd/system/lxc-sliceimage.service install -D -m 644 cron.d/lxc-sliceimage $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/lxc-sliceimage install -D -m 644 logrotate/lxc-sliceimage $RPM_BUILD_ROOT/%{_sysconfdir}/logrotate.d/lxc-sliceimage install -D -m 644 lxc_template.xml $RPM_BUILD_ROOT/vservers/.lvref/lxc_template.xml @@ -40,15 +42,25 @@ install -D -m 644 lxc_template.xml $RPM_BUILD_ROOT/vservers/.lvref/lxc_template. rm -rf $RPM_BUILD_ROOT %files -%{_initrddir}/lxc-sliceimage +%{_bindir}/lxc-sliceimage +/usr/lib/systemd/system/lxc-sliceimage.service %{_sysconfdir}/cron.d/lxc-sliceimage %{_sysconfdir}/logrotate.d/lxc-sliceimage /vservers/.lvref +# observed on a f23 node on jan-15-2016 +# it feels like this call to restarting the service does not trigger +# or not reliably +# the daily crontab job should save the day though +# also just in case, we don't anymore disable the service when uninstalling either %post -chkconfig --add lxc-sliceimage -chkconfig lxc-sliceimage on -# Randomize daily run time +systemctl enable lxc-sliceimage.service +if [ "$PL_BOOTCD" != "1" ] ; then + systemctl restart lxc-sliceimage.service +fi + +# Randomize hourly run time (used to be daily) +#H=$((24 * $RANDOM / 32768)) +#sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" %{_sysconfdir}/cron.d/lxc-sliceimage M=$((60 * $RANDOM / 32768)) -H=$((24 * $RANDOM / 32768)) -sed -i -e "s/@M@/$M/" -e "s/@H@/$H/" %{_sysconfdir}/cron.d/lxc-sliceimage +sed -i -e "s/@M@/$M/" %{_sysconfdir}/cron.d/lxc-sliceimage