Run script after boot

Post here if you are a new Porteus member and you're looking for some help.
claudio
White ninja
White ninja
Posts: 6
Joined: 16 Jan 2015, 15:49
Distribution: Portues
Location: Italy

Run script after boot

Post#1 by claudio » 16 Jan 2015, 16:04

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! :)

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Run script after boot

Post#2 by fanthom » 16 Jan 2015, 20:50

call this script with 'guiexec=' cheatcode and all should be good.
Please add [Solved] to your thread title if the solution was found.

claudio
White ninja
White ninja
Posts: 6
Joined: 16 Jan 2015, 15:49
Distribution: Portues
Location: Italy

Re: Run script after boot

Post#3 by claudio » 19 Jan 2015, 13:24

Thanks for your replay today i'll try and i'll post my report :D

claudio
White ninja
White ninja
Posts: 6
Joined: 16 Jan 2015, 15:49
Distribution: Portues
Location: Italy

Re: Run script after boot

Post#4 by claudio » 19 Jan 2015, 14:36

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

beny
Full of knowledge
Full of knowledge
Posts: 2086
Joined: 02 Jan 2011, 11:33
Location: italy

Re: Run script after boot

Post#5 by beny » 19 Jan 2015, 16:49

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..

claudio
White ninja
White ninja
Posts: 6
Joined: 16 Jan 2015, 15:49
Distribution: Portues
Location: Italy

Re: Run script after boot

Post#6 by claudio » 20 Jan 2015, 16:01

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?

beny
Full of knowledge
Full of knowledge
Posts: 2086
Joined: 02 Jan 2011, 11:33
Location: italy

Re: Run script after boot

Post#7 by beny » 20 Jan 2015, 16:37

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?

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Run script after boot

Post#8 by brokenman » 20 Jan 2015, 23:27

The above file can be found at: /mnt/sdxY/boot/syslinux/porteus.cfg where sdxY is the partition of your Porteus install.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Run script after boot

Post#9 by fanthom » 21 Jan 2015, 07:10

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
Please add [Solved] to your thread title if the solution was found.

claudio
White ninja
White ninja
Posts: 6
Joined: 16 Jan 2015, 15:49
Distribution: Portues
Location: Italy

Re: Run script after boot

Post#10 by claudio » 26 Jan 2015, 14:24

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 !!

beny
Full of knowledge
Full of knowledge
Posts: 2086
Joined: 02 Jan 2011, 11:33
Location: italy

Re: Run script after boot

Post#11 by beny » 26 Jan 2015, 16:37

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

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Run script after boot

Post#12 by fanthom » 26 Jan 2015, 16:38

'guiexec=firefox' works perfectly here.

your changes must break something... - try in 'always fresh' mode.
Please add [Solved] to your thread title if the solution was found.

claudio
White ninja
White ninja
Posts: 6
Joined: 16 Jan 2015, 15:49
Distribution: Portues
Location: Italy

Re: Run script after boot

Post#13 by claudio » 27 Jan 2015, 14:45

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.

beny
Full of knowledge
Full of knowledge
Posts: 2086
Joined: 02 Jan 2011, 11:33
Location: italy

Re: Run script after boot

Post#14 by beny » 27 Jan 2015, 16:13

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

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Run script after boot

Post#15 by brokenman » 28 Jan 2015, 01:05

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.
How do i become super user?
Wear your underpants on the outside and put on a cape.

Post Reply