Skip to main content

Thread: Add Startup Script To Live Linux Distro


i want live linux distro customised have 1 change: python script launches when starts up.

have 2 basic areas understand solve problem: (1) make script lauch unix commands programs firefox, gedit, etc. (2) add script live distro.

know how this?


steps add startup script live linux distro

no steps now. (need these steps)


steps make startup script

problems solved:
(1) following solution requires , update , boot (step 4). can't live distro installed distro.
(2) script won't launch programs gedit or firefox, commands ls, mkdir, mount, etc.


note: have use python, instead of bash, because later on adding more python.


1. create file containing text (this python script):

code:
#! /usr/bin/python  import os  unixcommand1 = "mkdir /home/ubuntu/test" os.system(unixcommand1)  unixcommand2 = "firefox" # won't launch firefox??? os.system(unixcommand2)
2. copy script directory
code:
 /etc/init.d
3. create link

code:
sudo ln -s /etc/init.d/startup.py /etc/rc3.d
4. run update

code:
sudo update-rc.d startup.py defaults

i don't know python, can't write script (unless happy bash script), can placing startup if use ubuntu.

script in /etc/init.d not place put firefox, because start in root before logged in!

want script start after log in.


  1. write script, saving somewhere (for example /home/planetofdeviants/mystartupscript).
  2. ensure file has executable bit set.
  3. run script ensure works.
  4. open startup applications.
  5. press add.
  6. type descriptive name.
  7. for command, enter full path, e.g. /home/planetofdeviants/mystartupscript
  8. write explanatory comment.
  9. press add.


log out; log in; script should run within seconds.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] Add Startup Script To Live Linux Distro


Ubuntu

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account