Squeeze Startup: Difference between revisions
From embeddedTS Manuals
(Created page with "From Debian the most straightforward way to add your application to startup is to create a startup script. This is an example simple startup script that will toggle the red l...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 8: | Line 8: | ||
case "$1" in | case "$1" in | ||
start) | start) | ||
/ | /path/to/your/application | ||
## If you are launching a daemon or other long running processes | ## If you are launching a daemon or other long running processes | ||
## this should be started with | ## this should be started with | ||
Line 14: | Line 14: | ||
;; | ;; | ||
stop) | stop) | ||
/ | # if you have anything that needs to run on shutdown | ||
/path/to/your/shutdown/scripts | |||
;; | ;; | ||
*) | *) | ||
Line 36: | Line 37: | ||
/etc/init.d/customstartup stop | /etc/init.d/customstartup stop | ||
</source> | </source> | ||
While this is useful for headless applications, if you are using X11 you should modify "/usr/bin/default-x-session": | |||
<source lang=bash> | |||
#!/bin/sh | |||
export HOME=/root/ | |||
export ICEWM_PRIVCFG=/mnt/root/root/.icewm/ | |||
icewm-lite & | |||
while ! xprop -root | grep -q _NET_SUPPORTING_WM_CHECK | |||
do | |||
sleep 0.1 | |||
done | |||
exec /usr/bin/fullscreen-webkit http://127.0.0.1 | |||
</source> | |||
Replace fullscreen-webkit with your own graphical application. |
Latest revision as of 09:43, 28 August 2015
From Debian the most straightforward way to add your application to startup is to create a startup script. This is an example simple startup script that will toggle the red led on during startup, and off during shutdown. In this case I'll name the file customstartup, but you can replace this with your application name as well.
Edit the file /etc/init.d/customstartup to contain this:
#! /bin/sh # /etc/init.d/customstartup case "$1" in start) /path/to/your/application ## If you are launching a daemon or other long running processes ## this should be started with # nohup /usr/local/bin/yourdaemon & ;; stop) # if you have anything that needs to run on shutdown /path/to/your/shutdown/scripts ;; *) echo "Usage: customstartup start|stop" >&2 exit 3 ;; esac exit 0
Note: | The $PATH variable is not set up by default in init scripts so this will either need to be done manually or the full path to your application must be included. |
To make this run during startup and shutdown:
update-rc.d customstartup defaults
To manually start and stop the script:
/etc/init.d/customstartup start
/etc/init.d/customstartup stop
While this is useful for headless applications, if you are using X11 you should modify "/usr/bin/default-x-session":
#!/bin/sh
export HOME=/root/
export ICEWM_PRIVCFG=/mnt/root/root/.icewm/
icewm-lite &
while ! xprop -root | grep -q _NET_SUPPORTING_WM_CHECK
do
sleep 0.1
done
exec /usr/bin/fullscreen-webkit http://127.0.0.1
Replace fullscreen-webkit with your own graphical application.