PDA

View Full Version : howto Statup Scripts



fedcba
09-12-2013, 07:01 AM
Hello!

How do I get a script to execute on boot in a persistent usb knoppix install?

I tried this, but it didn't work:



knoppix@Microknoppix:~$ cat /home/knoppix/.config/autostart/startup.desktop
[Desktop Entry]
Name=Startup
ServerExec="/bin/mkdir /tmp/test"
Icon=
Type=Application


...but there's no /tmp/test directory on boot :\

more info about my setup:


knoppix@Microknoppix:~$ uname -a
Linux Microknoppix 3.9.6 #25 SMP PREEMPT Sat Jun 15 15:27:01 CEST 2013 i686 GNU/Linux

klaus2008
09-12-2013, 09:50 AM
I would suggest that you read the latest Desktop Entry Specification (http://standards.freedesktop.org/desktop-entry-spec/latest/). On the page Recognized desktop entry keys (http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html) you will find out that there is no key 'ServerExec'.

fedcba
09-13-2013, 09:33 PM
Thanks for your fast response!

I updated the "ServerExec" line to "Exec" as per the link you provided, but there's still no /tmp/test file getting created on boot.


knoppix@Microknoppix:~$ cat .config/autostart/startup.desktop
[Desktop Entry]
Name=Startup
Exec="/bin/mkdir /tmp/external"
Icon=
Type=Application

If there's errors with processing .config/autostart/* files, is there anywhere these errors will be logged so I can check for messages?

klaus2008
09-13-2013, 11:56 PM
The first desktop file will create a new directory /tmp/testdir if it does not already exist.
knoppix@Knoppix720cd:~$ cat /home/knoppix/.config/autostart/mkTestdir.desktop
[Desktop Entry]
Name=mkTestdir
Exec=/bin/mkdir -p /tmp/testdir
Terminal=false
Type=Application The second desktop file will create an empty file /tmp/testfile if it does not already exist.

knoppix@Knoppix720cd:~$ cat /home/knoppix/.config/autostart/mkTestfile.desktop
[Desktop Entry]
Name=mkTestfile
Exec=/usr/bin/touch /tmp/testfile
Terminal=false
Type=Application