解决Solaris下的/home问题

Hi.

We have many scripts which are hardcoded to use /home/httpd. This
folder have a svn-checkout, the scripts are executed as another user.
Coming from a FreeBSD background this is not a problem since all users
(except for root) by default are located beneath /home.

Ie. user foo relies on /home/httpd/bar to find fonts etc.

On solaris the default is to create an /export/home and then
dynamically locate the username relative to /home during login. But
this will not work since the files will be at /export/home/httpd
instead.

Can I circumvent this on opensolaris?

 ××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

If I remember correctly, as long as automounter is running an entry in /etc/auto_home (before +auto_home) like

* localhost:/export/home/&

should do the trick.

×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

There are several different solutions to this.  Here's one discussion
that is on the first page of a google.com search:

  http://www.voiceworks.pl/cypromis/2007/06/10/the-magic-of-automounting-user-homedirectories-on-solaris/

It essentially suggests adding this to /etc/auto_home:

       httpd   localhost:/export/home/httpd

There are other ways to do this, though.  One is to remove the
auto_home references from /etc/auto_master and then either mount a new
file system directly over /home or use lofs to mount in a lower level
directory.


××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

Thank you for yor reply. I added the entry to /etc/auto_home but it
did not do the trick unfortunately. /etc/auto_home looks like this:

+auto_home
* localhost:/export/home/&

I also switched those two entries, and rebooted each time. I'm running
opensolaris b70b.

××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

Did you restart the automounter ?

svcadm restart autofs

××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

Thank you for your reply. I also tried that as well as the other
suggestion that was posted to this thread. But httpd does not show up
in /home.

I added the entries to another test server and rebooted. These are the entries:

kilaasi 127.0.0.1:/export/home/kilaasi
claus 127.0.0.1:/export/home/claus

rozetta~%>pwd
/export/home/kilaasi

I'm using opensolaris b70b.

> There are other ways to do this, though.  One is to remove the
> auto_home references from /etc/auto_master and then either mount a new
> file system directly over /home or use lofs to mount in a lower level
> directory.

I will try that instead.

××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

Just tried but unfortunately it did not help.

rozetta~#>svcadm restart autofs
rozetta~#>ls -l /home
total 0

rozetta~#>ls -l /export/home
total 20
drwxr-x---   6 claus    staff        512 Oct 10 16:24 claus
drwxr-xr-x  16 kilaasi  staff       1024 Oct 10 16:41 kilaasi
drwx------   2 root     root        8192 Oct  4 10:58 lost+found

/etc/auto_master:
+auto_master
/net            -hosts          -nosuid,nobrowse
/home           auto_home       -nobrowse

/etc/auto_home:
+auto_home
kilaasi 127.0.0.1:/export/home/kilaasi
claus 127.0.0.1:/export/home/claus

××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

Hi Claus,

you have the "nobrowse" option to /home - which means ls /home will give nothing
(i.e. you can't browse it)  - you probably need to try /home/claus or
/home/kilaasi to see anything in /home.

HTH,

×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

Nothing is supposed to show up; it's all on demand.

Try: ls -l /home/clause

×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××

Thank you! :-)  You're right. So if I change /etc/auto_home to

+auto_home
* localhost:/export/home/&

I get

tape~#>ls -l /home
ls: error reading directory /home: No such file or directory
total 4

whenever I restart autofs. Doing a 'ls /home/claus' works. And adding
the entries one by one as 'claus localhost:/export/home/claus' also
works.

**************************************************************************************

Thank you for all who helped me in this matter.

The /home-mapping is in place, I have to manually to type 'ls
/home/foo'  to make it visible beneath /home. But as long as the
scripts work it will work out just fine.


**************************************************************************************


* localhost:/export/home/&
+auto_home

does the trick,  no reboot needed.
just restart the automounter after editing /etc/auto_home with

svcadm restart autofs
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值