安装Oracle,新建组、用户的时候的一个错误
[root@localhost /]# useradd -g oinstall -G dba -d /u01/oracle/ oracle
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.
Creating mailbox file: File exists
[root@localhost ~]# ll -a /u01/oracle/
total 32
drwx------. 4 oracle oinstall 4096 Aug 10 19:41 .
drwxr-xr-x. 3 oracle oinstall 4096 Aug 10 19:41 ..
-rw-r--r--. 1 oracle oinstall 18 May 30 12:58 .bash_logout
-rw-r--r--. 1 oracle oinstall 176 May 30 12:58 .bash_profile
-rw-r--r--. 1 oracle oinstall 124 May 30 12:58 .bashrc
-rw-r--r--. 1 oracle oinstall 500 Jan 23 2007 .emacs
drwxr-xr-x. 2 oracle oinstall 4096 Nov 11 2010 .gnome2
drwxr-xr-x. 4 oracle oinstall 4096 Aug 10 17:32 .mozilla
1.编辑/etc/passwd与/etc/group
2.创建用户主目录
3.从/etc/skel拷贝文件与目录
4.让新用户获得其主目录与文件的拥有权限
5.给新用户一个密码
static void create_home (void)
{
if (access (user_home, F_OK) != ) {
#ifdef WITH_SELINUX
selinux_file_context (user_home);
#endif
/* XXX - create missing parent directories. --marekm */
if (mkdir (user_home, ) != ) {
fprintf (stderr,
_("%s: cannot create directory %s\n"),
Prog, user_home);
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER, Prog,
"adding home directory",
user_name, (unsigned int) user_id,
SHADOW_AUDIT_FAILURE);
#endif
fail_exit (E_HOMEDIR);
}
chown (user_home, user_id, user_gid);
chmod (user_home,
& ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
home_added = true;
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER, Prog,
"adding home directory",
user_name, (unsigned int) user_id,
SHADOW_AUDIT_SUCCESS);
#endif
#ifdef WITH_SELINUX
/* Reset SELinux to create files with default contexts */
setfscreatecon (NULL);
#endif
}
} int main(int argc, char *argv[])
{
................
create_home ();
if (home_added)
copy_tree (def_template, user_home, user_id, user_gid);
else
fprintf (stderr,
_
("%s: warning: the home directory already exists.\n"
"Not copying any file from skel directory into it.\n"),
Prog); ......................
}
前先不建/u01/oracle, 报错 是因为 if (mkdir (user_home, 0)) { 相当于没有参数 -p 的mkdir /u01/oracle
建了/u01/oracle 有useradd:警告:此主目录已经存在。
不从 skel 目录里向其中复制任何文件 是因为 if (access (user_home, F_OK)) { 这个 /u01/oracle目录已经存在
所以只有只指定不含子路径的时候才能没有警告出现
cp /etc/skel/.bash_profile /u01/oracle
cp /etc/skel/.bashrc /u01/oracle
cp /etc/skel/.bash_logout /u01/oracle
这样既可。
安装Oracle,新建组、用户的时候的一个错误的更多相关文章
- oracle新建登录用户sql语句
CREATE TABLESPACE TEST_DBDATAFILE '/mnt/data/oracledata/TEST_DB .dbf' SIZE 5000M AUTOEXTEND ONUNIFOR ...
- 安装oracle 11g时,报启动服务出现错误,找不到OracleMTSRecoveryService的解决方法
很多人在安装orcl数据库时,出现很多报错,我也不例外,因上次数据库出现问题,无法修复,只能从新安装,无奈的是,安装时报启动服务出现错误,找不到OracleMTSRecoveryService错MMP ...
- Win7/Win8 系统下安装Oracle 10g 提示“程序异常终止,发生未知错误”的解决方法
我的Oracle 10g版本是10.2.0.1.0,(10.1同理)选择高级安装,提示“程序异常终止,发生未知错误”. 1.修改Oracle 10G\database\stage\prereq\db\ ...
- Oracle新建用户、角色,授权,建表空间
oracle数据库的权限系统分为系统权限与对象权限.系统权限( database system privilege )可以让用户执行特定的命令集.例如,create table权限允许用户创建表,gr ...
- linux环境下安装oracle数据库 原文在卡卡100http://www.cnblogs.com/kaka100
centos55_oracle11gr2_install 第一个阶段:安装centos55 a:安装centos5.5 用图形界面安装 硬盘 16G 注意:用图形界面安装.. 第二个阶段:配 ...
- CentOS 7 安装 Oracle 11.2.0.4
一.安装环境 CentOS Linux release 7.2.1511 (Core) Oracle Database 11g Release 2 (11.2.0.4) 二.安装前准备 2.1 修改主 ...
- Centos安装Oracle及问题处理
安装Oracle前准备 创建运行oracle数据库的系统用户和用户组 [jonathan@localhost ~]$ su root #切换到root Password: [root@localhos ...
- Centos 6下安装Oracle 11gR2
一.安装环境 CentOS release 6.7 (Final) Oracle Database 11g Release 2 二.安装前准备 #修改主机名 修改/etc/sysconfig/netw ...
- Virtualbox环境中安装Oracle 11gr2 RAC(ASM)
系统Oracle Linux 6.5,Oracle 11.2.0.1 终于开始安装ASM和RAC的行程了.开始前需要想清楚的几个事情: 如何规划网络配置(配置多网卡,实现连通性,规划内外网,eth0, ...
随机推荐
- [问题解决] Tomcat Child not unique
错误: child not unique 发生场景: tomcat服务器 解决方案: 将tomcat中的server.xml文件配置: <Host name="localhos ...
- centos6.4-x86-64系统更新系统自带Apache Http Server
系统自带Apache Http Server 版本比较老,有漏洞.现在对Apache Http Server进行升级.总体思路:先删除老的,再安装新的.详细步骤如下: 1 删除老版本 1.1 删除老A ...
- android -上传文件到服务器
android上传文件到服务器 重点:最好是设置好content-type这些参数的配置! package com.spring.sky.image.upload.network; ...
- BZOJ 1101 [POI2007]Zap(莫比乌斯反演)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1101 [题目大意] 求[1,n][1,m]内gcd=k的情况 [题解] 考虑求[1,n ...
- Ubuntu 麒麟版下安装:Apache+php5+mysql+phpmyadmin.
摘要 LAMP是Linux web服务器组合套装的缩写,分别是Apache+MySQL+PHP.此文记录在Ubuntu上安装Apache2服务器,包括PHP5(mod_php)+MySQL+phpmy ...
- Yet Another Multiple Problem(bfs好题)
Yet Another Multiple Problem Time Limit : 40000/20000ms (Java/Other) Memory Limit : 65536/65536K ( ...
- Android MediaPlayer Error -1004
之前用Android自带的VideoView播放在线视频一直没问题的.今天突然碰到无法播放. MediaPalyer返回的错误代码是-1004,API文档上写的是:Bitstream is not c ...
- android技术牛人的博客[转]
Android+JNI调用–文件操作 开发环境:Windows xp sp3 +MyEclipse 8.6+android2.3.3+jdk1.6+android-ndk-r6b JNI概述: ...
- [置顶] ios 在一定选项范围随机选取选项demo
原创文章,转载请注明出处:http://blog.csdn.net/donny_zhang/article/details/9408285 demo功能:ios 在一定范围随机选取demo,如截屏.在 ...
- POJ1363:Rails
Description There is a famous railway station in PopPush City. Country there is incredibly hilly. Th ...