10 More Discussions You Might Find Interesting
1. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
Get each of these programs to run. Prove that you've done this(use script). Give a description of each program along with sample executions.
These are the exact programs we were given.
2. Relevant commands, code, scripts,... (11 Replies)
Discussion started by: FaTaL
11 Replies
2. UNIX for Dummies Questions & Answers
Hey guys,
Suppose i run passwd via bash shell. It is a suid program, which temporarily runs as root(owner) and modifies the user entries.
However, when i write a C file and give 4755 permission and root ownership to the 'a.out' file , it doesn't run as root in bash shell. I verified this by... (2 Replies)
Discussion started by: syncmaster
2 Replies
3. Shell Programming and Scripting
Hi does anyone know some good shell scripting programs, like visual studio for C++/C#? (8 Replies)
Discussion started by: Mack1982
8 Replies
4. UNIX for Dummies Questions & Answers
I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Discussion started by: t04st3r
0 Replies
5. UNIX for Advanced & Expert Users
How can you check the programs that you use most often? (6 Replies)
Discussion started by: cokedude
6 Replies
6. UNIX for Dummies Questions & Answers
Are the programs written on schedulers ,thread library , process management, memory management, et al called systems programs ? How are they different from the programs that implement functions like open() , printf() , scanf() , read() .. they have a prefix sys_open, sys_close, sys_read etc , right... (1 Reply)
Discussion started by: vishwamitra
1 Replies
7. Solaris
Hi,
I have installed Solaris 10 on a VMware. How to compile a java program as there is no javac in 'bin' directory. Thanks in advance for answers and sorry if the question is soo basic. (3 Replies)
Discussion started by: mayahari
3 Replies
8. Programming
Hi,
How to precompile the c program which has proc statements within it.
If it is only c, I will use the following cmd
cc filename.c -o output
so please tell me what command I have to use for precompilation.
I beleave that this is not an oracle or proc forum, but still I hope will... (1 Reply)
Discussion started by: sweta
1 Replies
9. Programming
:( :confused: Does anybody here know how to compile and run C++ programs in UNIX enviroment? I am so confused. Any help on this would be greatly appreciated! Thanks! (5 Replies)
Discussion started by: Kahuashi
5 Replies
10. UNIX for Dummies Questions & Answers
I notice that (Mandrake) Linux and Windows do not seem to operate alike in terms of installing third party software.
Windows, on one hand, creates icons and adds items to the Start Menu, with the help of the InstallShield--or equivalent, of course, but Linux, on the other hand, seems to care... (3 Replies)
Discussion started by: helvetica
3 Replies
chroot(8) System Manager's Manual chroot(8)
NAME
chroot - Changes the root directory of a command
SYNOPSIS
/usr/sbin/chroot directory command
DESCRIPTION
Only root can use the chroot command. The chroot command changes the root directory from / to the specified directory when the command
executes. (The command specified includes both the command name as well as any arguments.) Consequently, the root of any path (as indicated
by the first / (slash) in the pathname) changes to directory and is always relative to the current root. Even if the chroot command is in
effect, directory is relative to the current root of the running process.
Several programs may not operate properly after chroot executes. You must ensure that all vital files are present in the new root file
system and the relevant pathnames for the files map correctly in the new root file system.
For example, the ls -l command fails to give user and group names if the new root file system does not have a copy of the /etc/passwd and
/etc/group files. If the /etc/passwd and /etc/group files in the new root file system represent different user and group names, then the
output from the ls -l command will be based on those names, not the ones for the system's own name database. Utilities that depend on
description files produced by the ctab command may also fail if the required description files are not present in the new root file system.
The chroot program uses the execv() function to invoke the specified command. As a consequence, the command specified must be an exe-
cutable binary, not a shell script. Further, if the program requires indirect loading (for example, due to unresolved symbols requiring
use of a shared library), then /sbin/loader as well as any files it requires (for example, shared libraries) must be present in the new
root file system in the appropriate locations.
EXAMPLES
To run a subshell with another file system as the root, enter a command similar to the following. Note in this example, the file system is
on the /dev/disk/dsk13a device and is mounted to /mnt/dsk13a: chroot /mnt/dsk13a /sbin/sh The command shown in the previous example spec-
ifies a change from the current root file system to the one mounted on /mnt/dsk13a while /sbin/sh (which itself is relative to the new root
file system) executes. When /bin/sh executes, the original root file system is inaccessible. The file system mounted on /mnt/dsk13a must
contain the standard directories of a root file system. In particular, the shell looks for commands in /sbin, /bin, and /usr/bin (among
others) on the new root file system.
Running the /sbin/sh command creates a subshell that runs as a separate process from the original shell. Press to exit the subshell and
return to the original shell. This restores the environment of the original shell, including the meanings of the current directory (.) and
the root directory (/). To run a command in another root file system and save the output on the initial root file system, enter a command
similar to the following. Note in this example, the file system is on the /dev/disk/dsk13a device and is mounted to /mnt/dsk13a:
chroot /mnt/dsk13a /bin/cc -E /u/bob/prog.c > prep.out
The previous command runs the /bin/cc command with /mnt/dsk13a as the specified root file system. It compiles the /mnt/dsk13a/u/bob/prog.c
file, reads the #include files from the /mnt/dsk13a/usr/include directory, and puts the compiled text in the prep.out file on the initial
root file system. To create a file relative to the original root rather than the new one, use this syntax and enter:
chroot directory command > file
CAUTIONS
If special files in the new root have different major and minor device numbers than the initial root directory, it is possible to overwrite
the file system.
FILES
Specifies the command path.
RELATED INFORMATION
Commands: cc(1), cpp(1), ls(1), sh(1)
Functions: chdir(2), chroot(2) exec(2) delim off
chroot(8)