Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Iso - remaster script trying to start chroot run commands then exit but host system gets messed up Post 303039785 by Corona688 on Tuesday 15th of October 2019 12:38:29 PM
Old 10-15-2019
I've never heard of chrootbeg, google's never heard of chrootbeg, and my system doesn't have it. I think you took someone's instructions a little too literally. Those are labels for you, telling you 'run all this stuff in a chroot'.

Further, chroot doesn't work that way, neither does sudo nor any other shell. No interpreter will stop in the middle, start executing a totally different language, then return to where you were without being asked -- if you want to put commands into something else, you have to tell the shell to put them there.

chroot works like:

Code:
chroot /path/to/newroot /bin/sh

...and from there on out, reads interactively. Though simple commands will work noninteractively. (apt-get and the like are prone to prompt you for y/n, so your mileage may vary.) You could put the inside-chroot stuff into a script file and run it:

Code:
chroot /path/to/newroot /bin/sh < /path/to/scriptfile


Last edited by Corona688; 10-15-2019 at 02:15 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

2. UNIX for Dummies Questions & Answers

How to start a chroot jail?

I was reading an article on how it is very important to setup a chroot jail to run bind. I can follow what the article says but one thing I am unclear about is now on system boot the BIND process in the chroot jail will start since it the owner will no longer be root but some other user. Can... (1 Reply)
Discussion started by: mojoman
1 Replies

3. Shell Programming and Scripting

running commands to remote host from centralized host

Gurus/Experts We have a centralized UNIX/Solaris server from where we can actually ssh to all other UNIX/Solaris servers...I need to write a script that reside on this centerlized server and do FileSystem monitoring (basically run df -h or -k) of other remote servers and then send an email to me... (6 Replies)
Discussion started by: anjum.suri
6 Replies

4. Shell Programming and Scripting

fuser exit code different when script is run from cron

Hi, I am writing a bash script (running on Centos 5.4) to process video (.MTS) files which may have appeared in a certain directory. The files will be dragged and dropped there from a Windows box using Samba, and the script is to check periodically (i.e. run from cron) whether any new .MTS... (0 Replies)
Discussion started by: Palamedes
0 Replies

5. UNIX for Dummies Questions & Answers

Run a script on remote host

Hi, I wish to run a script located on a remote host machineB from machineA. I am using ssh and running the below on machineA. However, the ssh does not seem to work and freezes at ssh -l wlsadmin machineB -v Sun_SSH_1.1.2, SSH protocols 1.5/2.0, OpenSSL 0x0090704f debug1: Reading... (9 Replies)
Discussion started by: shifahim
9 Replies

6. Shell Programming and Scripting

HTML Code to Run a Script from Remote Unix Host

Hi All, Noticed few posts around this but coudnt get exatcly what i wanted. Thanks for your help again. I have a script running on a remote machine and i normally ssh from putty and run the script manually. Is there anyway that i can write an HTML Code with a button so taht when I Click... (1 Reply)
Discussion started by: robinbannis
1 Replies

7. Shell Programming and Scripting

How to run a shell script on a remote host using ftp

Hi, is there a way I can run a shell script through ftp on a remote host? The remote host doesn't have ssh running so I can't use ssh. (7 Replies)
Discussion started by: mrskittles99
7 Replies

8. UNIX for Dummies Questions & Answers

Creating chroot environment with an ISO file.

I decided to try creating a chroot environment with a BT5r2 iso file. I'm just wanting to run Backtrack from inside Debian without having to reboot into my other partition or use vmware. I found some documentation on how to do this with BT4 at this link: ... (0 Replies)
Discussion started by: Azrael
0 Replies

9. Shell Programming and Scripting

Run script on remote host

Hi friends, I have two servers. Server A and B. I want to run one script on server A by logging in to server B. Can anyone provide me code for this.? I tried it by using following ssh username@serverA ./script Then it prompt me the password. I give correct password of the server A. but it... (7 Replies)
Discussion started by: Nakul_sh
7 Replies

10. Shell Programming and Scripting

Inner script run and its exit status

Main Script #!/bin/ksh echo "Maimn script" ./clocal/www/web-data/WAS/WebSphere7/scripts/DealerLocator/Scripts/secondscript.ksh echo "$? = status" Sdecond Script #!/bin/ksh echo "In second SCript" exit 1 Output: Maimn script ./testmain.ksh:... (4 Replies)
Discussion started by: dineshaila
4 Replies
SCHROOT-SCRIPT-CONFIG(5)					   Debian sbuild					  SCHROOT-SCRIPT-CONFIG(5)

NAME
schroot-script-config - schroot chroot setup script configuration DESCRIPTION
schroot uses scripts to set up and then clean up the chroot environment. These scripts may be customised using the script-config key in /etc/schroot/schroot.conf. This key specifies a file which the setup scripts will source when they are run. The file is a Bourne shell script, and in consequence may contain any valid shell code, in addition to simple variable assignments. This will, for example, allow be- haviour to be customised according to the specific chroot type or name. This file is deprecated, but is still used if present; it will be obsoleted and removed in a future release. All the settings in this file are now settable using configuration keys in schroot.conf, as detailed below. Existing configuration should be modified to use these keys in place of this file. ENVIRONMENT
The environment is the same as for all setup scripts, described in schroot-setup(5). VARIABLES
The following variables may be set to configure setup script behaviour. Note that new variables may be added in future releases. Third- party extensions to schroot which add their own setup scripts may add additional variables which are not documented here; consult the extension documentation for further details. SETUP_COPYFILES A file containing a list of files to copy into the chroot (one file per line). The file will have the same absolute location inside the chroot. Note that this is settable using the setup.copyfiles key. SETUP_FSTAB The filesystem table file to be used to mount filesystems within the chroot. The format of this file is the same as for /etc/fstab, documented in fstab(5). The only difference is that the mountpoint path fs_dir is relative to the chroot, rather than the root. Note that this is settable using the setup.fstab key. Also note that mountpoints are canonicalised on the host, which will ensure that absolute symlinks point inside the chroot, but complex paths containing multiple symlinks may be resolved incorrectly; it is advised to not use nested symlinks as mountpoints. SETUP_NSSDATABASES A file listing the system databases to copy into the chroot. The default databases are 'passwd', 'shadow', 'group', 'services', 'protocols', 'networks', and 'hosts'. 'gshadow' is not yet copied by default, due to not being supported by all but the most recent version of the GNU C library. The databases are copied using getent(1) so all database sources listed in /etc/nsswitch.conf will be used for each database. Note that this is settable using the setup.nssdatabases key. AUTHORS
Roger Leigh. COPYRIGHT
Copyright (C) 2005-2012 Roger Leigh <rleigh@debian.org> schroot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SEE ALSO
sbuild(1), schroot(1), sh(1), schroot.conf(5), schroot-setup(5). Version 1.6.4 27 Oct 2012 SCHROOT-SCRIPT-CONFIG(5)
All times are GMT -4. The time now is 01:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy