Re: Prompt containing SSH login information

2009-11-25 Thread Artis Caune
2009/11/24 Polytropon free...@edvax.de:
 Hi,

 again, a strange question: I'd like to know if there is a builtin
 means to let the csh's (or bash's) prompt show an information if
 the current dialog session has been opened via SSH from another
 system. The obvious is:

       �...@sys1:~% ssh m...@sys2
       �...@sys2:~% _

 I'd like the second prompt that I've been logged into sys2 by
 sys1, such as

       �...@sys1sys2:~% _

How about this:

- On all servers add the following to sshd_config:
AcceptEnv MYPROMPT
- and the following to ssh_config:
Host *
SendEnv MYPROMPT
- fix shell rc files on servers and workstation:
MYPROMPT=$MYPROMPT$u...@$(hostname -s)
export MYPROMPT

and you will get more than two hosts:
m...@sys1m...@sys2m...@sys3:~%


We use this for root account to give every admin his own:
/root/.zshrc.admin
/root/.zlogin.admin
/root/.zhistory.admin
/root/.vimrc.admin
/root/.viminfo.admin
...



-- 
Artis Caune

Everything should be made as simple as possible, but not simpler.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: using own ntp server

2009-10-11 Thread Artis Caune
2009/10/11 kenneth hatteland kenneth.hattel...@kleppnett.no:
 If I have understand ntp right it is possible to hook up my machines to the
 machine running the ntp server. nevertheless I am not able to find anywhere
 helping me with configuring these machines to connect to my server and I am
 still not bright enough to figure out the syntax myself. Does anyone know
 about a web page or anything that my Googling have missed ? Or perhaps  I
 have gailed to grasp nto correct, and all machines must be configured like
 the handbook says to connect to external machines ?

Take a look at OpenNTPD from OpenBSD. There are only two, three
configuration options. :)

For server:
listen on *
servers pool.ntp.org

For clients:
server 10.0.0.1




-- 
Artis Caune

Everything should be made as simple as possible, but not simpler.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


/tmp sticky bit differences on FreeBSD 8

2009-09-16 Thread Artis Caune
Hi,

can someone point me to what has changed in file creation modes in
/tmp directory?

# FreeBSD 6, 7:
$ cd /tmp; id; touch testfile; mkdir testdir; ls -la
uid=65534(nobody) gid=65534(nobody) groups=65534(nobody)
drwxr-xr-x   2 nobody  wheel   2 Sep 16 22:10 testdir
-rw-r--r--   1 nobody  wheel   0 Sep 16 22:10 testfile


# FreeBSD 8:
$ cd /tmp; id; touch test; ls -la test
uid=65534(nobody) gid=65534(nobody) groups=65534(nobody)
drwxr-xr-x   2 nobody  nobody   2 Sep 16 22:12 testdir
-rw-r--r--   1 nobody  nobody   0 Sep 16 22:12 testfile


On FreeBSD 6,7 files are created with wheel group, but on 8 - with `gid`.




-- 
Artis Caune

Everything should be made as simple as possible, but not simpler.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: /tmp sticky bit differences on FreeBSD 8

2009-09-16 Thread Artis Caune
2009/9/16 Matthew Seaman m.sea...@infracaninophile.co.uk:
 On FreeBSD 6,7 files are created with wheel group, but on 8 - with `gid`.

 It seems that ZFS uses SysV group semantics (new files get the 1ary group of
 the user unless the directory is set to SGID).  UFS filesystems on 8.x still
 behave in the expected BSD way (new files get the same group as the
 directory unless the user is not a member of that group, when they get the
 users' 1ary group).

 There's a thread 'ZFS Group ownership'  on this topic in freebsd-hack...@...
 at the moment.


hmm, I use ZFS on FreeBSD 7, but still get wheel group and not egid.




-- 
Artis Caune

Everything should be made as simple as possible, but not simpler.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Boot from RAIDZ in 8.0-BETA3?

2009-09-03 Thread Artis Caune
2009/9/1 Jason Garrett kinged...@gmail.com:
 IMHO, unless you have a NEED to do this with the 8-BETA's I would not
 attempt. While I had this working in 8.0-BETA1 upon reboot I would loose
 data from entire mountpoints on the root pool. First it was /usr/ports, not
 a big deal. Then it was /var/db/pkg.. the system had no idea what was
 installed and what wasn't. This was a test machine, so no harm, no foul. I
 would definatley not recommend this AT ALL.

Maybe you just messed with wrong zfs option or in wrong order and your
mountpoints are not lost, but not-mounted or over-mounted?
It's a little bit tricky to get zfs-root working, some things can go
wrong if installation is not automated.




-- 
Artis Caune

Everything should be made as simple as possible, but not simpler.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: shell command line argument + parsing function

2009-09-01 Thread Artis Caune
2009/8/31 Stefan Miklosovic miklosovic.free...@gmail.com:
 hi,

 assuming I execute shell script like this

 $ ./script -c hello world

 I want to save hello world string to variable COMMENT in shell script.

 code:

 #!/bin/sh

 parse_cmdline() {
    while [ $# -gt 0 ]; do
        case $1 in
            -c)
                shift
                COMMENT=$1
                ;;
        esac
        shift
    done
 }

 parse_cmdline $*

 echo $COMMENT

 exit 0




How about getopts builtin, so you can use:
./script -c hello world or
./script -chello world or


while getopts c: f; do
case $f in
c)
COMMENT=$OPTARG
;;
\?)
echo 'usage: $0 [-c string]'
exit 1
;;
esac
done

echo COMMENT: $COMMENT




-- 
Artis Caune

Everything should be made as simple as possible, but not simpler.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Boot from RAIDZ in 8.0-BETA3?

2009-09-01 Thread Artis Caune
2009/8/30 Doug Poland d...@polands.org:
 Shutdown, remove ad0 from the virtual machine,
 Power on and it see...

 scrolls off screen
 error 4 lba 4292979877
 error 4 lba 4292979883
 error 4 lba 4292979883
 error 4 lba 4292979882
 ZFS: i/o error - all block copies unavailable
 Invalid format

I had a similar problem on IBM x3650 with 6 sata disks. While testing
zfs, I got kmem panic and after reboot same errors appeared.
OpenSolaris does not allow to boot from raidz and there can be only
one vdev in bootable pool, so I decided to make two pools if I need
raidz or multiple vdevs:
- one root pool (8G) (mirror disk0 disk1 ... disk5)
- one for data and other fs (raidz disk0 disk1 ... disk5)





-- 
Artis Caune

Everything should be made as simple as possible, but not simpler.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


shell power in rc.conf

2009-08-18 Thread Artis Caune
Hi,

Is there any reason of not using shell variables in rc.conf?
I want to tune rc.conf for easy editing and administration. Take for
example jail_list or cloned_interfaces with 10+ entries:


# interfaces
cloned_interfaces=carp1 bce0.10 carp10 bce0.20 carp20

ifconfig_bce0_10=10.0.0.1/24
ifconfig_bce0_20=10.0.1.1/24
ifconfig_bce0_20_alias0=10.0.1.2/32
ifconfig_carp10=vhid 10 advskew 100 pass MySecret 10.0.0.100/32
ifconfig_carp20=vhid 20 advskew 15  pass MySecret 10.0.1.100/32

# jails
jail_list=ns mail

jail_ns_hostname=ns
jail_ns_ip=10.10.10.1

jail_mail_hostname=mail
jail_mail_ip=10.10.10.2


Instead I can rewrite this to:


# interfaces
cloned_interfaces=${cloned_interfaces} bce0.10
ifconfig_bce0_10=10.0.0.1/24

cloned_interfaces=${cloned_interfaces} bce0.20
ifconfig_bce0_20=10.0.1.1/24
ifconfig_bce0_20_alias0=10.0.1.2/32

cloned_interfaces=${cloned_interfaces} carp10
ifconfig_carp10=vhid 10 advskew 100 pass MySecret 10.0.0.100/32

cloned_interfaces=${cloned_interfaces} carp20
ifconfig_carp20=vhid 20 advskew 15  pass MySecret 10.0.1.100/32

# jails
jail_list=${jail_list} ns
jail_ns_hostname=ns
jail_ns_ip=10.10.10.1

jail_list=${jail_list} mail
jail_mail_hostname=mail
jail_mail_ip=10.10.10.2


Now I can just comment out unused interface or jail, and it won't start up.





-- 
Artis Caune

Everything should be made as simple as possible, but not simpler.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: fixit console with sshd

2009-05-14 Thread Artis Caune
2009/4/28 n j nin...@gmail.com:
 I was just wondering if someone could give me a quick advice on how
 (or at least confirm it's possible) to start sshd in fixit console
 i.e. how to boot FreeBSD off the CD1 (6.4-RELEASE) and enable SSH
 access to it.

 I believe booting off a live CD and restoring a backup over network
 should be a relatively common recovery scenario, but googling around
 produced no usable results other than get FreeSBIE live cd.

or you can build your own live cd:


# BUILDDIR=/home/my_live_cd
# mkdir $BUILDDIR

# cd /usr/src
# make buildworld
# make buildkernel
# make installworld  DESTDIR=$BUILDDIR
# make distribution  DESTDIR=$BUILDDIR
# make installkernel DESTDIR=$BUILDDIR

echo '/dev/acd0 / cd9660 ro 0 0'  $BUILDDIR/etc/fstab
echo 'init_script=/etc/rc.my'  $BUILDDIR/boot/loader.conf
echo exec /bin/sh  $BUILDDIR/etc/rc.my
# you probably should script /etc/rc.my and
# mount rw memory fs over /var, /tmp, and others

# add useful packages
mount -t devfs devfs $BUILDDIR/dev
for pkg in apg-2.3.0b_1 bonnie++-1.93.04 stress-1.0.0; do
cp /home/pkgs/${pkg}.tbz $BUILDDIR/
chroot $BUILDDIR pkg_add /${pkg}.tbz
rm $BUILDDIR/${pkg}.tbz
done
umount $BUILDDIR/dev

# generate ssh keys
chroot $BUILDDIR /etc/rc.d/sshd keygen


# mkisofs -quiet -b boot/cdboot -no-emul-boot -r -iso-level 4 -V my
live cd -o /home/my_live_cd.iso $BUILDDIR
# burncd -v -s max data /home/my_live_cd.iso fixate




You can even read some new manpages while fixing servers :)




-- 
Artis Caune

Everything should be made as simple as possible, but not simpler.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: Anyone runs 7.1 with an IBM X3650 (64 bits ARCH) ?

2009-03-14 Thread Artis Caune
2009/3/13 Frank Bonnet f.bon...@esiee.fr:
 Hello

 Everything is in the subject :-)

 Thanks for any infos

 Purpose is migration of a mailhub

We have some weird problems with sata disks, sas works just great.
(ServeRAID 8k)
3Gbps not working, we get lot of aac cmd timeouts. IBM support cooked
new firmwares, no help, raid bios is now loading 3-4 minutes, finaly
they told to switch to 1.5Gbps. Works better, but anyway, we have
replaced 2 disks in last 6 months and now one is waiting for
replacement because of:
   aacd0: hard error cmd=write fsbn 455142322

btw, linux is freezing on ours x3650+sata (even their supported red
hat or whatever it was) :)
IBM support have also replaced IBM sata disks to non-IBM sata disks
for 15 x3550 boxes, works fine.

Before sata, we have only sas disks, no problems, ever.




-- 
regards,
Artis Caune

. CCNA | BSDA
|
' didii FreeBSD
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: bash script on FreeBSD

2008-10-08 Thread Artis Caune
On Wed, Oct 8, 2008 at 8:11 AM, Kalpin Erlangga Silaen
[EMAIL PROTECTED] wrote:
 I am going to extract field username and UID from /etc/passwd and passed
 into some scripts. Let say I got line

 admin 100
 admin2 200
 admin3 300
 admin4 400

 and then I want to echoing into screen:

 admin has uid 100
 admin2 has uid 200
 admin3 has uid 300
 admin4 has uid 400

 How do I make this with bash script?

# echo $line |awk '{ print $1  has uid  $2 }'




-- 
regards,
Artis Caune

. CCNA | BSDA
|
' didii FreeBSD
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


ZFS on root with atime=off

2008-10-03 Thread Artis Caune
Hi everyone,

I install ZFS on root just like in Andrew ZFSOnRoot wiki page.
I don't use legacy mount points.

I also set atime=off on tank and all partitions inherit it from tank.
When I reboot after install, root file system is mounted with atime option:
# zfs get atime tank
NAME  PROPERTY  VALUE  SOURCE
tank  atime on temporary

I can fix this with creating entry in fstab for root fs with noatime,
but maybe there is some way how to pass options to vfs.root.mountfrom?




-- 
regards,
Artis Caune

. CCNA
|
' didii FreeBSD
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: semget: no space left on freebsd 6.2

2008-09-23 Thread Artis Caune
On Tue, Sep 23, 2008 at 10:26 AM, Jordi Moles Blanco [EMAIL PROTECTED] wrote:
 Also try adding this options on FreeBSD kernel config:
 options SEMMNI=20
 options SEMMNS=120

 And set the kern.maxfiles sysctl option higher than 1000.

 *

 it didn't work either.

Hi,

you don't have to recompile the kernel to change those, just add them
in /boot/loader.conf:
kern.ipc.semmni=256
kern.ipc.semmns=512
kern.ipc.semmnu=256

You should also add these lines to /etc/sysctl.conf:
kern.ipc.shmmax=536870912
and/or also:
kern.ipc.semmap=256
kern.ipc.shm_use_phys=1
kern.ipc.shmall=131072
depending on how much memory you have and how mush shared memory modules need.





-- 
regards,
Artis Caune

. CCNA
|
' didii FreeBSD
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: pf question

2008-09-09 Thread Artis Caune
On Tue, Sep 9, 2008 at 8:17 AM, Scott Bennett [EMAIL PROTECTED] wrote:
 I'm just starting to play around with pf to get it to handle NAT for
 a LAN, and I've just discovered that I don't know how to get pf to reload
 /etc/pf.conf after I make changes to it.  pfctl -d -e doesn't do it, and
 neither does pfctl -d; pfctl -e.  Is there a way to do it besides rebooting?

pfctl -f /etc/pf.conf

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-pf.html



-- 
regards,
Artis Caune

. CCNA
|
' didii FreeBSD
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: [ask] adding new processor

2008-09-09 Thread Artis Caune
On Tue, Sep 9, 2008 at 9:55 AM, andy-ch [EMAIL PROTECTED] wrote:
 I would like to add a new processor on my FreeBSD 7-RELEASE.

 Now it's 1 x Intel Xeon E5410, and I would like to add another 1 x Intel
 Xeon E5410, so there will be 2 x Intel Xeon E5410 (8-Core Total)

 Do I need to recompile the kernel and/or daemons inside (ex: Apache, PHP,
 MySQL, EXIM, etc...) ?

 Or the operating system (including it's daemons) will reflect to work with
 both processors once the system booted ?

Hi,

FreeBSD 7.0 has multi processor support in GENERIC kernel.
If you haven't removed SMP option from kernel config, you don't need
recompile anything.

verify with:
# sysctl kern.smp.cpus




-- 
regards,
Artis Caune

. CCNA
|
' didii FreeBSD
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: starting sysinstall at boot time

2008-09-02 Thread Artis Caune
On Tue, Sep 2, 2008 at 12:49 PM,  [EMAIL PROTECTED] wrote:

 Hi,

 Something seems magic in freebsd: I am looking for what does start
 sysinstall at boot time when I boot from the installation CD.
 The only thing related to systinstall is the setting of the init_path variable
 in the loader.rc file but it is in comment thus the loader should finish
 by launchinig init as usual so what does make it launch sysinstall instead?

I think /sbin/init is replaced with sysinstall.


 As you may guess, my goal is to create an customized installation CD in
 order to install a network appliance wich embedds freebsd.

I also use custom install script, and I replace /etc/rc on mfs image.




-- 
regards,
Artis Caune

. CCNA
|
' didii FreeBSD
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: make release, src.conf and WITHOUT_SENDMAIL on freebsd 7

2008-09-01 Thread Artis Caune
On Sat, Aug 30, 2008 at 11:06 AM, Matias Surdi [EMAIL PROTECTED] wrote:
 The problem arises when I do a make release as, as far as I can see,
 /etc/src.conf is completly ignored. I think it's an issue with the chroot
 environment that make release uses. Wich is the correct way to let make
 release know about src.conf?

you can play with release(7) LOCAL_PATCHES variable or
copy /etc/src.conf to /usr/src/etc and add it to /usr/src/etc/Makefile.




-- 
regards,
Artis Caune

. CCNA
|
' didii FreeBSD
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]