Page 2 of 2

Re: Run script after boot

Posted: 28 Jan 2015, 03:42
by francois
When porteus is booted, what is the output of your script in command line:

Code: Select all

root@porteus:~# /urs/bin/Script.sh

Re: Run script after boot

Posted: 28 Jan 2015, 21:25
by beny
hi brokenman guiexec not work with user script,i have tried in my system and with the autostart panel in settings i can run automatically my tvheadend script,that work in background with xbmc.btw with xfce porteus not

Re: Run script after boot

Posted: 28 Jan 2015, 22:41
by brokenman
Tested twice here (in xfce) with user script and it works fine.

cat /mnt/sda8/dump/test.sh
#!/bin/bash
echo "This is a test" > /tmp/test.txt
chmod +x /mnt/sda8/dump/test.sh

Boot line: guiexec=/mnt/sda8/dump/test.sh

After boot the file /tmp/test.txt exists.

Run script after boot

Posted: 27 Apr 2021, 13:16
by hope
I want to write here although 10 years have passed; since my problem is very similar.

I want to change my Xkeyboard layout to "tr" my script file contains

#!/bin/sh
setxkbmap tr

it is not working. I used cheatcodes "guiexec" by assuming that it is related with X-display environment (gui related...)
Cheatcode correctly find my script file but could not execute above code. What is the problem? Can anybody help?

Run script after boot

Posted: 27 Apr 2021, 17:05
by Ed_P
Does your script execute when you start it manually in terminal? And does the kbmap change?

Have you tried the #!/bin/bash line that brokenman used? And have you made it executable with the chmod command?

When the guiexec cheatcode finds your script and tries to execute it are there any error messages?

Run script after boot

Posted: 30 Apr 2021, 11:29
by hope
I hoped that changing "sh" to "bash" may work, but nope !
1. How can I see the error it gives during boot? It was so fast that I could not read the error. I tried to see the contents of the files under "/var/log/" folder and I used dmesg but I could not see it...
2. My script only works when I open a terminal after system started. What can be the problem?
3. My script works flawlessly(I did all chmod etc.) and I plugged the energy cable to my computer :lol:

Run script after boot

Posted: 30 Apr 2021, 15:33
by Ed_P
Hi hope.

Can you install a different version of Porteus? Porteus 4.0 is the production version and Porteus 5.0rc2 has many fixes to problems in the 5.0rc1 release candidate version.

If you add a "read" command to the end of your script when it runs it will stop and if there are any error msgs you will have time to read them. Press Enter to continue. An alterative would be to add a "sleep 5" command to the end of your script. Same results as the "read" command but continues automatically after 5 seconds.

For those of us without a tr keyboard is there anything in memory we can check to see if the command works?

Run script after boot

Posted: 30 Apr 2021, 17:32
by hope
Ok, I tired
1. "debug" cheatcode , no help,
2. try to catch what has written in boot screen : I saw that : ERRORS are

cannot open display "default display"

and

can't open display

3. sorry but "read" command does not work, it didn't stop to read anything.
4. I add a command "setxkbmap tr" at the end of "/etc/rc.d/rc.local" file which should be another way to do the trick, but it didn't work.

In summary :
I only see the errors "cannot open default display" ... the only tip.
I could not start a simple Xkeyboard layout change code in Porteus. I am very sad... :( I can do it manually (i.e. running a simple script file after system started) but if I can do it automatically, why do i put an extra effort?

Run script after boot

Posted: 30 Apr 2021, 18:05
by hope
Ok, I think I found the root cause of the problem I faced in https://bbs.archlinux.org/viewtopic.php?id=155151 explains that, "setxkbmap" command only works in X environment, not in console. Only it works inside X, then it gives "cannot open display" error. Also it says that the I can only use "loadkeys` command to work with them... In openbox gxkb was problematic to load corret TR keyboard. I will try kmap cheatcode with trq option(file referring /usr/share/kbd/keymaps/i386/qwerty/trq.map). Also you can notice that in console you can change keyboard lauyout only with root priviliges. So sodu "loadkeys trq" only works in root shell.

I will use :

kmap=trq

command inside porteus.cfg file as cheatcode. If it does not work, i will use loadkeys as explained in [Solved] kmap=x cheatcode also in textonly console page with "cliexec" cheatcode. I will write the results here.

Run script after boot

Posted: 30 Apr 2021, 18:45
by hope
Ok, my problem was specific one due to "setxkbmap" command in my script only works in X environment. In console, before starting X, it does not work. so put it in a script is useless. I learnt it and I will be careful about any command including "x" character in it I will be more careful when I use it.

cheatcode cliexec=loadkeys~trq works perfect.
Thanks Ed_P for your replies, they will guide me the root cause of the problem I had.

Run script after boot

Posted: 30 Apr 2021, 18:53
by Ed_P
hope wrote:
30 Apr 2021, 17:32
but if I can do it automatically, why do i put an extra effort?
I admire your persistance hope. :punk:

To that end an option you may try. Create a desktop file that executes your script or command. Make it executable, test it, then copy it to /etc/xdg/autostart folder.

rc.local / touchpad problem (Post by Ed_P #60506)

Run script after boot

Posted: 01 May 2021, 15:06
by hope
Ed_P wrote:
30 Apr 2021, 18:53

To that end an option you may try. Create a desktop file that executes your script or command. Make it executable, test it, then copy it to /etc/xdg/autostart folder.

rc.local / touchpad problem (Post by Ed_P #60506)
Thanks Ed_P, it is an elegant way to solve similar "launch after X" problems. :good: