Archive for the ‘ FreeBSD7 ’ Category

How to update my sparc FreeBSD install

So the spanking new freebsd-update doesn’t work for sparc systems… boo. Have to do everything manually. Here’s what I remember. Let me know if I forgot something, or its wrong.(very likely)

Install cvsup:

# cd /usr/ports/net/cvsup-without-gui/
# make install

install fastest cvsup:


# cd /usr/ports/sysutils/fastest_cvsup/
# make install
# fastest_cvsup -c u

copy the default supfile to our own before editing.


# cp /usr/share/examples/cvsup/stable-supfile /etc/stable-supfile
# cp /usr/share/examples/cvsup/ports-supfile /etc/ports-supfile

edit both of them and change the


*default host=

to the fastest cvsup server from the “fastest cvsup”

then update the ports


# cvsup -L2 -g /etc/ports-supfile
# cvsup -L2 -g /etc/stable-supfile

Then i guess we try to build the world. see if something breaky.


# cd /usr/src
# make buildworld

Recompiled kernel. I have my own kernel called “MYSPARC2″. Yours might just be “GENERIC”


# cd /usr/src
# make buildkernel KERNCONF=MYSPARC2
# make installkernel KERNCONF=MYSPARC2

rebooted into single user mode then:

# mount -u /
# mount -a -t ufs
# swapon -a

Now you are ready to install the new world.

# cd /usr/src
# make installworld

After that was done, mergemaster to update your configs:

mergemaster -v

Then used portmaster to upgrade all of the ports.

# portmaster -a

Basically everything i know about BSD comes from or stems from something I’ve read at freebsdmadeeasy.com

source: http://www.freebsdmadeeasy.com/tutorials/freebsd/updating-freebsd-with-cvsup.php

Automysqlbackup.sh.2.5 on FreeBSD

Automysqlbackup is a great tool. It’s setup and configuration can be found at many other sites. When you try to run it out of the box, you will get something like this:

./automysqlbackup.sh.2.5: Command not found.

To run it in FreeBSD, you need to edit a single line. Automysqlbackup.sh.2.5 is a bash script, and it references the path ‘/bin/sh’. In freebsd, bash is installed at ‘/usr/local/bin/bash.’ If you haven’t already, install bash:

pkg_add -r bash

Then all you have to do is edit automysqlbackup.sh.2.5. Look for

#!/bin/bash

and change it to

#!/usr/local/bin/bash

Now you should be able to launch it properly by running ‘./automysqlbackup.sh.2.5′. creating a symlink would probably work, but i like this better.

FreeBSD time updates with ntpdate and ntpd

So FreeBSD’s time is out of wack. Two options:

1. ntpdate. This is manual. To run a time sync manually, just run

ntpdate -b pool.ntp.org

You can replace pool.ntp.org with whatever you want. To tell it to run whenever the system is booted, add this to /etc/rc.conf:

ntpdate_enable="YES"
ntpdate_hosts="[your ntp server]"

This works, but if you don’t reboot often, could be unreliable.

2. ntdp. ntpd just runs all the time and keeps you nsync with internet time servers. You would want to use this for servers that you don’t reboot all the time. for this:

create an /etc/ntpd.conf file:

server pool.ntp.org
driftfile /etc/ntp.drift
logfile /var/log/ntpd.log

you can start ntpd manually:

ntpd

and/or add a startup entry for it in /etc/rc.conf:

ntpd_enable="YES"

I recommend setting up both of these on servers. Ntpdate will snap your system to a good point before you begin synchronizing with ntpd. ntpd by itself will take a lot longer to get you synced up.

webalizer installation on freebsd 7

cd /usr/ports/www/webalizer
make
make install
make clean
rehash
mkdir /usr/local/www/stats
webalizer -o /usr/local/www/stats /var/log/httpd-access_log

After that, just added it to the root crontab
crontab -e

like this:
0 * * * * /usr/local/bin/webalizer -o /usr/local/www/stats /var/log/httpd-access_log > /var/log/webalizer-hourly

That runs every hour, so that the stats are kept up-to-date.

savecore? reboot after panic?

scary. I updated freebsd, and i can only think that i messed it up when i tried to “shutdown -h” to get it shutdown so i could reboot. anyways, when i rebooted, i saw this message. apparently there was a kernel dump on my swap drive. But problem is that i didn’t have enough room on /var/crash to make it happen. i redirected the commands ot the /usr/home/ program.

http://www.freebsd.org/doc/en/books/developers-handbook/kerneldebug.html
fsck -p
mount -a -t ufs
make sure /var/crash is writable
savecore /var/crash /dev/ad0b
exit
exit to multi-user

 

Switch to our mobile site