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):
2. copy script directorycode:#! /usr/bin/python import os unixcommand1 = "mkdir /home/ubuntu/test" os.system(unixcommand1) unixcommand2 = "firefox" # won't launch firefox??? os.system(unixcommand2)
3. create linkcode:/etc/init.d
4. run updatecode:sudo ln -s /etc/init.d/startup.py /etc/rc3.d
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.
- write script, saving somewhere (for example /home/planetofdeviants/mystartupscript).
- ensure file has executable bit set.
- run script ensure works.
- open startup applications.
- press add.
- type descriptive name.
- for command, enter full path, e.g. /home/planetofdeviants/mystartupscript
- write explanatory comment.
- 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
Post a Comment