-
Senior Member
registered user
@klaus2008
If I understand correctly, the /etc/init.d/knoppix-startx file
has a single long line to which you merely add material via a tee command.
I dont look for every instance of 'startx', do I?
And that I should save a copy of the init.d file before so editing.
Have I got that right?
Last edited by utu; 07-31-2010 at 12:13 AM.
-
Senior Member
registered user
@utu:
The file /etc/init.d/knoppix-startx is a file with many lines of code. But there is only one long line with startx being issued.
Code:
su -l -c "export STARTUP=$STARTUP ; exec /usr/bin/startx -- vt5 -dpi "$DPI" -br -noreset -nolisten tcp" "$USER" </dev/tty5 >/dev/tty5 2>&1 ; RC="$?"
I changed this line so that the output goes into a log file and to virtual terminal #6 instead of vt #5 since vt #5 is invisible while the Xserver is running.
Code:
su -l -c "export STARTUP=$STARTUP ; exec /usr/bin/startx -- vt5 -dpi "$DPI" -br -noreset -nolisten tcp" "$USER" </dev/tty5 2>&1 | /usr/bin/tee -a /var/log/knoppix-startx-dev-tty5.log >/dev/tty6 ; RC="$?"
I think it is always a good idea to make a backup copy of the file before altering it.
-
![Quote](images/misc/quote_icon.png)
Originally Posted by
klaus2008
@utu:
The file /etc/init.d/knoppix-startx is a file with many lines of code. But there is only one long line with startx being issued.
Code:
su -l -c "export STARTUP=$STARTUP ; exec /usr/bin/startx -- vt5 -dpi "$DPI" -br -noreset -nolisten tcp" "$USER" </dev/tty5 >/dev/tty5 2>&1 ; RC="$?"
I changed this line so that the output goes into a log file and to virtual terminal #6 instead of vt #5 since vt #5 is invisible while the Xserver is running.
Code:
su -l -c "export STARTUP=$STARTUP ; exec /usr/bin/startx -- vt5 -dpi "$DPI" -br -noreset -nolisten tcp" "$USER" </dev/tty5 2>&1 | /usr/bin/tee -a /var/log/knoppix-startx-dev-tty5.log >/dev/tty6 ; RC="$?"
I think it is always a good idea to make a backup copy of the file before altering it.
One can also make a backup of knoppix-data.XXX to be certain that whatever changes are made can be entirely overridden in case a problem develops unexpectedly. Sometimes things just start acting goofy without much in the way of clues about what is needed to fix it.
Cheers!
Krishna
-
Senior Member
registered user
@klauss2008:
Houston, we have a problem.
This line has a syntax error, according to Knoppix, cut-and-pasted from my new /etc/init.d/knoppix-startx:
su -l -c "export STARTUP=$STARTUP ; exec /usr/bin/startx -- vt5 -dpi "$DPI" -br -noreset -nolisten tcp" "$USER" </dev/tty5 2>&1 | /usr/bin/tee -a /var/log/knoppix-startx-dev-tty5.log >/dev/tty6 ; RC="$?"
This is the line you suggested, cut-and-pasted from Knoppix forum:
su -l -c "export STARTUP=$STARTUP ; exec /usr/bin/startx -- vt5 -dpi "$DPI" -br -noreset -nolisten tcp" "$USER" </dev/tty5 2>&1 | /usr/bin/tee -a /var/log/knoppix-startx-dev-tty5.log >/dev/tty6 ; RC="$?"
-
Senior Member
registered user
@Klauss2008:
The original Knoppix line ends with:
"$USER" </dev/tty5 >/dev/tty5 2>&1 ; RC="$?"
Should we now have at this point:
"$USER" </dev/tty5 >/dev/tty5 2>&1; | /usr/bin/tee...
-
Senior Member
registered user
I/O Redirection
@utu:
Code:
exec /usr/bin/startx -- vt5 -dpi "$DPI" -br -noreset -nolisten tcp </dev/tty5 >/dev/tty5 2>&1
The intention is to direct input from /dev/tty5 to the program /usr/bin/startx and redirect the output from stdout and stderr to /dev/tty5. But the output is invisible while the Xserver is running.
Code:
exec /usr/bin/startx -- vt5 -dpi "$DPI" -br -noreset -nolisten tcp </dev/tty5 2>&1 | /usr/bin/tee -a /var/log/knoppix-startx-dev-tty5.log >/dev/tty6 ; RC="$?"
The aim is to redirect /usr/bin/startx's output (stdout plus stderr) to /usr/bin/tee via a pipe. The program /usr/bin/tee appends its input to the file /var/log/knoppix-startx-dev-tty5.log or creates that file if it does not exist. In addition the tee program's output is redirected to /dev/tty6.
If you do not need the output on a terminal then you could try
Code:
su -l -c "export STARTUP=$STARTUP ; exec /usr/bin/startx -- vt5 -dpi "$DPI" -br -noreset -nolisten tcp" "$USER" </dev/tty5 >>/var/log/knoppix-startx-dev-tty5.log 2>&1 ; RC="$?"
Maybe you are interested in reading more about I/O Redirection in the Advanced Bash-Scripting Guide: http://tldp.org/LDP/abs/html/io-redirection.html
There is also a simple example of using a pipe in the BASH Programming - Introduction HOW-TO http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-4.html
If you write a semicolon ; then the Bash thinks that you want to mark the end of a command. In the example
Code:
</dev/tty5 >/dev/tty5 2>&1; | /usr/bin/tee
is no program that delivers input to the pipe. Thus you should get an error message.
-
Senior Member
registered user
@klauss2008
I appreciate your tutelage, but I'd like to stick with your first suggestion.
As near as I can tell, I have exactly input your first proposed command.
If I have, there is a syntax error in it.
If I haven't then I can't see the difference.
Perhaps you can look more closely at my post #24, forget my post #25, and
see what needs to be done.
I think this might be the simplest way to proceed at this point.
I grasp your idea, but I'd like to defer 'understanding' the syntax to later.
So, is there a difference in the two lines I posted in #24?
Thanks for your patience.
-
Senior Member
registered user
@utu:
I do not see the difference between the two lines in your post #24. I put the old and the new knoppix-startx in a zip file so that you can compare them yourself. I do not get any syntax error messages and the log file is created as expected.
knoppix-startx.zip
-
Senior Member
registered user
![Quote](images/misc/quote_icon.png)
Originally Posted by
utu
As near as I can tell, I have exactly input your first proposed command.
If I have, there is a syntax error in it.
If I haven't then I can't see the difference.
How do you know that there is a syntax error ? Did you arrive at the conclusion based on the log file produced ? But 'tee' command appends to the log, so it could be the previous 'startx' which produced the syntax error. I suggest you remove the '-a' in the 'tee' command and test it again. This will make sure you are not seeing the history.
-
Senior Member
registered user
@kl522 & klauss2008
Doing as root...
Having revised /knoppix-startx, either with or without -a in the tee command,
when I ctl-alt-backspace, I get the syntax error, and am locked out of X for 5 min.
Reboot gives the same syntax & lock-out situation
I get back here by re-writing knoppix-startx from knoppix-startx.orig
which I saved before we began tinkering with X itself.
I get the idea, however, this is not actually the file I want per se.
This file probably duplicates only a segment of the whole on-screen experience
that originally got my curiosity.
I can probably figure out the syntax problem on my own, eventually, I just thought
it might be obvious to some of the old hands at this.
If I can't figure this problem out in a short while, I think I need to research the init process
and get to understand it better. I've always felt like a daredevil when tinkering with
the guts of the X machinery up close.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
![Juniper EX2300-C-12P, 12 Port FANLESS POE Ethernet Switch EX2300-C picture](/store/img/g/bCoAAOSw~05mYznc/s-l225/Juniper-EX2300-C-12P-12-Port-FANLESS-POE-Ethernet-.jpg)
Juniper EX2300-C-12P, 12 Port FANLESS POE Ethernet Switch EX2300-C
$375.00
![Juniper Networks EX2300-C-12T Compact 12-Port EX2300-C Series Ethernet Switch picture](/store/img/g/Dh4AAOSw3Chmbx7U/s-l225/Juniper-Networks-EX2300-C-12T-Compact-12-Port-EX23.jpg)
Juniper Networks EX2300-C-12T Compact 12-Port EX2300-C Series Ethernet Switch
$300.00
![Juniper Networks EX3300 EX3300-48P 48-Port Gigabit PoE+ Switch picture](/store/img/g/QUAAAOSw9lllAhVU/s-l225/Juniper-Networks-EX3300-EX3300-48P-48-Port-Gigabit.jpg)
Juniper Networks EX3300 EX3300-48P 48-Port Gigabit PoE+ Switch
$59.95
![Juniper EX3400-48P 48 Port Switch PoE+ 4x SFP+ 2x QSFP 1xAC *Tested/Warranty* picture](/store/img/g/YkgAAOSwqztlzUSp/s-l225/Juniper-EX3400-48P-48-Port-Switch-PoE-4x-SFP-2x-QS.jpg)
Juniper EX3400-48P 48 Port Switch PoE+ 4x SFP+ 2x QSFP 1xAC *Tested/Warranty*
$139.95
![Juniper Networks EX3300-24P | 24 Port Gigabit Network Switch w/ Power cord picture](/store/img/g/MswAAOSwuMBl7vhO/s-l225/Juniper-Networks-EX3300-24P-24-Port-Gigabit-Networ.jpg)
Juniper Networks EX3300-24P | 24 Port Gigabit Network Switch w/ Power cord
$53.99
![Juniper Networks EX3300 48-Port Gigabit Switch 4x SFP+ EX3300-48T SKU 10581 picture](/store/img/g/lB0AAOSw5zJmhFhl/s-l225/Juniper-Networks-EX3300-48-Port-Gigabit-Switch-4x-.jpg)
Juniper Networks EX3300 48-Port Gigabit Switch 4x SFP+ EX3300-48T SKU 10581
$69.99
![Juniper Networks EX2200-C Gigabit Ethernet Managed Switch | EX2200-C-12P-2G picture](/store/img/g/BjYAAOSw7dJmiFRm/s-l225/Juniper-Networks-EX2200-C-Gigabit-Ethernet-Managed.jpg)
Juniper Networks EX2200-C Gigabit Ethernet Managed Switch | EX2200-C-12P-2G
$49.99
![Juniper Networks SRX320-POE 6-Port Service Gateway Security Appliance Tested picture](/store/img/g/dRYAAOSweq5led2G/s-l225/Juniper-Networks-SRX320-POE-6-Port-Service-Gateway.jpg)
Juniper Networks SRX320-POE 6-Port Service Gateway Security Appliance Tested
$149.99
![Juniper Networks EX4400-48MP 48 port 5GbE + 12 port 10 Gigabit PoE++ Switch -NEW picture](/store/img/g/QesAAOSw07hmSVQ3/s-l225/Juniper-Networks-EX4400-48MP-48-port-5GbE-12-port-.jpg)
Juniper Networks EX4400-48MP 48 port 5GbE + 12 port 10 Gigabit PoE++ Switch -NEW
$1200.00
![Juniper QFX5100-48T 48-Port 10G SFP 6-Port 40G QSFP Ethernet Switch Tested picture](/store/img/g/t28AAOSwc-hmcfsQ/s-l225/Juniper-QFX5100-48T-48-Port-10G-SFP-6-Port-40G-QSF.jpg)
Juniper QFX5100-48T 48-Port 10G SFP 6-Port 40G QSFP Ethernet Switch Tested
$312.69