Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started by: wwwronin on December 09, 2015, 01:07:50 AM
-
How to start program automatically after system started .
And how to load drivers(like video card) automatically.
-
How to start program automatically after system started .
Start in /opt/bootlocal.sh
-
Hi wwwronin.
bmarkus beat me but this may provide additional information. If i'm wrong, someone will correct and i'll learn too.
Drivers should be listed in onboot.lst, example xf86-video-intel.tcz.
/opt/bootlocal.sh for programs and commands at boot, especially requiring root, example:
#!/bin/sh
# put other system startup commands here
sudo /usr/local/sbin/basic-firewall noprompt
mkdir /mnt/nfs_test
/usr/local/etc/init.d/nfs-server start
/usr/local/etc/init.d/nfs-client start
Plain text document in ~/X.d./ for user/non-root items, example non-executable plain text document named startups containing:
amixer set Master 80% &
amixer set PCM 100% &
amixer set Master unmute &
amixer set PCM unmute &
conky &
xset s 300 &
-
That means I should rewrite /opt/bootlocal.sh in tinycore.gz?
-
/opt/bootlocal.sh already runs as root. No sudo required.
/opt/bootlocal.sh is by default added to the backup on system shutdown / reboot.
http://tinycorelinux.net/corebook.pdf
-
I read the cookbook , if I want to start X-Window based program , the startup script must be placed at ~/.X.d .I try to start editor program when system is loaded, that takes effect. But it seems that we must change the permission of files put in dir ~/.X.d . Is this correct ?
-
The permissions should be tc:staff
-
Thanks Misalf, noticed my sudo entry after the fact, remnant of newbier days :)
wwwronin file(s) in ~/.X.d. are NOT scripts, just plain text files named whatever. You can have multiple entries in a single file. Or create multiple files with a single entry in each file. The permissions are of course tc:staff, provided you're running as tc, as it's in your home directory. You do NOT need to chmod +x or anything, it's NOT a script.
So you could do...
filename: ~/.X.d./10_editor
entry: editor &
filename: ~/.X.d./20_firefox
entry: firefox &
....or just one simple file named ~/.X.d./startups containing:
editor &
firefox &
-
Thanks a lot
-
I use command like this "editor &" ,when system is started ,there a two editor windows . Why is that?