Startup script

Associate
Joined
21 Apr 2008
Posts
1,087
Location
By the river
Afternoon!

I'm running Mint14 (MATE) on a HP N40L, headless for the most part, but with GUI or VNC when its called for. My linux knowledge is fairly basic, but I can setup, access remotely, install stuff, navigate around, have created samba shares and dlna server etc so not completely ignorant :p

I want to execute a few commands on boot/login but despite much googling and trying a few things (inc GUI autostart stuff and various scripts/locations) I cannot get it to work.

The last thing I tried before resorting to asking for help:

created script: /etc/init.d/mybootscript
script contents:
"#!/bin/sh
<list of terminal commands>
minidlna
vncserver -geometry ...blahblah
...
...
<end list of terminal commands>"

then tried:

sudo chmod +x /etc/init.d/mybootscript
sudo update-rc.d mybootscript defaults 80

But no joy.

Any suggestions on how to do it properly?
Every link I get from Google says something different, I guess due to different distro's and revisions etc.

Open to suggestions of other means too (custom services?).

TIA
 
I don't know much about update-rc.d i just used 'defaults'

for vnc i used
Code:
su - [B]myusername[/B] bash -c '/usr/bin/vnc4server -depth 16 -geometry 1024x768' @

it will then run the command with your local user privileges (replace the myusername with your login).
vnc4server i found worked better for me for cutting/pasting between another computer.
 
I would look into using rc.local which will execute abitary scrips on start up.

Essentially, edit the file /etc/rc.local and anything that is in that file will execute after everything else has finished loading.
 
Back
Top Bottom