Archive for category RHEL 4.3
Run Shoutcast server on boot
This works , unless you have the wrong binary
./sc_serv sc_serv.conf & (enter) From the directory where shoutcast sc_serv is located. You can have this binary anywhere on your OS and the configuration can also be anywhere.
If these commands below do not work for you, there is something WRONG. Plain and simple.
e.g. ./sc_serv_freebsd hackerradio.conf &
e.g. ./sc_serv_glibc hackerradio.conf &
ps -aux |grep sc_ (will show you if it running and what PID, owns it).
So lets just say you have sc_serv (generic name here), located in /usr/sbin/shoutcast, and the configs for shoutcast in /etc (pretty easy) and you want this to start with the OS booting up.
If you cant get options software or daemons to start with your system, talk with your sysadmin
DOH!
Some examplex that would work on red hat, debian, or any posic version of linux.
#!/bin/sh
# shoutcast.sh ; easy startup script.
#put this in /usr/bin or Or better, see start/kill
#script as they need to match this.
#chmod 655 shoutcast.sh
case “$1″ in
’start’)
echo -n “shoutcast start”
cd /usr/sbin/shoutcast && ./sc_serv /etc/shoutcast.conf &
;;
’stop’)
# ya! ugly way to kill, but it kills it!
echo -n “shoutcast stop”
killall sc_serv
;;
*)
echo “Usage: $0 { start | stop }”
;;
esac
exit 0
# END , no duh
Now cd /etc/rc3.d
ln -s /usr/bin/shoutcast.sh S99shoutcast.sh
cd /etc/rc0.d
ln -s /usr/bin/shoutcast.sh K99shoutcast.sh
Now if the OS is behaving itself, when run level 3 starts (multi user, networking) S99shoutcast.sh will be fired up, when the system is shutting down, K99shoutcast.sh is run and killall should kill the shoutcast server.
Cheers.
~ HD
How do I change the system to boot into text mode (runlevel 3) instead of the graphical login (runlevel 5)?
Resolution:
In order to change what runlevel the system boots to, modify the /etc/inittab file. This is a sample from the inittab file:
# Default runlevel. The runlevels used by RHS are:
# 0 – halt (Do NOT set initdefault to this)
# 1 – Single user mode
# 2 – Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 – Full multiuser mode
# 4 – unused
# 5 – X11
# 6 – reboot (Do NOT set initdefault to this)
#
id:5:initdefault:
runlevel is determined by this line:
id:5:initdefault:
Change the above line to:
id:3:initdefault:
and your system will now boot to runlevel 3 or text mode.
Uso de Cron
para configurar cron desde una terminal ejecutas: crontab -e por default te abrira el crontab del usuario con vi para modificar el archivo con vi primero presiona a y despues escribe las ordenes que quieres ejecutar cuando termines presiona esc y luego ZZ (si zeta mayuscula dos veces para grabar el nuevo crontab) el crontab deberia verse algo asi: # los arteriscos significan en orden lo siguiente [minuto(0- 60) hora (0-23) mesdia(1-31) mes(1-12) diasemana (0-7)] * * * * * /home/usuario/carpeta/script_de_usuario # las lineas con # significan comentarios por ejemplo este crontab ejecutaria cada minuto el script lo de que no puedes ejecutar es porque quizas no tienes permisos de ejecucion para ello haz esto por ejemplo: creo un script que me diga la hora cada minuto y con crontab lo guardamos en un log cada minuto ahora desde una terminal ejecutas (todo esto como root): vi /usr/bin/script_tiempo_cada_minuto (presiona tecla a para empezar a insertar caracteres) #!/bin/sh date (presiona tecla esc para dejar de insertar caracteres) (presiona ZZ para salir y grabar) (ahora le daremos permiso de ejecucion) chmod 755 /usr/bin/script_tiempo_cada_minuto (ahora creamos el crontab) crontab -e (presionamos a para empezar a introducir caracteres) * * * * * /usr/bin/script_tiempo_cada_minuto >> /home/usuario/log_tiempo_cada_minuto (presionamos esc para dejar de introducir caracteres) (presionamos ZZ para grabar y salir) listo ahora ya esta instalado el crontab para ver que el crontab funciona verifica como va cambiando el log NOTA. lo de root es para que el script se puediera escribir en /usr/bin/ puedes escribir un script en tu home para no tener necesidad de usar al root pero si colocas tus scripts en /usr/bin los podras llamar desde un quickrun o una terminal como a cualquier comando
Para que k3b grabe mp3 se necesita un plugin
up2date k3b-mp3
en DAG
Java y Azureus
Para instalar java lo bajamos de aquí se siguen las instrucciones lo único que hay que agregar es:
1ero Borrar el anterior java de /usr/bin/java
rm /usr/bin/java
Luego crear un enlace a java
cd /usr/bin/java
ln -s /usr/java/jre1.5.x_x/bin/java
Despues en .bash_profile agregamos lo siguiente
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi# User specific environment and startup programs
JAVA_HOME=/usr/java/jre1.5.0_07
PATH=$PATH:$HOME/bin:$JAVA_HOME/binexport PATH JAVA_HOME
unset USERNAME
Y listo ya debe de correr Azureus
Red HAT 4.3 con Virtualmin – webmin
Después de probar CENTOS 4.3 me encanto el sistema así que me anime a comprar una subscripción de RED HAT y con el dolor de mi alma lo pague. Ya este servidor de blog.yucas.info corre en Red Hat Enterprise 4.3.
Las principales diferencias con CENTOS 4.3 son casi nulas es muy parecido. Lo único que cambia es que no existe la herramienta YUM, que es sustituida por up2date, de resto es igual. La instalación de apache mysql va de la siguiente manera Read the rest of this entry »