Update raptor config and cronjobs

release
Eduardo Cavazos 2007-11-20 02:03:16 -06:00
parent bab5554cfe
commit a2aea6a4d1
2 changed files with 45 additions and 39 deletions

View File

@ -1,5 +1,7 @@
USING: namespaces unix.linux.if unix.linux.ifreq unix.linux.route ; USING: namespaces threads
unix.process unix.linux.if unix.linux.ifreq unix.linux.route
raptor.cron ;
IN: raptor IN: raptor
@ -24,9 +26,12 @@ IN: raptor
configure-route configure-route
] networking-hook set-global ] networking-hook set-global
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! boot-hook
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[ [
start-wait-loop
! rcS.d ! rcS.d
@ -76,11 +81,17 @@ IN: raptor
"rmnologin" start-service "rmnologin" start-service
schedule-cron-jobs schedule-cron-jobs
start-listeners
start-gettys [ [ "/dev/tty2" tty-listener ] forever ] in-thread
[ [ "/dev/tty3" tty-listener ] forever ] in-thread
[ [ "/dev/tty4" tty-listener ] forever ] in-thread
[ [ "/dev/tty5" getty ] forever ] in-thread
[ [ "/dev/tty6" getty ] forever ] in-thread
] boot-hook set-global ] boot-hook set-global
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! reboot-hook
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[ [
@ -108,6 +119,8 @@ IN: raptor
"reboot" stop-service "reboot" stop-service
] reboot-hook set-global ] reboot-hook set-global
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! shutdown-hook
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[ [

View File

@ -1,5 +1,6 @@
USING: kernel threads arrays sequences combinators.cleave raptor raptor.cron ; USING: kernel namespaces threads arrays sequences combinators.cleave
raptor raptor.cron ;
IN: raptor IN: raptor
@ -7,41 +8,33 @@ IN: raptor
: fork-exec-args-wait ( args -- ) [ first ] [ ] bi fork-exec-wait ; : fork-exec-args-wait ( args -- ) [ first ] [ ] bi fork-exec-wait ;
: run-script ( path -- ) 1array [ fork-exec-args-wait ] curry in-thread ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: cron-hourly ( -- ) ; [
"/etc/cron.daily/apt" run-script
: cron-daily ( -- ) "/etc/cron.daily/aptitude" run-script
{ "/etc/cron.daily/apt" "/etc/cron.daily/bsdmainutils" run-script
"/etc/cron.daily/aptitude" "/etc/cron.daily/find.notslocate" run-script
"/etc/cron.daily/bsdmainutils" "/etc/cron.daily/logrotate" run-script
"/etc/cron.daily/find.notslocate" "/etc/cron.daily/man-db" run-script
"/etc/cron.daily/logrotate" "/etc/cron.daily/ntp-server" run-script
"/etc/cron.daily/man-db" "/etc/cron.daily/slocate" run-script
"/etc/cron.daily/ntp-server" "/etc/cron.daily/standard" run-script
"/etc/cron.daily/slocate" "/etc/cron.daily/sysklogd" run-script
"/etc/cron.daily/standard" "/etc/cron.daily/tetex-bin" run-script
"/etc/cron.daily/sysklogd" ] cron-jobs-daily set-global
"/etc/cron.daily/tetex-bin" }
[ 1array [ fork-exec-args-wait ] in-thread drop ] each ;
: cron-weekly ( -- ) [
{ "/etc/cron.weekly/cvs" "/etc/cron.weekly/cvs" run-script
"/etc/cron.weekly/man-db" "/etc/cron.weekly/man-db" run-script
"/etc/cron.weekly/ntp-server" "/etc/cron.weekly/ntp-server" run-script
"/etc/cron.weekly/popularity-contest" "/etc/cron.weekly/popularity-contest" run-script
"/etc/cron.weekly/sysklogd" } "/etc/cron.weekly/sysklogd" run-script
[ 1array [ fork-exec-args-wait ] in-thread drop ] each ; ] cron-jobs-weekly set-global
: cron-monthly ( -- ) [
{ "/etc/cron.monthly/scrollkeeper" "/etc/cron.monthly/scrollkeeper" run-script
"/etc/cron.monthly/standard" } "/etc/cron.monthly/standard" run-script
[ 1array [ fork-exec-args-wait ] in-thread drop ] each ; ] cron-jobs-monthly set-global
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: schedule-cron-jobs ( -- )
{ 17 } f f f f <when> [ cron-hourly ] schedule
{ 25 } { 6 } f f f <when> [ cron-daily ] schedule
{ 47 } { 6 } f f { 7 } <when> [ cron-weekly ] schedule
{ 52 } { 6 } { 1 } f f <when> [ cron-monthly ] schedule ;