LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-05-2011, 05:37 AM   #1
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Rep: Reputation: 35
Question "/dev/tty: No such file or directory"


Hello

I'm trying to use Busybox's init on an appliance running uClinux, instead of the default simpleinit because Busybox's init unmounts partitions while simpleinit simply calls sync().

The issue I'm having, is that device nodes are created dynamically by /bin/mdev in /etc/rc... which seems to be called after the kernel has read /etc/inittab:

Code:
#/etc/inittab
# Startup the system
tty::sysinit:/bin/sh /etc/rc

# Set up a console shell
tty::respawn:/bin/login -f root
Code:
#/etc/rc
if [ -e /bin/mdev ] ; then
        echo /bin/mdev 2>/dev/null > /proc/sys/kernel/hotplug
        /bin/mdev -s 2> /dev/null
fi
As a result, the kernel can't launch a shell on tty:
Quote:
VFS: Mounted root (ext2 filesystem) on device 31:0.
Freeing unused kernel memory: 108k freed
can't open /dev/tty: No such file or directory
can't open /dev/tty: No such file or directory
Jan 1 00:00:16 (none) syslog.info syslogd started: BusyBox v1.16.2
...
process '/bin/login -f root' (pid 32) exited. Scheduling for restart.
It looks like a chicken and egg problem. Does someone know what to do?

Thank you.
 
Old 07-05-2011, 05:55 AM   #2
Karl Godt
Member
 
Registered: Mar 2010
Location: Kiel , Germany
Distribution: once:SuSE6.2,Debian3.1, aurox9.2+3,Mandrake?,DSL? then:W7st,WVHB, #!8.10.02,PUPPY4.3.1 now:Macpup
Posts: 314

Rep: Reputation: 45
Code:
tty1::respawn:/sbin/getty -n -l /bin/autologinroot 38400 tty1
Note : "autologinroot" is a binary created especially for "Puppy Linux"
Puppy linux actually uses busybox init

but with
Code:
##tty5::respawn:/sbin/getty -n -l "login -f root" 38400 tty5
I had no luck .
Error messages I cannot remember for now .

To create devices :
Code:
# cat /proc/devices | grep tty
3 ttyp
4 tty
4 ttyS
5 /dev/tty
188 ttyUSB

Code:
# ls -l /dev/tty*
crw-r--r-- 1 root root 5, 0 2001-02-13 19:39 /dev/tty
crw-r--r-- 1 root root 4, 0 2001-02-13 19:55 /dev/tty0
crw------- 1 root root 4, 1 2011-07-05 05:27 /dev/tty1
crw-r--r-- 1 root root 4, 10 2001-02-14 12:58 /dev/tty10


to create it manually
Code:
mknod /dev/tty1 c 4 1
See also the man pages of these commands , ie
Code:
man inittab
or
Code:
man mknod
especially
Code:
getty --help
 
Old 07-05-2011, 06:07 AM   #3
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Original Poster
Rep: Reputation: 35
Thanks for the help.

So you're saying that, even though dev nodes are created dynamically by mdev, I should run "mknod /dev/tty1 c 4 1" so that the tty1 is created so that init is happy with what's in inittab?

Where should I put "mknod /dev/tty1 c 4 1"?
 
Old 07-05-2011, 06:50 AM   #4
littlebigman
Member
 
Registered: Aug 2008
Location: France
Posts: 658

Original Poster
Rep: Reputation: 35
Found the solution: As the kernel command line included "console=ttyBF0,115200", the solution is two-fold:

1. Keep using "console" in the "sysinit" line, but
2. Use "ttyBF0" (not "tty") in the "respawn" line where we launch /bin/login

Code:
console::sysinit:/bin/sh /etc/rc

#BAD tty::respawn:/bin/login -f root
ttyBF0::respawn:/bin/login -f root
For some reason, /dev does include "tty" but Linux isn't happy about using it:
Quote:
process '/bin/login -f root' (pid 58) exited. Scheduling for restart.
can't open /dev/tty: No such device or address
HTH,
 
  


Reply



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
Mount userspace directory as "/dev" block device for USB Gadget API? Robert_A Programming 5 02-17-2011 02:26 AM
[SOLVED] Errors executing shell script: "command not found" and "no such file or directory" eko000 Linux - Newbie 1 01-14-2011 07:54 AM
"bad tty" & "file descriptor error" while building RPM on F13 gosssamer Linux - Software 7 12-28-2010 05:02 PM
"bad interpreter : no such file or directory" when configure "flex" acer_peri Linux - Software 10 11-10-2010 01:19 AM
2.4 kernel w/ devfs "/dev/tty1-8: No such file or directory" hedpe Linux - Software 0 05-19-2006 05:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:17 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