# xargs -o in jail (8.0)



## Wiedmann (Nov 30, 2009)

Hello all,

for some reasons, the upgrade to 8.0 was a shock.
--> ISDN was dropped, without a notice in the "Detailed Release Notes", and the hardware is still listed in the "Hardware Notes". That's really disappointing.

But back to the topic, assuming this "test.txt":

```
one
two
```

I can use this command in the base system:

```
xargs -o < test.txt
```

No I'm opening a jail shell with:

```
jexec 1 tcsh
```
and the above command gives me this error message:


> xargs: can't open /dev/tty: No such file or directory


If I'm starting a Midnight Commander in the jail, the above command is working.

And the message is correct, I can't see a "/dev/tty*" in the jail, only "/dev/pts/*". The jail is configured with (ezjail):

```
jail_example_devfs_enable="YES"
jail_example_devfs_ruleset="devfsrules_jail"
```
I don't have my own devfs.rules, and so "/etc/defaults/devfs.rules" is used.

Does "/etc/defaults/devfs.rules" not enabling tty, or I'm missing something else?

Regards,
Carsten


----------



## SirDice (Nov 30, 2009)

What happens if you use `# jexec 1 su -`?

I think it has to do with the way jexec works. Doing a su - seemed to have solved some problems for me too. So much so I made a small jsu script:


```
#!/bin/sh

jexec $1 /usr/bin/su $2 $3 $4 $5 $6
```


As for isdn4bsd missing, it's mentioned in /usr/src/UPDATING (I make a habbit of at least skimming it).


> 20080525:
> ISDN4BSD (I4B) was removed from the src tree. You may need to
> update a your kernel configuration and remove relevant entries.


----------



## Wiedmann (Nov 30, 2009)

> What happens if you use # jexec 1 su -?


The same.



> As for isdn4bsd missing, it's mentioned in /usr/src/UPDATING


Well, that can I only read after an upgrade to 8.0 (with freebsd-update) (and you must have the source tree). So as like other customers, I must rely on the infos at [1] (especially e.g. the hardware notes).

BTW: I was using capi4 bsd, and not isdn4bsd, because isdn4bsd doesn't work with active ISDN cards.

[1] http://www.freebsd.org/releases/


----------



## SirDice (Nov 30, 2009)

Good point about freebsd-update, I always use the source :e

I tried it on my system, I get the same error. Looking at /etc/defaults/devfs.rules there's no mention of tty in there. 

I tried it on a 7.2-STABLE machine with a jail and I get the same error. So it's not specific to 8.0. Looking at what *xargs -o* does, allowing a jail access to /dev/tty* may even be a security risk. Which is probably why it's not allowed by default. You can of course add your own rule(s) to /etc/devfs.rules and load those.


----------



## Wiedmann (Nov 30, 2009)

> Looking at /etc/defaults/devfs.rules there's no mention of tty in there.


Hm, in defrules_unhide_login (which is used from devfsrules_jail) I have a lot "add path 'tty?*' unhide", of course no "add path tty unhide" (like for pts".



> You can of course add your own rule(s) to /etc/devfs.rules and load those.


You mean I have to add a "add path tty unhide" to get this working?
(e.g. pkg_libchk is also using /dev/tty)


----------



## SirDice (Nov 30, 2009)

I only played with devfs.rules a couple of time in combination with jails. Try using the rule number instead of it's name in /etc/rc.conf. I seem to recall some issues with it.


----------



## Wiedmann (Dec 3, 2009)

&quot said:
			
		

> allowing a jail access to /dev/tty* may even be a security risk. Which is probably why it's not allowed by default.


OK, have found the "problem". This only occurs if you jexec to a jail. Because in this case the console is still owned by the main system and a jail can't access this. If you ssh or telnet into a jail you have a tty.

So it's all ok (just something we must know) 



			
				&quot said:
			
		

> I was using capi4 bsd, and not isdn4bsd, because isdn4bsd doesn't work with active ISDN cards.


And the latest isdn4bsd (I4B) still doesn't support active ISDN card. But after some work with (the old) C4B it runs now also with 8.0 and my capi and fax server is up again


----------

