Error attempting to run alsamixer


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Error attempting to run alsamixer
# 8  
Old 01-23-2019
Ubuntu 16.04 is the distribution of my PC. Are you wondering what the version of the kernel on the embedded device is? The kernel version on the device is: 2.6.35.14
# 9  
Old 01-24-2019
I am wondering not just the kernel of the embedded device, but what software is running on it!
# 10  
Old 01-24-2019
U-Boot 2009.08 - dub-1.5.2.1 - GCC 4.4.6 - DigiOpenGL - crosstool-ng-1.20.0
# 11  
Old 01-25-2019
So, no init system or anything? Your terminal probably hasn't been set up. This is a surprisingly tricky bit of "magic" done with a special syscall which we're for the most part happy to let some linux distribution do for us.

One workaround for it, funny enough, could be ssh-ing into your device. A virtual terminal should be close enough.

I was sure that busybox had a utility for it, and their faq turns out to have that and a better explanation what it does:

Quote:
"Why do I keep getting "sh: can't access tty; job control turned off" errors? Why doesn't Control-C work within my shell?"

Job control will be turned off since your shell can not obtain a controlling terminal. This typically happens when you run your shell on /dev/console. The kernel will not provide a controlling terminal on the /dev/console device. You should run your shell on a normal tty such as tty1 or ttyS0 and everything will work.

Example: you booted into your machine with init=/bin/sh and got "sh: can't access tty" error because sh has its stdio opened to /dev/console. You want to reopen stdio to, say, /dev/tty1 and thus acquire a controlling tty.

Code:
    # Let's try this:
    exec </dev/tty1 >/dev/tty1 2>&1
    # No, doesn't work: even if opening /dev/tty1 gave sh the ctty,
    # sh wouldn't know it - it checks for ctty just once at startup.

    # Let's try re-execing sh:
    exec </dev/tty1 >/dev/tty1 2>&1
    exec sh
    # Got "sh: can't access tty" again. Why?
    # The reason is somewhat obscure: kernel starts process with PID=1
    # (in this case, shell) with SID=0 and PGID=0, not with SID=1 and PGID=1
    # as you'd expect. IOW: our sh is not a session leader, and therefore
    # cannot acquire ctty by opening /dev/tty1 (or any other tty).

    # Let's try making us a session leader:
    exec setsid sh
    exec </dev/tty1 >/dev/tty1 2>&1
    exec sh
    # Yes, this worked!

    # This can be combined into one command,
    # but need to be careful and perform these operations
    # in the correct order:
    # 1. make ourself session leader,
    # 2. open /dev/tty1 and thus acquire a ctty,
    # 3. re-execute the shell, allowing it to notice that it has a ctty:
    exec setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'

These 2 Users Gave Thanks to Corona688 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

When I run the code yesterday I am getting output,when I run same code today I am getting error?

If run the below code today its creating all directory and getting output files,I f run same code tomorrow I am getting error. can any one give suggestion to sortout this error. OSError: no such file or directory : '062518'My code looks like this import paramiko import sys import os ... (8 Replies)
Discussion started by: haribabu2229
8 Replies

2. Linux

Problem with ALSAMIXER

Hi Team, Am trying to open alsamixer via command line but am getting the following error. $ alsamixer Home directory /home/root not ours. ALSA lib pulse.c:229:(pulse_connect) PulseAudio: Unable to connect: Connection refused cannot open mixer: Connection refused Even am opening as... (2 Replies)
Discussion started by: Adhi
2 Replies

3. SuSE

Attempting to use AutoYaST with SLES11SP2

We currently have a setup with SLES11SP1 where we have an AutoYaST ISO set up for automated network installs. I'm attempting to port this to SP2 to make new installs current, but I'm running into a few problems. The process seems the same, and after running mkisofs to build a new SP2 ISO the... (0 Replies)
Discussion started by: Magus Zeal
0 Replies

4. Debian

attempting to boot from cd rom

i just installed Debian Lenny on HP DL380. After the server rebooted, it still asks for me to insert a cd rom. where can I exactly check the settings for the boot menu? Should it use the hard disk since I didnt insert any cd? pls advise (1 Reply)
Discussion started by: lhareigh890
1 Replies

5. Shell Programming and Scripting

"directory checksum error" when attempting to install tcl

OS: HP-UX Programs I want to install: expect and tcl I'm lost. I bought the book. I began reading the book. I want to install expect. I've been able to download the .z, and extract it successfully. But, of course, it apparently needs tcl and possibly tk also, and ... I... (0 Replies)
Discussion started by: instant000
0 Replies

6. Red Hat

attempting to install chkconfig 1.3.5

Hi there everyone, I'm using redhat 7.3 at the moment and am currently trying to install chkconfig-1.3.5-3.i386.rpm , but when I type this command: rpm -Uvh chkconfig-1.3.5-3.i386.rpm I get the following error: error: failed dependencies: chkconfig = 1.2.24 is needed by... (3 Replies)
Discussion started by: redhat_newb101
3 Replies

7. UNIX for Dummies Questions & Answers

attempting to break within function

Attempting to break from a case/esac paragraph while inside of a function. When executing the code below, entering the letter 'a', will prove that the directory exists, but the break command works for the if/fi, but not for the case/esac. So, in my example below, if an A is entered, the function... (8 Replies)
Discussion started by: tumblez
8 Replies

8. IP Networking

Error with ifconfig when attempting to switch to 10baseT

In Darwin, when typing "ifconfig en0 media 10baseT/UTP mediaopt half-duplex" I recieve the error message "ifconfig: SIOCSIFMEDIA: Operation not permitted". The same thing occurs when I sudo the command. Any suggestions? Thanks... (1 Reply)
Discussion started by: tkarrde
1 Replies
Login or Register to Ask a Question