解决Solaris下的/home问题

原创 2007年10月11日 21:23:00
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

C++Builder的几则小应用

这是第一篇帖文,从网上找的。以下是原文。C++Builder的几则小应用(望月 2001年09月19日 19:00)Borland C++BUILDER(BCB)是一种面向对象的、可视化的快速应用程序...
  • lwd2k
  • lwd2k
  • 2001-10-17 22:34:00
  • 882

Solaris中/home下不能创建目录

 Solaris中/home下不能创建目录Solaris的用户目录应该创建在/export/home下,不建议直接使用/home。 Solaris的/home目录是由automounter控制的,只有...
  • sungblog
  • sungblog
  • 2006-09-06 22:45:00
  • 3845

Solaris下/home为何没有写权限 ?

Solaris和其他的UNIX系统不一样,用户的主目录不在/home下,而是放在了/export/home下,而/home做为了AutoFS服务的一个挂载点了,所以变成了任何人都无权限的只读。 ...
  • jacky0922
  • jacky0922
  • 2011-05-25 16:07:00
  • 914

solaris下用户目录的建立

 一、    在建立用户目录之前先了解文件或目录的使用权限UNIX 系统对每一个文件或目录都记录有9个权限的属性值,前面3个是“所有者”的“读权限”、“写权限”、“执行权”,接着3个是“同一用户组的人...
  • changsure
  • changsure
  • 2007-06-21 21:53:00
  • 4330

20%的SOLARIS知识解决80%的问题

简介 这篇文档包含了你用solaris和Sun平台工作时所需要的最重要的20%的技术。它能处理你所遇到的80%的问题。 这篇文档并不打算覆盖Solaris处理环境的细节,也不会包含常见问题解答(相关的...
  • sense5
  • sense5
  • 2006-08-19 22:14:00
  • 1485

20%的SOLARIS知识解决80%的问题 .doc

  • 2011年12月25日 13:33
  • 102KB
  • 下载

解决solaris /home无法创建目录问题

 Q:为什么我不能在/home目录下创建子目录?A:如果/etc/rc2.d/S74autofs脚本中automount(1M)守护进程已经mount了/home,就是这种现象,而这还是缺省安装后的情...
  • myccc456
  • myccc456
  • 2008-08-31 14:19:00
  • 951

让我头疼的solaris——fsck命令

不知道到底是那里出错了,无法正常关机,只好强行关机了。第二天早上,发现系统要求fsck。管他呢,让我怎么做,我就怎么做。运行fsck,一路yes,发现/export/home面所有的文件夹都消失了。郁...
  • scorpio16
  • scorpio16
  • 2005-04-26 15:51:00
  • 6149

discuz的论坛home页

  • 2009年04月07日 14:01
  • 238KB
  • 下载
收藏助手
不良信息举报
您举报文章:解决Solaris下的/home问题
举报原因:
原因补充:

(最多只允许输入30个字)