You are not logged in.

#1 2013-05-31 18:14:24

egon789
Member
Registered: 2013-05-31
Posts: 2

How to start application after boot

Hi.
I have to start an application (written by myself in c++) directly after startup of archlinux (from console it starts without problems).
In the other linux distributions I used I wrote a script in /etc/rc.d which starts the application. I read that in archlinux rc.d is detached from systemd.

I read some wiki sites about systemd and systemctl but I have no idea how it works and what I have to do.

Is there an other easy way to start an application (/myapp/application) on startup?
Or how can I get a step by step introduction to start my app with systemd?

Thanks in advance

Egon

Offline

#2 2013-05-31 18:16:32

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to start application after boot

Have you tried to write a service file? https://wiki.archlinux.org/index.php/Sy … vice_files
Some examples: https://wiki.archlinux.org/index.php/Systemd/Services

Last edited by karol (2013-05-31 18:17:41)

Offline

#3 2013-06-04 19:07:59

egon789
Member
Registered: 2013-05-31
Posts: 2

Re: How to start application after boot

Hi.
Thanks for your answer.

With help of your links I added a file with name /etc/systemd/system/myapp.service with the following content:

[Unit]
Description=Some text

[Service]
ExecStart=/myapp/myapp.sh

[Install]
WantedBy=multi-user.target

and enabled it with

systemctl enable app.service

After reboot the app was started.

I do not know if the content of the app.service file is correct an useful but it works ;-)

Offline

#4 2013-06-04 19:28:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to start application after boot

Glad you figured it out :-)
Please remember to mark the thread as solved https://bbs.archlinux.org/viewtopic.php?id=130309

Offline

Board footer

Powered by FluxBB