Pagina 1 di 1

UPS APC da interfacciare....

Inviato: mer 9 nov 2005, 18:30
da ChriD
Ho appena acquistato questo gruppo di continuità da 1000VA e lo vorrei far rilevare da linux!

Più che altro non m'interessano programmini vari e cose del genere, ma solo che linux rilevi lo stato di carica della batteria e che si spenga quando scarica!

Un pò come sui portatili!!!

Adesso sto ricompilando il kernel perchè mi ero dimenticato di abilitare delle sottovoci in ACPI.....

devo fare altro?????

Inviato: mer 9 nov 2005, 19:33
da Bart
Se non erro i gruppi di continuità APC sono supportati dal progetto APCUPSd, un demone che monitora questi sistemi. Prova a cercare qualcosa su google a riguardo, dovresti trovare diverse informazioni.
Guarda qui trovi il tutto ----> http://sourceforge.net/projects/apcupsd

Inviato: mer 9 nov 2005, 21:01
da ChriD
Bart ha scritto:Se non erro i gruppi di continuità APC sono supportati dal progetto APCUPSd, un demone che monitora questi sistemi. Prova a cercare qualcosa su google a riguardo, dovresti trovare diverse informazioni.
Guarda qui trovi il tutto ----> http://sourceforge.net/projects/apcupsd

come si fanno a sapere i comandi da utilizzare con quel determinato pacchetto che s'installa???

Inviato: mer 9 nov 2005, 23:37
da Bart
Bisogna che cerchi in rete. Guarda la documentazione sul sito ufficiale. Cerca su google. Vedrai che troverai tante informazioni utili. Di più non posso dirti, non l'ho mai usato ma ho solo letto qualcosa a riguardo.

Inviato: gio 10 nov 2005, 14:03
da ChriD
Bart ha scritto:Bisogna che cerchi in rete. Guarda la documentazione sul sito ufficiale. Cerca su google. Vedrai che troverai tante informazioni utili. Di più non posso dirti, non l'ho mai usato ma ho solo letto qualcosa a riguardo.
oky grazie mille!

Inviato: ven 11 nov 2005, 15:40
da ChriD
Sto combinando casini!

Inizialmente ho installato il pacchetto e mi ha dato degli errorri o meglio un errore con un file che dovevo compilare a mano!

Poi ho scoperto che non avevo i driver usbhid per poter caricare la periferica così mi sono ricompilato il kernel con il supporto!

Adesso i driver ci sono però ho reinstallato il tutto sempre con il make install e mi ritrovo nella directory file doppioni e cose varie...

ho provato anche con il make unistall ma niente di nuovo!

come posso risolvere per ritornare alle condizioni di partenza??? :( :( :( :cry: :cry:

Inviato: ven 11 nov 2005, 17:30
da ChriD
ChriD ha scritto:Sto combinando casini!

Inizialmente ho installato il pacchetto e mi ha dato degli errorri o meglio un errore con un file che dovevo compilare a mano!

Poi ho scoperto che non avevo i driver usbhid per poter caricare la periferica così mi sono ricompilato il kernel con il supporto!

Adesso i driver ci sono però ho reinstallato il tutto sempre con il make install e mi ritrovo nella directory file doppioni e cose varie...

ho provato anche con il make unistall ma niente di nuovo!

come posso risolvere per ritornare alle condizioni di partenza??? :( :( :( :cry: :cry:
Sono riuscito a interfacciare l'apt....

tuttavia mi piacerebbe sempre sapere come fare per disinstallare un'applicazione che non sia un pacchetto tgz...

comunque devo controllare questo file di inizializzazione perchè non è riuscito a farlo il make install!

Il file è l'rc.6
# Set the path.
PATH=/sbin:/etc:/bin:/usr/bin

# If there are SystemV init scripts for this runlevel, run them.
if [ -x /etc/rc.d/rc.sysvinit ]; then
. /etc/rc.d/rc.sysvinit
fi

# Set linefeed mode to avoid staircase effect.
stty onlcr

echo "Running shutdown script $0:"

# Find out how we were called.
case "$0" in
*0)
command="halt"
;;
*6)
command=reboot
;;
*)
echo "$0: call me as "rc.0" or "rc.6" please!"
exit 1
;;
esac

# Save the system time to the hardware clock using hwclock --systohc.
if [ -x /sbin/hwclock ]; then
# Check for a broken motherboard RTC clock (where ioports for rtc are
# unknown) to prevent hwclock causing a hang:
if ! grep -q -w rtc /proc/ioports ; then
CLOCK_OPT="--directisa"
fi
if grep -q "^UTC" /etc/hardwareclock 2> /dev/null ; then
echo "Saving system time to the hardware clock (UTC)."
/sbin/hwclock $CLOCK_OPT --utc --systohc
else
echo "Saving system time to the hardware clock (localtime)."
/sbin/hwclock $CLOCK_OPT --localtime --systohc
fi
fi

# Stop the Apache web server:
if [ -x /etc/rc.d/rc.httpd ]; then
/etc/rc.d/rc.httpd stop
fi

# Stop the MySQL database:
if [ -r /var/run/mysql/mysql.pid ]; then
. /etc/rc.d/rc.mysqld stop
fi

# Stop the Samba server:
if [ -x /etc/rc.d/rc.samba ]; then
. /etc/rc.d/rc.samba stop
fi

# Shut down the NFS server:
if [ -x /etc/rc.d/rc.nfsd ]; then
/etc/rc.d/rc.nfsd stop
fi

# If it looks like we use an initrd, prepare for one at next boot:
if grep -q -w initrd /var/log/messages ; then
mkdir -p /initrd
fi

# Unmount any NFS or SMB filesystems:
echo "Unmounting remote filesystems."
umount -a -r -t nfs,smbfs

# Try to shut down pppd:
PS="$(ps ax)"
if echo "$PS" | grep -q -w pppd ; then
if [ -x /usr/sbin/ppp-off ]; then
/usr/sbin/ppp-off
fi
fi

# Bring down the networking system:
if [ -x /etc/rc.d/rc.inet1 ]; then
. /etc/rc.d/rc.inet1 stop
fi

# In case dhcpcd might have been manually started on the command line,
# look for the .pid file, and shut dhcpcd down if it's found:
if /bin/ls /etc/dhcpc/*.pid 1> /dev/null 2> /dev/null ; then
/sbin/dhcpcd -k 1> /dev/null 2> /dev/null
fi

# Shut down PCMCIA devices:
if [ -x /etc/rc.d/rc.pcmcia ] ; then
. /etc/rc.d/rc.pcmcia stop
# The cards might need a little extra time here to initialize.
sleep 5
fi

# Turn off process accounting:
if [ -x /sbin/accton -a -r /var/log/pacct ]; then
echo "Turning off process accounting."
/sbin/accton
fi

# Kill all processes.
# INIT is supposed to handle this entirely now, but this didn't always
# work correctly without this second pass at killing off the processes.
# Since INIT already notified the user that processes were being killed,
# we'll avoid echoing this info this time around.
if [ "$1" != "fast" ]; then # shutdown did not already kill all processes
killall5 -15
sleep 5
killall5 -9
fi

# Try to turn off quota.
if grep -q quota /etc/fstab ; then
if [ -x /sbin/quotaoff ]; then
echo "Turning off filesystem quotas."
/sbin/quotaoff -a
fi
fi

# Carry a random seed between reboots.
echo "Saving random seed from /dev/urandom in /etc/random-seed."
# Use the pool size from /proc, or 512 bytes:
if [ -r /proc/sys/kernel/random/poolsize ]; then
dd if=/dev/urandom of=/etc/random-seed count=1 bs=$(cat /proc/sys/kernel/random/poolsize) 2> /dev/null
else
dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2> /dev/null
fi
chmod 600 /etc/random-seed

# Before unmounting file systems write a reboot or halt record to wtmp.
$command -w

# Clear /var/lock/subsys.
if [ -d /var/lock/subsys ]; then
rm -f /var/lock/subsys/*
fi

# A function to deactivate LVM volume groups:
deactivate_lvm() {
if [ -r /etc/lvmtab -o -d /etc/lvm/backup ]; then
echo "Deactivating LVM volume groups:"
if cat /proc/sys/kernel/osrelease | cut -f 1,2 -d . | grep -q -w 2.4 2> /dev/null ; then
/sbin/vgchange -an
else
/sbin/vgchange -an --ignorelockingfailure
fi
sleep 10
fi
}

# Turn off swap, then unmount local file systems.
echo "Turning off swap."
swapoff -a
sync

echo "Unmounting local file systems."
# Don't remount UMSDOS root volumes:
if [ ! "$(mount | head -n 1 | cut -d ' ' -f 5)" = "umsdos" ]; then
umount -a -t nonfs,noproc,nosysfs
deactivate_lvm
umount -a -r -t nonfs,noproc,nosysfs
echo "Remounting root filesystem read-only."
mount -n -o remount,ro /
else
umount -a -t nonfs,noproc,nosysfs,noumsdos,nosmbfs
deactivate_lvm
umount -a -r -t nonfs,noproc,nosysfs,noumsdos,nosmbfs
fi

# This never hurts:
sync

# sleep 1 fixes problems with some hard drives that don't
# otherwise finish syncing before reboot or poweroff
sleep 1

# This is to ensure all processes have completed on SMP machines:
wait

if [ -x /sbin/genpowerd ]; then
# See if this is a powerfail situation:
if egrep -q "FAIL|SCRAM" /etc/upsstatus 2> /dev/null ; then
# Signal UPS to shut off the inverter:
/sbin/genpowerd -k
if [ ! $? = 0 ]; then
echo
echo "There was an error signaling the UPS."
echo "Perhaps you need to edit /etc/genpowerd.conf to configure"
echo "the serial line and UPS type."
# Wasting 15 seconds of precious power:
sleep 15
fi
fi
fi

# Now halt (poweroff with APM or ACPI enabled kernels) or reboot.
if [ "$command" = "reboot" ]; then
echo "Rebooting."
reboot
else
poweroff
fi





credo si tratti della parte finale ma non so controllarlo!!!

Inviato: ven 11 nov 2005, 17:43
da Paoletta
tuttavia mi piacerebbe sempre sapere come fare per disinstallare un'applicazione che non sia un pacchetto tgz...
a mano...comunque cos'è che non va con rc.6?? :shock: :?:

Inviato: ven 11 nov 2005, 18:02
da ChriD
Paoletta ha scritto:
tuttavia mi piacerebbe sempre sapere come fare per disinstallare un'applicazione che non sia un pacchetto tgz...
a mano...comunque cos'è che non va con rc.6?? :shock: :?:
mi piacerebbe averlo capito anch'io ma non ci riesco...

il messaggio d'errore diceva impossibile patchare rc.6, farlo a mano!
poi però sono andato a vedere nel file e nelle righe finali ho trovato la patch...

ma... non ci capisco molto.. :roll: