Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
571f69db
Commit
571f69db
authored
Jul 02, 2018
by
Fidel Rodriguez Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logrotate: add logrotate daemon with crond
parent
df5ce92a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
1 deletion
+91
-1
wrs_release_br2_config
configs/buildroot/wrs_release_br2_config
+1
-1
root
userspace/rootfs_override/etc/cron/root
+1
-0
crond
userspace/rootfs_override/etc/init.d/crond
+75
-0
logrotate.conf
userspace/rootfs_override/etc/logrotate.conf
+12
-0
K30crond
userspace/rootfs_override/etc/rcS/K30crond
+1
-0
S95crond
userspace/rootfs_override/etc/rcS/S95crond
+1
-0
No files found.
configs/buildroot/wrs_release_br2_config
View file @
571f69db
...
...
@@ -2463,7 +2463,7 @@ BR2_PACKAGE_BASH=y
# BR2_PACKAGE_GNUPG2 is not set
# BR2_PACKAGE_INOTIFY_TOOLS is not set
# BR2_PACKAGE_LOCKFILE_PROGS is not set
# BR2_PACKAGE_LOGROTATE is not set
BR2_PACKAGE_LOGROTATE=y
# BR2_PACKAGE_LOGSURFER is not set
# BR2_PACKAGE_PINENTRY is not set
# BR2_PACKAGE_RANGER is not set
...
...
userspace/rootfs_override/etc/cron/root
0 → 100644
View file @
571f69db
*/10 * * * * logrotate /etc/logrotate.conf
userspace/rootfs_override/etc/init.d/crond
0 → 100755
View file @
571f69db
#!/bin/sh
#
# Load/Unload the crond daemon service
#
#
COUNTER_FILE
=
"/tmp/start_cnt_crond"
DAEMON_EXEC
=
/usr/sbin/crond
DAEMON_PID
=
/var/run/crond.pid
DAEMON_NAME
=
"crond"
DAEMON_ARGS
=
"-b -c /etc/cron "
start_counter
()
{
# increase boot counter
START_COUNTER
=
1
if
[
-f
"
$COUNTER_FILE
"
]
;
then
read
-r
START_COUNTER <
$COUNTER_FILE
START_COUNTER
=
$((
START_COUNTER+1
))
fi
echo
"
$START_COUNTER
"
>
$COUNTER_FILE
}
start
()
{
echo
-n
"Starting
${
DAEMON_NAME
}
daemon: "
# note start-stop-daemon does not create pidfile, only check if pid is
# running
start-stop-daemon
-q
-p
${
DAEMON_PID
}
-S
\
--exec
${
DAEMON_EXEC
}
--
${
DAEMON_ARGS
}
ret
=
$?
if
[
$ret
-eq
0
]
;
then
start_counter
echo
"OK"
elif
[
$ret
-eq
1
]
;
then
echo
"Failed (already running?)"
else
echo
"Failed"
fi
}
stop
()
{
echo
-n
"Stopping
${
DAEMON_NAME
}
daemon: "
start-stop-daemon
-K
-q
-p
${
DAEMON_PID
}
if
[
$?
-eq
0
]
;
then
echo
"OK"
else
echo
"Failed"
fi
}
restart
()
{
stop
start
}
case
"
$1
"
in
start
)
start
;;
stop
)
stop
;;
restart|reload
)
restart
;;
*
)
echo
-e
"Usage:
$0
{start|force-start|stop|restart}
\n
"
exit
1
esac
exit
$?
userspace/rootfs_override/etc/logrotate.conf
0 → 100644
View file @
571f69db
include
/
etc
/
logrotate
.
d
create
rotate
3
/
var
/
log
/*.
log
{
su
root
root
size
5
M
copytruncate
compress
}
userspace/rootfs_override/etc/rcS/K30crond
0 → 120000
View file @
571f69db
../init.d/crond
\ No newline at end of file
userspace/rootfs_override/etc/rcS/S95crond
0 → 120000
View file @
571f69db
../init.d/crond
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment