Page 1 of 2

Run script after boot

Posted: 16 Jan 2015, 16:04
by claudio
Hi my name is Claudio;

i have to run this script during startup:

#!/bin/sh

x0vncserver --PassordFile==/home/guest/.vnc/passwd

this script start a vnc server to the machine, i execute chmod a+x and if i execute manualy work but if i try to put in autostart for example using rc.local or porteus settings center don't work at all:(

any suggest ?

thaks a lot for your help! :)

Re: Run script after boot

Posted: 16 Jan 2015, 20:50
by fanthom
call this script with 'guiexec=' cheatcode and all should be good.

Re: Run script after boot

Posted: 19 Jan 2015, 13:24
by claudio
Thanks for your replay today i'll try and i'll post my report :D

Re: Run script after boot

Posted: 19 Jan 2015, 14:36
by claudio
I think there is something i don't understand...

now i edit rc.local like this :

guiexec=/home/guest/Desktop/Script.sh ( this is the path of my script).

i have not change my script, is the same of the first post whith permission chmod a+x. I try to reboot the sistem but nothing happens.

i olso try whith Porteus Settings Center -> boot options -> startup script i wrote this comand :

#!/bin/sh

guiexec=Xvncserver ..PasswordFile=/home/guest/.vnc/passwd

reboot the sistem and olso in this case nothing happens

Where am i wrong ? :)

thanks for all

Re: Run script after boot

Posted: 19 Jan 2015, 16:49
by beny
guiexec=my_script
guiexec=firefox;pidgin

... Execute specified command(s) in runlevel 4, when the graphical
interface is loaded; unlike 'cliexec' this cheatcode can be
used to start graphical applications.
Use semicolons (;) as command separators with no spaces.
... If you need to use spaces in the command line, replace them
with '~'.
Example: 'guiexec=firefox~kernel.org' will open the firefox
browser on the 'kernel.org' website.
hi this can explain better fanthom suggestion you have to put this in the boot line i think..

Re: Run script after boot

Posted: 20 Jan 2015, 16:01
by claudio
Thanks beny for your replay;
So now i write in porteus setting center this : guiexec=lxterminal~x0vncserver~--PasswordFile=/home/.vnc/passwd and nothing happens.
i olso try to write this in porteus setting center : guiexec=firefox~google.com and nothing happens too :(

there is something wrong again?

Re: Run script after boot

Posted: 20 Jan 2015, 16:37
by beny
hi claudio,

LABEL gui
MENU LABEL Graphics mode (XFCE)
KERNEL vmlinuz
APPEND initrd=initrd.xz changes=/porteus guiexec=firefox;pidgin
TEXT HELP
Run Porteus the best way we can.
Try to autoconfigure graphics
card and use the maximum
allowed resolution
ENDTEXT
you have to adds the line that interest you in the append line as above, i have tried and work, with thunar as root you have to enter in boot directory open the porteus.cfg and add your line, save the file and reboot ,can be another way? i don't know if this is possible via porteus setting centre
have you tried the startup script into the porteus setting centre?

Re: Run script after boot

Posted: 20 Jan 2015, 23:27
by brokenman
The above file can be found at: /mnt/sdxY/boot/syslinux/porteus.cfg where sdxY is the partition of your Porteus install.

Re: Run script after boot

Posted: 21 Jan 2015, 07:10
by fanthom
once again:
create a script -> call it from guiexec

sample: guiexec=my_script.sh

no need for this:

Code: Select all

guiexec=lxterminal~x0vncserver~--PasswordFile=/home/.vnc/passwd

Re: Run script after boot

Posted: 26 Jan 2015, 14:24
by claudio
Ty to all for the reply ;

so i try to do as beny suggest i find the file and i edit it with leafpad in super user terminal so :

LABEL gui
MENU LABEL Graphics mode (XFCE)
KERNEL vmlinuz
APPEND initrd=initrd.xz changes=/porteus guiexec=firefox <---------------------- !!!!
TEXT HELP
Run Porteus the best way we can.
Try to autoconfigure graphics
card and use the maximum
allowed resolution
ENDTEXT

Reboot the sistem and nothing happens firefox will not start, i don't try with my script because i thing if firefox will not start there are some problems.

I have a question for fanthom :

you say me that i have to create a script and call it from guiexec i m not a linux user and i don't know very well linux ambient so can you explain me better what you mean ?
i create my script you can see it in my firs post so now i have to call it from giuexec ... ok where ? how ? can you do an example ?
i try to call with guiexec in rc.local in this mode; editi rc.local with super user terminal and add this line "guiexec=lxterminal~x0vncserver~--PasswordFile=/home/.vnc/passwd "
for me this scritp open lxterminal and call the comand x0vncserver .... ...

Just another thing that i don't say first i use porteus installed on pc not in fresh mode i use the official guide here "Installing Porteus to a USB Flash Drive (from Linux)" http://www.porteus.org/tutorials/37-ins ... #USB-linux

thanks again for you support without you i'm totally lost :D !!

Re: Run script after boot

Posted: 26 Jan 2015, 16:37
by beny
hi claudio what desktop you use for,make the script executable and put in usr/bin or etc/rc.d and use the guiexec with the path of your script do a try please

Re: Run script after boot

Posted: 26 Jan 2015, 16:38
by fanthom
'guiexec=firefox' works perfectly here.

your changes must break something... - try in 'always fresh' mode.

Re: Run script after boot

Posted: 27 Jan 2015, 14:45
by claudio
Today i reinstall porteus follow the official guide again for work in a clean ambient.
i do as beny suggest so i create my script (call Script.sh) make it executable and put it in usr/bin and in /mnt/sdxY/boot/syslinux/porteus.cfg i write this:
*
*
APPEND initrd=initrd.xz changes=/porteus guiexec=/urs/bin/Script.sh
*
*

The script still does not start yet !

i don't try in always fresh mode because i don't need it work in this mode i have to work in not always fresh mode for a better management and future support.

So my script if lunched by me after boot work perfectly, open a terminal and start vncserver as listener, but I can not start it automatically.

Re: Run script after boot

Posted: 27 Jan 2015, 16:13
by beny
hi claudio do a try rename your script with a rc.your script and also type start and put in in etc/rc.d folder not inside rc local
rc.script.sh start do a try if start automatically, btw you have to change your pat in guiexec

Re: Run script after boot

Posted: 28 Jan 2015, 01:05
by brokenman
Make sure the script is executable: chmod +x /usr/bin/Script.sh
guiexec=/urs/bin/Script.sh <--- make sure urs is really usr in porteus.cfg.

guiexec= works fine here too, so if you are not prepared to try in fresh mode we can't help further. Something in changes is affecting it and we can't tell what it is.