Built-in functions for skins

And this is exactly the expected behavior when done this way. @dbmandrake advised to use a systemd unit for this just one post above your quoted method.

thx, just read that comment,

i will try;

sudo systemctl start vncboot.sevice

D.

I’m not sure you understand though.

I believe you are going to have to write a systemd unit to handle this service. I have no idea if your installation provides one or not.

seems after some delay, boots fine

D.

you ARE scripting complete paths to the commands you are trying to use in runscript right?

Ok, sorry, yes I see your comments above, I thought I had read the complete path posts in another thread :wink:

So have you removed the initd script to startup VNC? Once you have done so, I think you should be able to issue

sudo systemctl enable vncboot.service

in order to get the system to start it at boot.

/etc/init.d/vncboot

ok, using the above script, vnc server starts only when called for

as seems to be the case with

sudo systemctl start vncboot.sevice

However, if the systemctl command is triggered from kodi via runscript() command, reboot takes approx 4-5 x mins to close the screen and start a fresh boot process.
if you issue the systemctl command via shell, then reboot is immediate when i trigger reboot via kodi gui.

thx once again,
D.

sorry must head to work, ill check back in a few hours,
Thx/

Ok, well this may be something that @sam_nazarko or @DBMandrake will have to look at now. Sorry I can’t be more help.

cheers for your help.

hopefully, those devs mentioned will notice the posts history and have time to investigate.

D.

Just in case someone comes here to read about this and wonders about a solution, this mayby can also help to run a script under a normal user with root privileges

Make the file owned by root and group root:

sudo chown root.root
Now set the sticky bit, make it executable for all and writable only by root:

sudo chmod 4755
Make sure that inside you script everything is invoked by sudo…
for example:
Fool=sudo rm -rf / (<-- kids do not try this at home it wrecks your install)
because without sudo inside your script the action would revert to your old UID.

So now if you run it by user osmc it can do dangerous stuf …

Hope this helps…