LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-09-2013, 03:54 AM   #1
santosh0705
LQ Newbie
 
Registered: Oct 2002
Location: INDIA
Posts: 4

Rep: Reputation: 0
Running xinetd in chroot jail


I'm running an application in chroot jail environment. Now I need to run tftpd inside it. My doubt is can I run xinetd inside chroot jail? my host Linux system is already running an instance of xinetd.

Your valuable inputs are highly appreciated.
 
Old 10-09-2013, 07:22 AM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
When I want to run an X application from chroot I use:
Code:
xhost +
From the host and chroot using this script in the root directory of the chroot ( you may want to tweak it )
Code:
#!/bin/bash -e

LFS=$(pwd)
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys

if [ -h $LFS/dev/shm ];then
	link=$(readlink $LFS/dev/shm)
	mkdir -p $LFS/$link
	mount -vt tmpfs shm $LFS/$link
	unset link
else
	mount -vt tmpfs shm $LFS/dev/shm
fi

chroot "$LFS" /usr/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash --login
end then inside choot run
Code:
export DISPLAY=192.168.1.177:0
xterm
Obviously change your IP etc to suit your own situation.
 
Old 10-09-2013, 07:47 AM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by santosh0705 View Post
I'm running an application in chroot jail environment. Now I need to run tftpd inside it. My doubt is can I run xinetd inside chroot jail? my host Linux system is already running an instance of xinetd.
Why would you need to run xinetd in the jail?

Just run the tftpd server. The only function xinetd provides is a bit of memory optimization by not running services all the time - it only runs the one being requested. If tftpd is the only service, then xinetd is not needed - just run tftpd.
 
Old 10-09-2013, 06:37 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Good advice from jpollard

@Keith Hedger: xinetd is not an X11 util; see http://www.linuxtopia.org/online_boo...rappers-xinetd
 
Old 10-10-2013, 02:31 AM   #5
santosh0705
LQ Newbie
 
Registered: Oct 2002
Location: INDIA
Posts: 4

Original Poster
Rep: Reputation: 0
@jpollard: thank you for your reply.

Actually my app is backed by Cobbler and I need Cobbler should manage the tftpd, Cobbler only manage the tftpd and its own python based tftp servers and both are using xinetd

I can run atftp server but Cobbler will not manage it

My host Linux OS is already running an instance of xinetd, just wanted to know can I run an another instance of xinetd inside chroot?
 
Old 10-10-2013, 02:40 AM   #6
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150

Rep: Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856Reputation: 856
Quote:
Originally Posted by chrism01 View Post
Good advice from jpollard

@Keith Hedger: xinetd is not an X11 util; see http://www.linuxtopia.org/online_boo...rappers-xinetd
I know xinitd is not an xapp I was pointing out an easier way to start an x app from chroot, rather than running a full blown X server, guess I should have said that in words of one syllable
 
Old 10-10-2013, 04:24 AM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by santosh0705 View Post
@jpollard: thank you for your reply.

Actually my app is backed by Cobbler and I need Cobbler should manage the tftpd, Cobbler only manage the tftpd and its own python based tftp servers and both are using xinetd

I can run atftp server but Cobbler will not manage it

My host Linux OS is already running an instance of xinetd, just wanted to know can I run an another instance of xinetd inside chroot?
From skimming the documentation on Cobbler (admittedly a quick one), it looks more like it would require a lot of modifications to work properly in a chroot jail. Cobbler doesn't look like it is designed for that (the number of required packages to be installed before it works is one indicator).

It would likely be easier to get it working in a VM.
 
Old 10-10-2013, 04:27 AM   #8
santosh0705
LQ Newbie
 
Registered: Oct 2002
Location: INDIA
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Keith Hedger View Post
I know xinitd is not an xapp I was pointing out an easier way to start an x app from chroot, rather than running a full blown X server, guess I should have said that in words of one syllable
Hi Keith Hedger,
My required services are running fine in my chroot. so its not an issue of running app in chroot its all about running the xinetd service in chroot while the host OS simultaneously running one.
 
Old 10-10-2013, 04:51 AM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by santosh0705 View Post
Hi Keith Hedger,
My required services are running fine in my chroot. so its not an issue of running app in chroot its all about running the xinetd service in chroot while the host OS simultaneously running one.
The problem isn't "will it run", yes it will run.

The problem is complexity. Once both are running, which xinetd service is to be directed to reload its configuration? There are now two directory trees for managment - one in the chroot jail... External support gets more complicated - you end up having to either modify the external support... or put it into the jail as well. And based on looking at Cobbler, that could get complicated.
 
  


Reply

Tags
chroot, jail, xinetd



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
[SOLVED] Chroot jail or Root jail bayprince Linux - Newbie 3 07-25-2011 07:43 PM
Chroot jail Gimpy Linux - Software 10 05-07-2010 01:30 PM
[SOLVED] chroot jail problem: 'empty' jail MatrixS_Master Linux - Security 4 03-27-2010 06:25 AM
Chroot jail pachanga Linux - General 12 09-26-2008 05:15 AM
Perl not running backticks within chroot jail Consul Linux - Security 2 08-02-2005 05:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:10 AM.

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