Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:general_information:tutorial:autostart [2016/02/15 14:20] – created liedmannen:general_information:tutorial:autostart [2022/08/04 15:02] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== How to autostart application ======+++++ How to autostart application with systemd |
  
 ==== Example for creating Qt application autostart on TQMa6x BSP ==== ==== Example for creating Qt application autostart on TQMa6x BSP ====
  
  
-1.Create file /etc/systemd/qtdemo.service with following content : +1. Create file **/lib/systemd/system/demo.service** with following content :
-<code> +
-[UNIT] +
-Description=Start Multitouch Qt Demo +
- +
-[SERVICE] +
- +
-[Install] +
-WantedBy=multi-user.target +
-</code> +
-2.Create file lib/systemd/system/demo.service with following content :+
 <code> <code>
 [Unit] [Unit]
Line 29: Line 19:
 WantedBy=multi-user.target.wants WantedBy=multi-user.target.wants
 </code> </code>
-3. Create file /lib/systemd/systemd-demo with following content :+2. Create file **/lib/systemd/systemd-demo** with following content :
 <code> <code>
 #!/bin/sh #!/bin/sh
Line 47: Line 37:
 esac esac
 </code> </code>
-4. make system-demo executable.\\    +3. make system-demo executable.\\    
-5. create symlink demo.service in /etc/system/system/multi-user.target.wants that points to the file /lib/systemd/system/demo.service :+4. create symlink demo.service in **/etc/system/system/multi-user.target.wants** that points to the file **/lib/systemd/system/demo.service** :
 <code> <code>
 cd /etc/systemd/system/multi-user.target.wants/ cd /etc/systemd/system/multi-user.target.wants/
 ln -s /lib/systemd/system/demo.service demo.service ln -s /lib/systemd/system/demo.service demo.service
 </code> </code>
 +++++
 +++++ How to autostart application with initd |
 +
 +1. Move to **/etc/init.d** and create the startscript that you want to autorun on system boot. 
 +<code>
 +nano /etc/init.d/startscript
 +</code>
 +2. Use the following command to make the script executable.
 +<code>
 +chmod +x startscript
 +</code>
 +3. Create a symlink to the script in  **/etc/rc.d** 
 +<code>
 +ln -s /etc/init.d/startscript /etc/rc.d
 +</code>
 +++++
  • Last modified: 2022/08/04 15:04