Add logrotate service to deb/rpm slapos-node package

parent babcb576
...@@ -53,8 +53,9 @@ osc add slapos.spec ...@@ -53,8 +53,9 @@ osc add slapos.spec
# Add entry to changelog # Add entry to changelog
cd $TEMPLATES_DIRECTORY/debian cd $TEMPLATES_DIRECTORY/debian
dch -pm -v $VERSION+$RECIPE_VERSION+$RELEASE --check-dirname-level=0 "New version of slapos ($VERSION+$RECIPE_VERSION+$RELEASE)" dch -pm -v $VERSION+$RECIPE_VERSION+$RELEASE --check-dirname-level=0 "New version of slapos ($VERSION+$RECIPE_VERSION+$RELEASE)"
# Add cronfile # Add cron and logrotate files
cp $CURRENT_DIRECTORY/$SLAPOS_ORGINAL_DIRECTORY/template/slapos-node.cron.d $TEMPLATES_DIRECTORY/debian/cron.d cp $CURRENT_DIRECTORY/$SLAPOS_ORGINAL_DIRECTORY/template/slapos-node.cron.d $TEMPLATES_DIRECTORY/debian/cron.d
cp $CURRENT_DIRECTORY/$SLAPOS_ORGINAL_DIRECTORY/template/slapos-node.logrotate $TEMPLATES_DIRECTORY/debian/slapos-node.logrotate
cd $TEMPLATES_DIRECTORY cd $TEMPLATES_DIRECTORY
tar -czf debian.tar.gz debian tar -czf debian.tar.gz debian
cd $OBS_DIRECTORY cd $OBS_DIRECTORY
......
# Generated by SlapOS. Assumes that slapos is installed in default location.
/opt/slapos/slapos-software.log /opt/slapos/slapos-instance.log /opt/slapos/slapos-report.log {
compress
dateext
daily
rotate 14
missingok
notifempty
create 640 root root
sharedscripts
endscript
}
/opt/slapos/slapos-format.log {
compress
dateext
daily
rotate 100
missingok
notifempty
create 640 root root
sharedscripts
endscript
}
...@@ -65,6 +65,7 @@ binary-arch: build install ...@@ -65,6 +65,7 @@ binary-arch: build install
# dh_installmime # dh_installmime
dh_installinit dh_installinit
dh_installcron dh_installcron
dh_installlogrotate
dh_installman dh_installman
dh_installinfo dh_installinfo
# dh_undocumented # dh_undocumented
......
...@@ -86,6 +86,8 @@ cd $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_numb ...@@ -86,6 +86,8 @@ cd $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_numb
make DESTDIR=$RPM_BUILD_ROOT install make DESTDIR=$RPM_BUILD_ROOT install
mkdir -p $RPM_BUILD_ROOT/etc/cron.d/ mkdir -p $RPM_BUILD_ROOT/etc/cron.d/
cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/template/slapos-node.cron.d $RPM_BUILD_ROOT/etc/cron.d/slapos-node cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/template/slapos-node.cron.d $RPM_BUILD_ROOT/etc/cron.d/slapos-node
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d/
cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/template/slapos-node.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/slapos.logrotate.conf
mkdir -p $RPM_BUILD_ROOT/etc/systemd/system/ mkdir -p $RPM_BUILD_ROOT/etc/systemd/system/
cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/template/slapos-node.service %{buildroot}/etc/systemd/system/ cp $RPM_BUILD_DIR/slapos-node_%{unmangled_version}+%{slapversion}+%{release_number}/template/slapos-node.service %{buildroot}/etc/systemd/system/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment