Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-19-2009, 04:23 PM   #1
LQ Newbie
Registered: Jun 2009
Distribution: Debian, K/ubuntu, Fedora
Posts: 7

Rep: Reputation: 0
chroot questions...

Ok I'm going to try to make this thread as easy to understand as possible so I'm going to break it down into a few sections, I think I'll start with a little info on the setup in question.

STR8132 ARM Based NAS
I'm running a little arm box with the original firmware still running. It uses the linux 2.6 kernel and I am able to execute scripts through the smb.conf file. The root file system loads to a ramdisk and cannot be modified with one exception. The last 128k is the /conf directory which can be modified and contains smb.conf, passwd, groups and some bt config info. On the attached 320GB SATA I have untarred a copy of the debian etch base system for arm and have managed to install netatalk, webmin and ldp. From the smb.conf file, using
root preexec = /conf/bd
where bd is the following shell script:
/mnt/data/public/debian/usr/sbin/chroot /mnt/data/public/debian/
/etc/init.d/ssh start
The call to
root preexec = /conf/bd
is located in the last line under the user 'mvh's configuration in smb.conf.

Now by default the nas automatically starts thttpd, smbd and bit tornado. I would like to disable these services but I cannot modify the original firmwares root file system. What I was wondering is that if I made a call to the shell script below if it would work considering the chroot executed above. Please note that this shell script would live in '/mnt/data/public/debian/etc/' and would be named 'kill_orig'. The 'kill_orig' script would be called in the last line on /conf/bd after it launches the sshd and would be executed by calling '/etc/kill_orig' as a result of the chroot. This all seems pretty trivial right? Well here is where the part I'm not getting comes in, so lets take a look at 'kill_orig'
/usr/sbin/chroot /
/etc/init.d/smb stop
/etc/init.d/httpd stop
/mnt/data/public/debian/usr/sbin/chroot /mnt/data/public/debian/
So I guess what I'm asking is can I chroot back to '/' kill the processes I'd like to kill and chroot back to the debian root without affecting anything? Also since smbd is launching these processes would they(they being sshd, netatalk, webmin) be considered child processes of smbd and as a result also be stopped?

Now the second part of this question has to do with smb.conf.
A - Does 'root preexec *' need to be called under a users configuration and be executed when that user logs in or can it called when smbd starts at boot somewhere in say the '[Global]' part of the smb.conf.

B - In my printer config part where it calls the different command such lpr, lpq, etc. It looks for them in '/usr/sbin' however they are not installed there and I can't put them there since the root fs is read only. However these tools do exist in '/mnt/data/public/debian/usr/sbin/' so should I put the full path to that in smb.conf even though there A - Either is a chroot in effect or B - A chroot will be in effect. Ok thats about it. Hope someone can help. Thanks!


chroot, smb

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
chroot to run hd-installed distro's programs from chroot in live distro? silencestone Linux - Software 0 10-12-2007 06:29 AM
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
Debian AMD64 chroot questions Arnaud_B Debian 13 05-05-2007 02:10 PM
mount command not working in chroot. and now chroot not working mohit.jain Linux From Scratch 5 07-14-2006 03:57 AM
chroot apache questions gypsy_rabbi Linux - Security 3 11-21-2004 05:12 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration