解决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

【Linux】Solaris10下安装后Oracle11g的环境变量配置,实现oracle用户下支持sqlplus,lsnrctl等命令

Solaris10下安装后Oracle11g的环境变量配置,实现oracle用户下支持sqlplus,lsnrctl等命令 1. root用户下——修改oracle用户的配置文件.profile ...
  • WolfOfSiberian
  • WolfOfSiberian
  • 2015年01月17日 22:52
  • 1416

solaris挂载iso镜像\制作\复制

挂载 bash-3.00# lofiadm -a /export/home/root/software/iso/slax-6.0.0pre3.iso /dev/lofi/1 bash-3.00#...
  • zhaojian1988
  • zhaojian1988
  • 2013年04月16日 15:36
  • 1233

Solaris下如何修改文件创建时间及查询

Solaris下如何修改文件创建时间及查询 实验演示: 1、核对时间 [root@S1011:/]# date Tue Jul 15 21:37:01 CDT 2014 --若时间不正确请先按...
  • huangyanlong
  • huangyanlong
  • 2014年07月15日 23:10
  • 2123

Solaris管理本地磁盘

Solaris管理本地磁盘  http://blog.csdn.net/a3z2008/article/details/7220916 源文档 http://blogold.chinaunix.n...
  • orion61
  • orion61
  • 2013年01月14日 11:20
  • 3113

【好东西一定要转】关于Solaris安全配置的转贴和讨论

转1 Sun系统的基本安全配置V1.0(by GaoXiao) 1)防止堆栈溢出(*) 2)关闭不用的服务,关闭一些无用的端口(*) 3)给系统打补丁(*) 4)消除系统中的弱智用户,定期修改...
  • shenghuiping2001
  • shenghuiping2001
  • 2013年11月15日 20:12
  • 2893

Solaris 用户账号 管理

分类: useradd 功能说明:建立用户帐号。 语  法:useradd [-mMnr][-c ][-d ][-e ][-f ][-g ][-G ][-s ][-u ][用户帐号] 或 ...
  • shenghuiping2001
  • shenghuiping2001
  • 2013年11月15日 20:13
  • 1805

Solaris 10 常用命令

Solaris 10 常用命令   1.如何查看当前在线用户?  可以使用who和finger显示当前正在在线的用户。  bash-3.00# who  root       pts...
  • li19236
  • li19236
  • 2014年12月08日 18:27
  • 3181

Solaris10 网络安装 操作系统

Solaris网络安装 通过本地网络安装solaris 10 U11(sparc)  安装环境:       服务器端:VMWare 安装solaris 10U11                 ...
  • cooljsz
  • cooljsz
  • 2015年12月30日 08:35
  • 556

Solaris MDB常用命令

1. 获取进程树 > ::ptree fffffffffc04b6b0 sched ffffc10011da9fc0 postwaittq ffffc10011da1fc...
  • agony000
  • agony000
  • 2013年11月25日 13:12
  • 1443

利用proc工具解决系统(solaris)问题

作者:Peter Baer Galvin 概述 许多系统管理员并未意识到到Solaris自己携带工具之多之强,他们碰到问题的 时候往往束手无策。本文将介绍proc工具以及如何利用它们...
  • nemo2011
  • nemo2011
  • 2013年01月03日 22:01
  • 1402
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:解决Solaris下的/home问题
举报原因:
原因补充:

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