Pagina 1 di 1

[Risolto]Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 12:42
da hellojoker
Mi rendo conto che a volte è difficile trovare titoli adeguati, comunque vengo al problema che in realtà problema vero non è, ho notato su oneiric che fcheck  si avvia

un po troppo frequentemente (in background), c'è un modo per variare la frequenza del controllo?

Grazie

Re: Oneiric fsck in background

Inviato: mercoledì 9 novembre 2011, 12:45
da vaillant

Codice: Seleziona tutto

sudo tune2fs -c NUMEROBOOT NUMEROPARTIZIONE
ad esempio

Codice: Seleziona tutto

sudo tune2fs -c 50 /dev/sda1
e avrai il controllo su sda1 ogni 50 avvii

Re: Oneiric fsck in background

Inviato: mercoledì 9 novembre 2011, 12:49
da hellojoker
Grazie vaillant, probabilmente mi sono espresso male, ma non mi riferivo a quello, nel senso vorrei rendere meno frequente l'avvio di fcheck  (in background) non di  fsck all'avvio

era fcheck non fsck

Re: Oneiric fsck in background

Inviato: mercoledì 9 novembre 2011, 13:42
da hellojoker
per adesso ho trovato questo file  /etc/cron.d/fcheck

Codice: Seleziona tutto

cat /etc/cron.d/fcheck 
#
# Regular cron job for the fcheck package
#
30 */2	* * *	root	test -x /usr/sbin/fcheck && if ! nice ionice -c3 /usr/sbin/fcheck -asxrf /etc/fcheck/fcheck.cfg >/var/run/fcheck.out 2>&1; then mailx -s "ALERT: [fcheck] `hostname --fqdn`" root </var/run/fcheck.out ; /usr/sbin/fcheck -cadsxlf /etc/fcheck/fcheck.cfg ; fi ; rm -f /var/run/fcheck.out
che mi ha portato a questo

Codice: Seleziona tutto

hellojoker@hellojoker-P5W-DH-Deluxe:~$ cat /etc/fcheck/fcheck.cfg 
# FCheck.cfg
#
# Directories to be monitored are shown below. Multiple entries may be used
# by using the following 'keyword=variable' format:
#
# [Directory=(path/name)]
# [Directory=(path/name)]
# ...
#
# If you want recursive direcotry monitoring, place a / at the end of
# the directory name, otherwise the script will interpret the entry as a
# single file or single directory to monitor.
#
# For example the entry "Directory=/usr"
#     will watch everything in the /usr directory
#
# and the entry "Directory=/etc/passwd"
#     will monitor only the password file.
#
# while the entry "Directory=/usr/"
#     will watch everything in the /usr directory, and everything
#     recursively under it, (I.E. /usr/bin..., /usr/local/..., etc.)
# 

Directory       = /
Directory       = /etc/
Directory       = /bin/
Directory       = /sbin/
Directory       = /lib/
Directory       = /usr/bin/
Directory       = /usr/sbin/
Directory       = /usr/lib/

# Optionally may want to add the following:
#Directory      = /usr/
#Directory      = /usr/X11R6/bin
#Directory      = /usr/X11R6/lib
#Directory      = /var/



# WARNING
# Use the following exclusions with care,
# only include log files that are constantly undating and are known to
# be written to frequently otherwise you can defeat the purpose of fcheck
# by excluding too much...
#
# Specific files, and/or directories can be excluded.
#
# If used, configure them as full paths and their filenames. Directory
# names must have a "/" appended to the end of its filename in the exclude
# section.
#

Exclusion      = /tmp/
Exclusion      = /var/
Exclusion      = /lib/udev/devices/
Exclusion      = /run/

# Other common paths you may need to exclude
#Exclusion      = /etc/mtab
#Exclusion      = /etc/resolv.conf
#Exclusion      = /etc/cups/cupsd.conf
#Exclusion      = /etc/cups/cupsd.conf.O
#Exclusion      = /etc/cups/printers.conf
#Exclusion      = /etc/cups/printers.conf.O
#Exclusion      = /etc/ld.so.cache
#Exclusion      = /etc/network/run/ifstate
#Exclusion      = /etc/adjtime
#Exclusion      = /etc/motd
#Exclusion      = /etc/default/ntpdate.dhcp
#Exclusion      = /etc/ntp.conf.dhcp
#Exclusion      = /etc/logcheck/
#Exclusion      = /etc/.bzr/
#Exclusion      = /etc/.git/
#Exclusion      = /etc/.hg/
#Exclusion      = /etc/.etckeeper
#Exclusion      = /etc/.gitignore


# Miscellaneous settings are passed to fcheck from here.
#
# The "DataBase" keyword points to the absolute path/filename of the baseline
# database file, and is defined next.
#
DataBase        = /var/lib/fcheck/fcheck.dbf



# If you are using a read-only location. You can write the database files to
# one location, and read from an alternate read-only (CD-ROM?) location.
#ReadDB          = /usr/local/data/fcheck.dbf
#WriteDB         = /usr/local/data/fcheck.dbf



# Your systems interface for passing messages to its log files, UNIX systems
# are typically found as "/usr/bin/logger".
#
# You could also send messages directly to a line printer if desired.
#
# Win32 platforms are forced to use line printers for now until a error
# logging module is created for NT platforms.
#
#Logger          = /usr/bin/lpr
#
# As of version 2.7.50, you pass logger taglines (-t) options through here.
# Any other options can now be passed to third party loggers, scripts, etc.
Logger          = /usr/bin/logger -tfcheck

#AuthLogger      = /usr/bin/logger -tfcheck -pauth.info
#AuthLogger      = /usr/bin/logger -tfcheck -pauth.notice



# This is the system command to determine a files type. Used to determine
# pipes, major/minor numbers.
#
# Only useful on Unix platforms, not portable to Windows (yet?!?!).
FileTyper        = /usr/bin/file



# You may optionally set your hostname from the configuration file if FCheck
# is unable to determine it on its own.
#
#HostName        = "Mikes"



# You may optionally set the system type from the configuration file if
# FCheck is unable to determine it on its own.
# Currently the only accepted option her is "System = DOS", otherwise FCheck
# will default to a UNIX system.
#
#System          = UNIX



# This must be set only for readability by you. It in no way effects the scan
# function of FCheck. It only changes what is presented to the end user, so
# the times that are presented to you may not be accurate if not set.
TimeZone        = GMT



# This is used only if you require/desire a hash signature to also be generated
# for each file by use of the '-s' flag. If you do not use the (s)ignature
# flag, then the following variable setting will not impact fcheck in any way.
#$Signature      = /usr/bin/sum
#$Signature      = /usr/bin/cksum
#$Signature      = /usr/bin/md5sum
$Signature      = /usr/bin/sha256sum


# Include an optional configuration file.
# [CFInclude = (path/config_file_name)]
#CFInclude

# Used for individual file checking (I.E. Possibly FCheck databases!)
#
File	= /var/lib/fcheck/fcheck.dbf

# Used for local settings
#
CFInclude = /etc/fcheck/fcheck.local.cfg

#
# End of FCheck.cfg file
#
per posso soltanto escludere le directory e non cambiare il timing

cat/etc/crontab non mi aiuta

Codice: Seleziona tutto

hellojoker@hellojoker-P5W-DH-Deluxe:~$ cat /etc/crontab 
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user	command
17 *	* * *	root    cd / && run-parts --report /etc/cron.hourly
25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6	* * 7	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6	1 * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
perchè se vado a vedere in cron.daily in cron.... non c'è il comando di avvio di fsck

Re: Oneiric fsck in background

Inviato: mercoledì 9 novembre 2011, 14:17
da patel
hellojoker ha scritto: Grazie vaillant, probabilmente mi sono espresso male, ma non mi riferivo a quello, nel senso vorrei rendere meno frequente l'avvio di fsck (in background) non all'avvio
spiegati meglio, è la prima volta che lo sento dire

Re: Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 14:25
da hellojoker
Allora ho installato fcheck, e vorrei poterne controllare la frequenza dell'avvio (automatico) in modo che sia meno frequente, inizialmente mi sono espresso male ed ho scritto (colpa dell'abitudine) fsck invece di fcheck

Ps sto cambiando gli fsck in fcheck

Re: Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 14:33
da il_muflone
hellojoker ha scritto:

Codice: Seleziona tutto

cat /etc/cron.d/fcheck 
#
# Regular cron job for the fcheck package
#
30 */2	* * *	root	test -x /usr/sbin/fcheck && if ! nice ionice -c3 /usr/sbin/fcheck -asxrf /etc/fcheck/fcheck.cfg >/var/run/fcheck.out 2>&1; then mailx -s "ALERT: [fcheck] `hostname --fqdn`" root </var/run/fcheck.out ; /usr/sbin/fcheck -cadsxlf /etc/fcheck/fcheck.cfg ; fi ; rm -f /var/run/fcheck.out
quel 30 */2 significa ogni due ore quando i minuti sono 30.
come vorresti regolare la programmazione? il file e` proprio crontab

Re: Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 14:37
da hellojoker
proprio adesso mi stavo leggendo Newbie intro to cron... ;D diciamo ogni 6 ore

Re: Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 14:42
da il_muflone
allora configura crontab con la programmazione:
0 */6 * * * comando

Re: Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 14:47
da hellojoker

Codice: Seleziona tutto

 cat /etc/cron.d/fcheck 
#
# Regular cron job for the fcheck package
#
0 */6	* * *	root	test -x /usr/sbin/fcheck && if ! nice ionice -c3 /usr/sbin/fcheck -asxrf /etc/fcheck/fcheck.cfg >/var/run/fcheck.out 2>&1; then mailx -s "ALERT: [fcheck] `hostname --fqdn`" root </var/run/fcheck.out ; /usr/sbin/fcheck -cadsxlf /etc/fcheck/fcheck.cfg ; fi ; rm -f /var/run/fcheck.out
Direi che dovremmo esserci ?

Re: Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 14:49
da il_muflone
direi?

Re: Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 14:52
da hellojoker
ok grazie    :) vado a mettere risolto

Re: [Risolto]Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 14:55
da hellojoker
ah per chi volesse qui ci sono delle info utili http://unixgeeks.org/security/newbie/unix/cron-1.html

Re: [Risolto]Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 15:12
da hellojoker
Però una cosa non mi è chiara che cambia se il comando invece che in un file a se stante viene inserito direttamente in crontab? Secondo me niente ma magari non è così

Re: [Risolto]Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 15:13
da il_muflone
di che file parli?

Re: [Risolto]Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 15:17
da hellojoker
ad esempio in questo caso ho fcheck in  /etc/cron.d/, però poi se vado in /etc/crontab vedo altri comandi  programmati, quello che mi chiedevo perchè creare

fcheck e non inserire direttamente il comando in crontab

Re: [Risolto]Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 15:18
da il_muflone
una delle idee piu` geniali di Debian e` quella di sfruttare il piu` possibile le .d contenenti i files di configurazione.
In questo modo ogni pacchetto potra` inserire i propri files senza andare a toccare i files esistenti e altresi` potra` preoccuparsi di eliminarli quando il pacchetto viene rimosso.
Idem in ogni momento si puo` sapere con certezza quale pacchetto e` responsabile di tale file e perche` esiste nel sistema.

andando a modificare un file condiviso da mille programmi cio` non sarebbe facilmente realizzabile.

Re: [Risolto]Oneiric fcheck in background

Inviato: mercoledì 9 novembre 2011, 15:23
da hellojoker
Capito, in effetti in fase di rimozione è più semplice rimuovere fcheck /etc/cron.d/ che togliere il comando relativo da crontab

Grazie di nuovo preciso come sempre