Skip to content

Commit cee4ed9

Browse files
committed
first Release
0 parents  commit cee4ed9

File tree

7 files changed

+80
-0
lines changed

7 files changed

+80
-0
lines changed

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
NAME=oc-sd-optimizations
2+
VERSION=0.01
3+
MAINTAINER='Artur Balanuta'
4+
DEPS := rsyslog
5+
WORK_DIR=src
6+
ARCH=all
7+
8+
DESCRIPTION='OpenChirp.io SD card Optimizations'
9+
10+
POSTINSTALL_SCRIPT=deb/post-install.sh
11+
PREINSTALL_SCRIPT=deb/pre-install.sh
12+
POSTUNINSTALL_SCRIPT=deb/post-uninstall.sh
13+
14+
COMMON_FPM_ARGS=\
15+
--log error \
16+
-C $(WORK_DIR) \
17+
--name $(NAME) \
18+
--version $(VERSION) \
19+
--maintainer $(MAINTAINER) \
20+
--description $(DESCRIPTION) \
21+
--config-files /etc/cron.d/00-oc-logrotate \
22+
--config-files /etc/logrotate.d/rsyslog \
23+
--after-install $(POSTINSTALL_SCRIPT) \
24+
--before-install $(PREINSTALL_SCRIPT) \
25+
--after-remove $(POSTUNINSTALL_SCRIPT) \
26+
--verbose
27+
28+
29+
30+
.PHONY: package
31+
package:
32+
fpm -s dir -t deb -a $(ARCH) $(COMMON_FPM_ARGS) $(foreach dep,$(DEPS),-d $(dep))
33+
mv $(NAME)_$(VERSION)_*.deb build/
1.63 KB
Binary file not shown.

deb/post-install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
systemctl restart cron.service

deb/post-uninstall.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dpkg-divert --package oc-sd-optimizations --remove --rename /etc/logrotate.d/rsyslog
2+
systemctl restart cron.service

deb/pre-install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dpkg-divert --package oc-sd-optimizations --add --rename /etc/logrotate.d/rsyslog

src/etc/cron.d/00-oc-logrotate

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#Ensure logrotate is run every 5 mins.
2+
*/5 * * * * root /etc/cron.daily/logrotate >> /dev/null

src/etc/logrotate.d/rsyslog

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/var/log/mail.info
2+
/var/log/mail.warn
3+
/var/log/mail.err
4+
/var/log/mail.log
5+
/var/log/kern.log
6+
/var/log/auth.log
7+
/var/log/user.log
8+
/var/log/lpr.log
9+
/var/log/cron.log
10+
/var/log/debug
11+
/var/log/messages
12+
{
13+
size 100k
14+
rotate 0
15+
missingok
16+
notifempty
17+
copytruncate
18+
compress
19+
delaycompress
20+
sharedscripts
21+
postrotate
22+
invoke-rc.d rsyslog rotate > /dev/null
23+
endscript
24+
}
25+
26+
27+
/var/log/syslog
28+
/var/log/daemon.log
29+
{
30+
size 10M
31+
rotate 0
32+
missingok
33+
notifempty
34+
copytruncate
35+
compress
36+
delaycompress
37+
sharedscripts
38+
postrotate
39+
invoke-rc.d rsyslog rotate > /dev/null
40+
endscript
41+
}

0 commit comments

Comments
 (0)