.xinitrc not running script


Forum: HD Install
Topic: .xinitrc not running script
started by: vstech

Posted by vstech on Oct. 28 2007,02:48
I am almost done.. .but I can't get my .xinitrc script to run my script to start the slide show for my digital picture frame project.  The script works, when I run it from a shell window, it works fine... just does not seem to want to run from .xinitrc.

Below is the .xinitrc script... I have moved the line that calls the script I want to run,/mnt/hda1/mydsl/scripts/cron_start_frame.sh many different places (before and after the call to start fluxbox), I have put in the full path name, tried running it from the ramdisk home directory, from the hard drive, but the results are the same... no go.

the torsmo command seems to be upset that my laptop battery is dysfunctional, as it gave me an error, so I commented it out..... although I am not sure what that line does.

Any suggestions?  


# put X windows programs that you want started here.
# Be sure to add at the end of each command the &

KEYTABLE="$(getknoppixparam.lua KEYTABLE)"
DESKTOP="$(getoption.lua $HOME/.desktop wm)"
ICONS="$(getoption.lua $HOME/.desktop icons)"

umix -lf .umix 2>/dev/null

[ -f .mouse_config ] && sh .mouse_config &

/etc/init.d/dsl-functions

# For non-US Keyboards
if [ ${KEYTABLE:0:2} != "us" ]; then
 xmodmap -e "clear Mod4" -e "add Mod5 = Mode_switch" &
fi
if [ "$ICONS" == 1 ]; then
 for x in `ls -1 .xtdesktop/*.hide 2>/dev/null`; do rm -f ${x%.*}; done
 iconsnap.lua &>/dev/null &
 xtdesk.sh
fi
#if egrep -qv lowram /proc/cmdline 2>/dev/null; then
#fi

#torsmo 2 &
#>/dev/null &
# dillo /usr/share/doc/dsl/getting_started.html &>/dev/null
/mnt/hda1/mydsl/scripts/cron_start_frame.sh &
# xset s off
case $DESKTOP in
 fluxbox )
   fluxter &>/dev/null &
   wmswallow -geometry 70x80 docked  docked.lua &
   exec fluxbox 2 &>/dev/null  
 ;;
 jwm )
   ./.background
   sleep 2
   exec jwm 2>/dev/null
 ;;
 * )
#  torsmo 2>/dev/null &
 exec fluxbox 2 &
# >/dev/null
 ;;
esac

Posted by ^thehatsrule^ on Oct. 28 2007,03:08
I'm guessing it's not launching because /mnt/hda1 could possibly be not mounted yet?

Quote
...many different places (before and after the call to start fluxbox)...
Has to be before

Quote
tried running it from the ramdisk home directory
If you do it this way, make sure you have it saved i.e. in backup, and restored.

Also, your .xinitrc is a bit messed up. Instead of
Quote
exec fluxbox 2 &
# >/dev/null
it should be "fluxbox 2>/dev/null" though I don't think that should affect anything

Posted by jpeters on Oct. 28 2007,06:58
Quote (^thehatsrule^ @ Oct. 27 2007,23:08)
Also, your .xinitrc is a bit messed up. Instead of
Quote
exec fluxbox 2 &
# >/dev/null
it should be "fluxbox 2>/dev/null" though I don't think that should affect anything

...same error after 'fluxbox )'

It looks like this was edited, so maybe "fluxter -w &>/dev/null &" ?
(that's how it is on my copy)

Posted by vstech on Oct. 28 2007,12:25
Yes, the script is edited and now messed up a bit.. I had removed the >null parts thinking maybe it would show an error message (if there was one ) so that I could find the problem.

hda1 is already mounted by bootlocal.sh

Posted by mikshaw on Oct. 28 2007,13:29
Code Sample
/mnt/hda1/mydsl/scripts/cron_start_frame.sh &
Is this a graphical or non-graphical application? It's possible that it actually is running, but since it's being run directly from .xinitrc maybe it's putting everything out to tty1

Try this:
Code Sample
aterm -e /mnt/hda1/mydsl/scripts/cron_start_frame.sh &

Posted by vstech on Oct. 28 2007,17:26
Quote (mikshaw @ Oct. 28 2007,08:29)
Try this:
Code Sample
aterm -e /mnt/hda1/mydsl/scripts/cron_start_frame.sh &

Ok, I tried adding the code you show here, but it did not make a difference that I could tell.  I replaced my line that calls the cron_start_frame.sh with your code.
Posted by jpeters on Oct. 28 2007,17:42
Quote (vstech @ Oct. 28 2007,12:26)
Quote (mikshaw @ Oct. 28 2007,08:29)
Try this:
Code Sample
aterm -e /mnt/hda1/mydsl/scripts/cron_start_frame.sh &

Ok, I tried adding the code you show here, but it did not make a difference that I could tell.  I replaced my line that calls the cron_start_frame.sh with your code.

I've never used cron, but assume you've got  /etc/crontab correctly edited and working the way you want? edit: might be interesting to see if other cron scripts work from .xinitrc

Posted by ^thehatsrule^ on Oct. 28 2007,18:45
Quote
...same error after 'fluxbox )'

It looks like this was edited, so maybe "fluxter -w &>/dev/null &" ?
(that's how it is on my copy)
No, that's not a problem if that application is not used. However, having the stranded "2" in "exec fluxbox 2 &" is incorrect...

vstech: if you want to see errors from your script, you could either check the console VT (i.e. ctrl+alt+f1) or use a log, such as
Code Sample
/mnt/hda1/mydsl/scripts/cron_start_frame.sh &>startframe.log &
then look in ~/startframe.log

It also may be helpful to show the contents of that script, as well as a `ls -l` of it.

Posted by vstech on Oct. 28 2007,19:24
ok,

thehatsrule, I added the line to make a log script, but no script is ever made... I am thinking the line is never executed to run the cron_start_frame.sh, but I have moved that line all around the .xinitrc script and NEVER get a log file.

Here is the contents of the cron_start_frame.sh:

#!/bin/sh
#
#Script to run Digital Picture Frame using FEH


#hide the cursor after 15 seconds
/usr/X11R6/bin/unclutter -idle 5 &
/etc/init.d/dsl-functions

#start slide show
/usr/bin/feh -qxzrZF -D 10 /mnt/hda6/pictures/*.* &

exit 0

as for the ls -l of the cron_start_frame.sh, the owner is dsl, the group staff, and I did a chmod of 777 on it to be sure it was executable.  

It does run when executed from a shell window... runs great in fact, just does not run from the .xinitrc script.

Posted by curaga on Oct. 28 2007,20:29
/etc/init.d/dsl-functions

is not needed, but if you want it, it should be

. /etc/init.d/dsl-functions

Posted by mikshaw on Oct. 28 2007,20:49
After starting X, press Ctrl+Alt+F1 (Alt+ one of the other F keys depending on your setup to return to X) and look to see if there are any error messages listed from the xinit script. You can use Alt+PageUp if you need to scroll up.

I think it's very strange that you can run cron_start_frame.sh from a terminal window, but the very same command doesn't work from .xinitrc

Posted by vstech on Oct. 29 2007,00:53
I tried the alt-ctr-f1 and all I see is a bright blue screen???

alt-ctrl-f2 brings me back to my desktop, all the other combinatoins (f3,f4...) are blue screens.

I am thinking maybe I need to reinstall DSL, but I am so close to being done, I hate to start over again, but then, I too don't understand why the script runs from a shell but not from .xinitrc

Posted by jpeters on Oct. 29 2007,04:14
Quote (mikshaw @ Oct. 28 2007,15:49)
After starting X, press Ctrl+Alt+F1 (Alt+ one of the other F keys depending on your setup to return to X) and look to see if there are any error messages listed from the xinit script. You can use Alt+PageUp if you need to scroll up.

Any other way to scroll up? (page up, arrows, etc., don't work)

I'm still curious whether it's the particular script or something about cron that doesn't work from .xinitrc (if nobody else has cron loaded, I could experiment when I have time).

Edit:  oh....just saw the script; I thought this was related to cron...guess not..   The problem is probably that your app, FEH (or components), isn't loaded correctly prior to running the script;  so just run the script after the desktop is fully loaded...no problem.

Posted by vstech on Oct. 29 2007,12:11
Quote (jpeters @ Oct. 28 2007,23:14)
Edit:  oh....just saw the script; I thought this was related to cron...guess not..   The problem is probably that your app, FEH (or components), isn't loaded correctly prior to running the script;  so just run the script after the desktop is fully loaded...no problem.

I thought of that also... I did put a & at the end of the fluxbox and put flid=$!

on the next line I put a wait $flid

then put the lines in to run the script.

No change.

Posted by mikshaw on Oct. 29 2007,15:00
Quote
Any other way to scroll up? (page up, arrows, etc., don't work)
My bad. I said Alt+PageUp, but it's Shift+PageUp. In either case, though, it hadn't occured to me that this doesn't work when there is an application currently running in the tty. Maybe there is another way, but I don't know it.
Personally I redirect output to a file and tail it, so any error messages appear in aterm after X has started (if successful, otherwise I look in the log file).

I still don't have a good idea, but I stress the importance of finding specific error messages. Until you know the source of the problem, you won't be able to find a solution.

Posted by jpeters on Oct. 29 2007,16:27
Quote (vstech @ Oct. 28 2007,14:24)
ok,

thehatsrule, I added the line to make a log script, but no script is ever made... I am thinking the line is never executed to run the cron_start_frame.sh, but I have moved that line all around the .xinitrc script and NEVER get a log file.

I experimented around with .xinitrc.  There's just no way NOT to get a log file, even if you put in garbage. So if I write at the top, say before KEYTABLE,  "garbage>/tmp/garbage.log",   it will produce an empty file in /tmp called garbage.log.  Not to get a log file means ./.xinitrc isn't running.
Posted by robc on Oct. 29 2007,16:38
Before you try a reinstall you may want to try a clean .xinit. Just restart with liveCD with the norestore cheatcode and copy the .xinit file over. Then put
Code Sample
/mnt/hda1/mydsl/scripts/cron_start_frame.sh &
in the new .xinit file.

You also may want to tell dsl which screen to use before starting feh. I know I had problems getting X apps to run from scripts because of this. Just add:
Code Sample
export DISPLAY=:0
before
Code Sample
/usr/bin/feh -qxzrZF -D 10 /mnt/hda6/pictures/*.* &


P.S.: Just curious, have you tried adding sudo to the beginning of the line in th .xinit file? Sometimes if the mounted directory permissions are not set properly then you can run into problems.

Posted by vstech on Oct. 29 2007,19:43
Ok... recreating the .xinitrc file worked... the script now runs the display program from .xinitrc.

Thanks to all for your hlep.

Posted by jpeters on Oct. 29 2007,23:00
Quote (vstech @ Oct. 29 2007,14:43)
Ok... recreating the .xinitrc file worked... the script now runs the display program from .xinitrc.

Thanks to all for your hlep.

I'm wondering how the old one even managed to boot the desktop, given it wasn't reading anything.

Quote
My bad. I said Alt+PageUp, but it's Shift+PageUp.
Doesn't seem  to be any way to scroll up the page on my Dell; too bad, that's a nice trick. It does scroll up if I get out of x via contrl-alt-backspace using shift-page up, but then I lose anything previously loaded when restarting x.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.