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
Code:
root preexec = /conf/bd
where bd is the following shell script:
Code:
/mnt/data/public/debian/usr/sbin/chroot /mnt/data/public/debian/
/etc/init.d/ssh start
The call to
Code:
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'
Code:
/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!
.:MvH:.